Top |
Functions
GdkSurface * | gsk_renderer_get_surface () |
gboolean | gsk_renderer_realize () |
void | gsk_renderer_unrealize () |
gboolean | gsk_renderer_is_realized () |
void | gsk_renderer_render () |
GdkTexture * | gsk_renderer_render_texture () |
GskRenderer * | gsk_renderer_new_for_surface () |
GskRenderer * | gsk_gl_renderer_new () |
GskRenderer * | gsk_cairo_renderer_new () |
GskRenderer * | gsk_vulkan_renderer_new () |
GskRenderer * | gsk_broadway_renderer_new () |
Description
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.
Functions
gsk_renderer_get_surface ()
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.
gsk_renderer_realize ()
gboolean gsk_renderer_realize (GskRenderer *renderer
,GdkSurface *surface
,GError **error
);
Creates the resources needed by the renderer
to render the scene
graph.
Parameters
renderer |
||
surface |
the GdkSurface renderer will be used on |
|
error |
return location for an error |
gsk_renderer_unrealize ()
void
gsk_renderer_unrealize (GskRenderer *renderer
);
Releases all the resources created by gsk_renderer_realize()
.
gsk_renderer_is_realized ()
gboolean
gsk_renderer_is_realized (GskRenderer *renderer
);
Checks whether the renderer
is realized or not.
gsk_renderer_render ()
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.
Parameters
renderer |
||
root |
||
region |
the cairo_region_t that must be redrawn or |
[nullable] |
gsk_renderer_render_texture ()
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.
Parameters
renderer |
a realized GskRenderer |
|
root |
||
viewport |
the section to draw or |
[allow-none] |
gsk_renderer_new_for_surface ()
GskRenderer *
gsk_renderer_new_for_surface (GdkSurface *surface
);
Creates an appropriate GskRenderer instance for the given surface
.
If the GSK_RENDERER
environment variable is set, GSK will
try that renderer first, before trying the backend-specific
default. The ultimate fallback is the cairo renderer.
The renderer will be realized before it is returned.
gsk_gl_renderer_new ()
GskRenderer *
gsk_gl_renderer_new (void
);
Creates a new GskRenderer using OpenGL. This is the default renderer used by GTK.
gsk_cairo_renderer_new ()
GskRenderer *
gsk_cairo_renderer_new (void
);
Creates a new Cairo renderer.
The Cairo renderer is the fallback renderer drawing in ways similar to how GTK 3 drew its content. Its primary use is as comparison tool.
The Cairo renderer is incomplete. It cannot render 3D transformed content and will instead render an error marker. Its usage should be avoided.
gsk_vulkan_renderer_new ()
GskRenderer *
gsk_vulkan_renderer_new (void
);
Creates a new Vulkan renderer.
The Vulkan renderer is a renderer that uses the Vulkan library for rendering.
This function is only available when GTK was compiled with Vulkan support.
gsk_broadway_renderer_new ()
GskRenderer *
gsk_broadway_renderer_new (void
);
Creates a new Broadway renderer.
The Broadway renderer is the default renderer for the broadway backend.
It will only work with broadway surfaces, otherwise it will fail the
call to gsk_renderer_realize()
.
This function is only available when GTK was compiled with Broadway support.
Types and Values
GskRenderer
typedef struct _GskRenderer GskRenderer;
Base type for the object managing the rendering pipeline for a GdkSurface.
Property Details
The “realized”
property
“realized” gboolean
The renderer has been associated with a surface.
Owner: GskRenderer
Flags: Read
Default value: FALSE
The “surface”
property
“surface” GdkSurface *
The surface associated to the renderer.
Owner: GskRenderer
Flags: Read