Top | ![]() |
![]() |
![]() |
![]() |
GskRenderer * | gsk_renderer_new_for_surface () |
GdkSurface * | gsk_renderer_get_surface () |
GdkDisplay * | gsk_renderer_get_display () |
gboolean | gsk_renderer_realize () |
void | gsk_renderer_unrealize () |
void | gsk_renderer_render () |
GdkTexture * | gsk_renderer_render_texture () |
GskRenderer is a class that renders a scene graph defined via a tree of GskRenderNode instances.
Typically you will use a GskRenderer instance to repeatedly call
gsk_renderer_render()
to update the contents of its associated GdkSurface.
It is necessary to realize a GskRenderer instance using gsk_renderer_realize()
before calling gsk_renderer_render()
, in order to create the appropriate
windowing system resources needed to render the scene.
GskRenderer *
gsk_renderer_new_for_surface (GdkSurface *surface
);
Creates an appropriate GskRenderer instance for the given surface
.
The renderer will be realized when it is returned.
GdkSurface *
gsk_renderer_get_surface (GskRenderer *renderer
);
Retrieves the GdkSurface set using gsk_renderer_realize()
. If the renderer
has not been realized yet, NULL
will be returned.
GdkDisplay *
gsk_renderer_get_display (GskRenderer *renderer
);
Retrieves the GdkDisplay used when creating the GskRenderer.
gboolean gsk_renderer_realize (GskRenderer *renderer
,GdkSurface *surface
,GError **error
);
Creates the resources needed by the renderer
to render the scene
graph.
renderer |
||
surface |
the GdkSurface renderer will be used on |
|
error |
return location for an error |
void
gsk_renderer_unrealize (GskRenderer *renderer
);
Releases all the resources created by gsk_renderer_realize()
.
void gsk_renderer_render (GskRenderer *renderer
,GskRenderNode *root
,const cairo_region_t *region
);
Renders the scene graph, described by a tree of GskRenderNode instances,
ensuring that the given region
gets redrawn.
Renderers must ensure that changes of the contents given by the root
node as well as the area given by region
are redrawn. They are however
free to not redraw any pixel outside of region
if they can guarantee that
it didn't change.
The renderer
will acquire a reference on the GskRenderNode tree while
the rendering is in progress.
GdkTexture * gsk_renderer_render_texture (GskRenderer *renderer
,GskRenderNode *root
,const graphene_rect_t *viewport
);
Renders the scene graph, described by a tree of GskRenderNode instances, to a GdkTexture.
The renderer
will acquire a reference on the GskRenderNode tree while
the rendering is in progress.
If you want to apply any transformations to root
, you should put it into a
transform node and pass that node instead.
renderer |
a realized GdkRenderer |
|
root |
||
viewport |
the section to draw or |
[allow-none] |
“display”
property“display” GdkDisplay *
The GdkDisplay used by the GskRenderer.
Flags: Read / Write / Construct Only