Top | ![]() |
![]() |
![]() |
![]() |
SwfdecRenderer * | swfdec_renderer_new () |
SwfdecRenderer * | swfdec_renderer_new_for_player () |
cairo_surface_t * | swfdec_renderer_get_surface () |
The SwfdecRenderer object is used internally to improve rendering done by Swfdec.
The first thing a SwfdecRenderer does is provide a way to cache data relevant to rendering. This means it will cache surfaces that are expensive to create (like decoded JPEG images) in a format most suitable to quick rendering. Therefore, it's a good idea to keep renderers around as long as any drawing to the attached surface happens.
The second thing a SwfdecRenderer 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 SwfdecRenderer 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.
SwfdecRenderer *
swfdec_renderer_new (cairo_surface_t *surface
);
Creates a new renderer to be used with the given surface
.
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
.
cairo_surface_t *
swfdec_renderer_get_surface (SwfdecRenderer *renderer
);
Gets the surface that was used when creating this surface.
typedef struct _SwfdecRenderer SwfdecRenderer;
The base renderer object. All its members are private.
struct SwfdecRendererClass { 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); };
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 |
||
This function imitates |