About all my projects
Gnome::Gsk4::CairoNode

Gnome::Gsk4::CairoNode

Description

A render node for a Cairo surface.

Class initialization

new

:native-object

Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.

multi method new ( N-Object :$native-object! )

new-caironode

Creates a Gnome::Gsk4::RenderNode that will render a cairo surface into the area given by $bounds.

You can draw to the cairo surface using .get-draw-context().

method new-caironode ( N-Object $bounds --> Gnome::Gsk4::CairoNode \)
  • $bounds; the rectangle to render to

Methods

get-draw-context

Creates a Cairo context for drawing using the surface associated to the render node.

If no surface exists yet, a surface will be created optimized for rendering to $renderer.

method get-draw-context (--> N-Object )

Return value; a Cairo context used for drawing; use cairo_destroy() when done drawing.

get-surface

Retrieves the Cairo surface used by the render node.

method get-surface (--> N-Object )

Return value; a Cairo surface.