Class: Gsk::CairoNode

Inherits:
RenderNode show all
Defined in:
(unknown)

Overview

A render node for a Cairo surface.

Instance Method Summary collapse

Methods inherited from RenderNode

deserialize, #draw, #get_bounds, #node_type, #ref, #serialize, #unref, #write_to_file

Constructor Details

#initialize(bounds) ⇒ Gsk::CairoNode

Creates a GskRenderNode that will render a cairo surface into the area given by bounds.

You can draw to the cairo surface using [methodGsk.CairoNode.get_draw_context].

Parameters:

  • bounds (Graphene::Rect)

    the rectangle to render to

Instance Method Details

#draw_contextcairo::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.

Returns:

  • (cairo::Context)

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

#surfacecairo::Surface

Retrieves the Cairo surface used by the render node.

Returns:

  • (cairo::Surface)

    a Cairo surface