Swfdec Reference Manual | ||||
---|---|---|---|---|
#include <swfdec/swfdec.h> SwfdecRenderer; SwfdecRendererClass; SwfdecRenderer* swfdec_renderer_new (cairo_surface_t *surface); SwfdecRenderer* swfdec_renderer_new_for_player (cairo_surface_t *surface, SwfdecPlayer *player); cairo_surface_t* swfdec_renderer_get_surface (SwfdecRenderer *renderer);
The SwfdecRenderer object is used internally to improve rendering done by Swfdec.
The first thing SwfdecRenderer does is provide a way to cache data relevant to rendering.
The second thing it does is provide access to the surface that is used for
rendering, even when not in the process of rendering. This is relevant for
font backends, as different surfaces provide different native fonts. See
swfdec_player_set_default_backend()
for details about this.
The third thing it does is provide a list of virtual functions for critical operations that you can optimize using subclasses to provide faster implementations. Note that a working default implementation is provided, so you only need to override the functions you care about. See SwfdecRendererClass for details about these functions.
typedef struct _SwfdecRenderer SwfdecRenderer;
The base renderer object. All its members are private.
typedef struct { cairo_surface_t * (* create_similar) (SwfdecRenderer * renderer, cairo_surface_t * surface); cairo_surface_t * (* create_for_data) (SwfdecRenderer * renderer, guint8 * data, cairo_format_t format, guint width, guint height, guint rowstride); } SwfdecRendererClass;
The base class for the renderer. It contains some virtual functions that can be overridden in subclasses to accelerate certain time-critical Swfdec functions. For example, a subclass could make use of special hardware features on embedded devices.
|
This function imitates cairo_surface_create_similar() . It
is supposed to create a surface with identical contents as
the given surface, but tuned for usage with the given
renderer.
|
|
This function imitates cairo_surface_create_for_data() . It
creates a surface for the given data, tuned for the given
renderer. The function takes ownership of the passed in
data and is responsible for freeing it with g_free() when
it no longer needs it.
|
SwfdecRenderer* swfdec_renderer_new (cairo_surface_t *surface);
Creates a new renderer to be used with the given surface
.
|
a cairo surface |
Returns : |
a new renderer |
SwfdecRenderer* swfdec_renderer_new_for_player (cairo_surface_t *surface, SwfdecPlayer *player);
Creates a renderer to be used with the given surface
and player
. The
renderer will use the same cache as the player
.
|
a cairo surface |
|
the player this renderer should be used with |
Returns : |
a new renderer |
cairo_surface_t* swfdec_renderer_get_surface (SwfdecRenderer *renderer);
Gets the surface that was used when creating this surface.
|
a renderer |
Returns : |
the surface used by this renderer |
"surface"
property"surface" gpointer : Read / Write / Construct Only
cairo surface in use by this renderer.