Top | ![]() |
![]() |
![]() |
![]() |
GskRenderNode is the basic block in a scene graph to be rendered using GskRenderer.
Each node has a parent, except the top-level node; each node may have children nodes.
Each node has an associated drawing surface, which has the size of
the rectangle set using gsk_render_node_set_bounds()
. Nodes have an
associated transformation matrix, which is used to position and
transform the node on the scene graph; additionally, they also have
a child transformation matrix, which will be applied to each child.
Render nodes are meant to be transient; once they have been associated to a GskRenderer it's safe to release any reference you have on them. Once a GskRenderNode has been rendered, it is marked as immutable, and cannot be modified.
GskRenderNode *
gsk_render_node_ref (GskRenderNode *node
);
Acquires a reference on the given GskRenderNode.
Since: 3.90
void
gsk_render_node_unref (GskRenderNode *node
);
Releases a reference on the given GskRenderNode.
If the reference was the last, the resources associated to the node
are
freed.
Since: 3.90
GskRenderNode *
gsk_render_node_get_parent (GskRenderNode *node
);
Returns the parent of the node
.
Since: 3.90
GskRenderNode *
gsk_render_node_get_first_child (GskRenderNode *node
);
Returns the first child of node
.
Since: 3.90
GskRenderNode *
gsk_render_node_get_last_child (GskRenderNode *node
);
Returns the last child of node
.
Since: 3.90
GskRenderNode *
gsk_render_node_get_next_sibling (GskRenderNode *node
);
Returns the next sibling of node
.
Since: 3.90
GskRenderNode *
gsk_render_node_get_previous_sibling (GskRenderNode *node
);
Returns the previous sibling of node
.
Since: 3.90
GskRenderNode * gsk_render_node_append_child (GskRenderNode *node
,GskRenderNode *child
);
Appends child
to the list of children of node
.
This function acquires a reference on child
.
Since: 3.90
GskRenderNode * gsk_render_node_prepend_child (GskRenderNode *node
,GskRenderNode *child
);
Prepends child
to the list of children of node
.
This function acquires a reference on child
.
Since: 3.90
GskRenderNode * gsk_render_node_insert_child_at_pos (GskRenderNode *node
,GskRenderNode *child
,int index_
);
Inserts child
into the list of children of node
, using the given index_
.
If index_
is 0, the child
will be prepended to the list of children.
If index_
is less than zero, or equal to the number of children, the child
will be appended to the list of children.
This function acquires a reference on child
.
Since: 3.90
GskRenderNode * gsk_render_node_insert_child_before (GskRenderNode *node
,GskRenderNode *child
,GskRenderNode *sibling
);
Inserts child
in the list of children of node
, before sibling
.
If sibling
is NULL
, the child
will be inserted at the beginning of the
list of children.
This function acquires a reference of child
.
Since: 3.90
GskRenderNode * gsk_render_node_insert_child_after (GskRenderNode *node
,GskRenderNode *child
,GskRenderNode *sibling
);
Inserts child
in the list of children of node
, after sibling
.
If sibling
is NULL
, the child
will be inserted at the end of the list
of children.
This function acquires a reference of child
.
Since: 3.90
GskRenderNode * gsk_render_node_remove_child (GskRenderNode *node
,GskRenderNode *child
);
Removes child
from the list of children of node
.
This function releases the reference acquired when adding child
to the
list of children.
GskRenderNode * gsk_render_node_replace_child (GskRenderNode *node
,GskRenderNode *new_child
,GskRenderNode *old_child
);
Replaces old_child
with new_child
in the list of children of node
.
This function acquires a reference to new_child
, and releases a reference
of old_child
.
Since: 3.90
GskRenderNode *
gsk_render_node_remove_all_children (GskRenderNode *node
);
Removes all children of node
.
See also: gsk_render_node_remove_child()
Since: 3.90
guint
gsk_render_node_get_n_children (GskRenderNode *node
);
Retrieves the number of direct children of node
.
Since: 3.90
gboolean gsk_render_node_contains (GskRenderNode *node
,GskRenderNode *descendant
);
Checks whether node
contains descendant
.
Since: 3.90
void gsk_render_node_set_bounds (GskRenderNode *node
,const graphene_rect_t *bounds
);
Sets the boundaries of node
, which describe the geometry of the
render node, and are used to clip the surface associated to it
when rendering.
Since: 3.90
void gsk_render_node_set_transform (GskRenderNode *node
,const graphene_matrix_t *transform
);
Sets the transformation matrix used when rendering the node
.
Since: 3.90
void gsk_render_node_set_anchor_point (GskRenderNode *node
,const graphene_point3d_t *offset
);
Set the anchor point used when rendering the node
.
Since: 3.90
void gsk_render_node_set_opacity (GskRenderNode *node
,double opacity
);
Sets the opacity of the node
.
Since: 3.90
void gsk_render_node_set_hidden (GskRenderNode *node
,gboolean hidden
);
Sets whether the node
should be hidden.
Hidden nodes, and their descendants, are not rendered.
Since: 3.90
gboolean
gsk_render_node_is_hidden (GskRenderNode *node
);
Checks whether a node
is hidden.
Since: 3.90
void gsk_render_node_set_opaque (GskRenderNode *node
,gboolean opaque
);
Sets whether the node is known to be fully opaque.
Fully opaque nodes will ignore the opacity set using gsk_render_node_set_opacity()
,
but if their parent is not opaque they may still be rendered with an opacity.
Renderers may use this information to optimize the rendering pipeline.
Since: 3.90
gboolean
gsk_render_node_is_opaque (GskRenderNode *node
);
Retrieves the value set using gsk_render_node_set_opaque()
.
Since: 3.90
cairo_t * gsk_render_node_get_draw_context (GskRenderNode *node
,GskRenderer *renderer
);
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
.
Since: 3.90
void gsk_render_node_set_blend_mode (GskRenderNode *node
,GskBlendMode blend_mode
);
Sets the blend mode to be used when rendering the children
of the node
.
The default value is GSK_BLEND_MODE_DEFAULT
.
Since: 3.90
void gsk_render_node_set_name (GskRenderNode *node
,const char *name
);
Sets the name of the node.
A name is generally useful for debugging purposes.
Since: 3.90
void gsk_value_set_render_node (GValue *value
,GskRenderNode *node
);
Sets the node
into the value
.
This function acquires a reference on node
.
Since: 3.90
void gsk_value_take_render_node (GValue *value
,GskRenderNode *node
);
Sets the node
into the value
, without taking a reference to it.
Since: 3.90
GskRenderNode *
gsk_value_get_render_node (const GValue *value
);
Retrieves the GskRenderNode stored inside the value
.
Since: 3.90
GskRenderNode *
gsk_value_dup_render_node (const GValue *value
);
Retrieves the GskRenderNode stored inside the value
, and
acquires a reference to it.
Since: 3.90
The blend modes available for render nodes.
The implementation of each blend mode is deferred to the rendering pipeline.
The default blend mode, which specifies no blending |
||
The source color is multiplied by the destination and replaces the destination |
||
... |
||
... |
||
... |
||
... |
||
... |
||
... |
||
... |
||
... |
||
... |
||
... |
Since: 3.90