Trait gsk4::prelude::RendererExtManual [−][src]
pub trait RendererExtManual: 'static {
fn render<P: AsRef<RenderNode>>(&self, root: &P, region: Option<&Region>);
fn render_texture<P: AsRef<RenderNode>>(
&self,
root: &P,
viewport: Option<&Rect>
) -> Option<Texture>;
}
Required methods
Renders the scene graph, described by a tree of RenderNode
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 self
will acquire a reference on the RenderNode
tree while
the rendering is in progress.
root
region
the cairo_region_t
that must be redrawn or None
for the whole window
fn render_texture<P: AsRef<RenderNode>>(
&self,
root: &P,
viewport: Option<&Rect>
) -> Option<Texture>
fn render_texture<P: AsRef<RenderNode>>(
&self,
root: &P,
viewport: Option<&Rect>
) -> Option<Texture>
Renders the scene graph, described by a tree of RenderNode
instances,
to a gdk::Texture
.
The self
will acquire a reference on the RenderNode
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.
root
viewport
the section to draw or None
to use root
’s bounds
Returns
a gdk::Texture
with the rendered contents of root
.