Class: Gsk::Renderer
- Inherits:
-
Object
- Object
- Gsk::Renderer
- Defined in:
- (unknown)
Direct Known Subclasses
BroadwayRenderer, CairoRenderer, GLRenderer, NglRenderer, VulkanRenderer
Instance Method Summary collapse
-
#initialize(surface) ⇒ Gsk::Renderer
constructor
Creates an appropriate
GskRendererinstance for the given surface. -
#is_realized ⇒ Boolean
Checks whether the renderer is realized or not.
-
#realize(surface) ⇒ Boolean
Creates the resources needed by the renderer to render the scene graph.
-
#realize_for_display(display) ⇒ Boolean
Creates the resources needed by the renderer to render the scene graph.
-
#realized=(realized) ⇒ Boolean
Whether the renderer has been associated with a surface or draw context.
-
#realized? ⇒ Boolean
Whether the renderer has been associated with a surface or draw context.
-
#render(root, region) ⇒ nil
Renders the scene graph, described by a tree of
GskRenderNodeinstances to the renderer's surface, ensuring that the given region gets redrawn. -
#render_texture(root, viewport) ⇒ Gdk::Texture
Renders the scene graph, described by a tree of
GskRenderNodeinstances, to aGdkTexture. -
#surface ⇒ Gdk::Surface
The surface associated with renderer.
-
#surface=(surface) ⇒ Gdk::Surface
The surface associated with renderer.
-
#unrealize ⇒ nil
Releases all the resources created by gsk_renderer_realize().
Constructor Details
#initialize(surface) ⇒ Gsk::Renderer
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.
Instance Method Details
#is_realized ⇒ Boolean
Checks whether the renderer is realized or not.
#realize(surface) ⇒ Boolean
Creates the resources needed by the renderer to render the scene graph.
Since GTK 4.6, the surface may be NULL, which allows using
renderers without having to create a surface.
Since GTK 4.14, it is recommended to use [methodGsk.Renderer.realize_for_display]
instead.
Note that it is mandatory to call [methodGsk.Renderer.unrealize] before destroying the renderer.
#realize_for_display(display) ⇒ Boolean
Creates the resources needed by the renderer to render the scene graph.
Note that it is mandatory to call [methodGsk.Renderer.unrealize] before destroying the renderer.
#realized=(realized) ⇒ Boolean
Whether the renderer has been associated with a surface or draw context.
#realized? ⇒ Boolean
Whether the renderer has been associated with a surface or draw context.
#render(root, region) ⇒ nil
Renders the scene graph, described by a tree of GskRenderNode instances
to the renderer's surface, ensuring that the given region gets redrawn.
If the renderer has no associated surface, this function does nothing.
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.
#render_texture(root, viewport) ⇒ Gdk::Texture
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.
#surface ⇒ Gdk::Surface
The surface associated with renderer.
#surface=(surface) ⇒ Gdk::Surface
The surface associated with renderer.
#unrealize ⇒ nil
Releases all the resources created by gsk_renderer_realize().