## GskRenderNode GskRenderNode — Simple scene graph element |

## Functions

GskRenderNode * | gsk_render_node_ref ()
void | gsk_render_node_unref ()
GskRenderNode * | gsk_render_node_get_parent ()
GskRenderNode * | gsk_render_node_get_first_child ()
GskRenderNode * | gsk_render_node_get_last_child ()
GskRenderNode * | gsk_render_node_get_next_sibling ()
GskRenderNode * | gsk_render_node_get_previous_sibling ()
GskRenderNode * | gsk_render_node_append_child ()
GskRenderNode * | gsk_render_node_prepend_child ()
GskRenderNode * | gsk_render_node_insert_child_at_pos ()
GskRenderNode * | gsk_render_node_insert_child_before ()
GskRenderNode * | gsk_render_node_insert_child_after ()
GskRenderNode * | gsk_render_node_remove_child ()
GskRenderNode * | gsk_render_node_replace_child ()
GskRenderNode * | gsk_render_node_remove_all_children ()
guint | gsk_render_node_get_n_children ()
gboolean | gsk_render_node_contains ()
void | gsk_render_node_set_bounds ()
void | gsk_render_node_set_transform ()
void | gsk_render_node_set_anchor_point ()
void | gsk_render_node_set_opacity ()
void | gsk_render_node_set_hidden ()
gboolean | gsk_render_node_is_hidden ()
void | gsk_render_node_set_opaque ()
gboolean | gsk_render_node_is_opaque ()
cairo_t * | gsk_render_node_get_draw_context ()
void | gsk_render_node_set_blend_mode ()
void | gsk_render_node_set_name ()
void | gsk_value_set_render_node ()
void | gsk_value_take_render_node ()
GskRenderNode * | gsk_value_get_render_node ()
GskRenderNode * | gsk_value_dup_render_node ()

## Types and Values

enum | GskBlendMode
enum | GskScalingFilter

## Object Hierarchy

        GskRenderNode

## Description

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.

## Functions

### gsk_render_node_ref ()

    GskRenderNode *
    gsk_render_node_ref (GskRenderNode *node);

Acquires a reference on the given GskRenderNode.

#### Parameters

node | a GskRenderNode |

#### Returns

the GskRenderNode with an additional reference.

[transfer none]

Since: 3.90

### gsk_render_node_unref ()

    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.

#### Parameters

node | a GskRenderNode |

Since: 3.90

### gsk_render_node_get_parent ()

    GskRenderNode *
    gsk_render_node_get_parent (GskRenderNode *node);

Returns the parent of the `node` .

#### Parameters

node | a GskRenderNode |

#### Returns

the parent of the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_get_first_child ()

    GskRenderNode *
    gsk_render_node_get_first_child (GskRenderNode *node);

Returns the first child of `node` .

#### Parameters

node | a GskRenderNode |

#### Returns

the first child of the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_get_last_child ()

    GskRenderNode *
    gsk_render_node_get_last_child (GskRenderNode *node);

Returns the last child of `node` .

#### Parameters

node | a GskRenderNode |

#### Returns

the last child of the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_get_next_sibling ()

    GskRenderNode *
    gsk_render_node_get_next_sibling (GskRenderNode *node);

Returns the next sibling of `node` .

#### Parameters

node | a GskRenderNode |

#### Returns

the next sibling of the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_get_previous_sibling ()

    GskRenderNode *
    gsk_render_node_get_previous_sibling (GskRenderNode *node);

Returns the previous sibling of `node` .

#### Parameters

node | a GskRenderNode |

#### Returns

the previous sibling of the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_append_child ()

    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` .

#### Parameters

node | a GskRenderNode |
child | a GskRenderNode |

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_prepend_child ()

    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` .

#### Parameters

node | a GskRenderNode |
child | a GskRenderNode |

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_insert_child_at_pos ()

    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` .

#### Parameters

node | a GskRenderNode |
child | a GskRenderNode |
index_ | the index in the list of children where `child` should be inserted at |

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_insert_child_before ()

    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` .

#### Parameters

node | a GskRenderNode |
child | a GskRenderNode |
sibling | a GskRenderNode, or `NULL`. | [nullable]

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_insert_child_after ()

    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` .

#### Parameters

node | a GskRenderNode |
child | a GskRenderNode |
sibling | a GskRenderNode, or `NULL`. | [nullable]

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_remove_child ()

    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.

#### Parameters

node | a GskRenderNode |
child | a GskRenderNode child of `node` |

#### Returns

the GskRenderNode.

[transfer none]

### gsk_render_node_replace_child ()

    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` .

#### Parameters

node | a GskRenderNode |
new_child | the GskRenderNode to add |
old_child | the GskRenderNode to replace |

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_remove_all_children ()

    GskRenderNode *
    gsk_render_node_remove_all_children (GskRenderNode *node);

Removes all children of `node` .

See also: `gsk_render_node_remove_child()`

#### Parameters

node | a GskRenderNode |

#### Returns

the GskRenderNode.

[transfer none]

Since: 3.90

### gsk_render_node_get_n_children ()

    guint
    gsk_render_node_get_n_children (GskRenderNode *node);

Retrieves the number of direct children of `node` .

#### Parameters

node | a GskRenderNode |

#### Returns

the number of children of the GskRenderNode

Since: 3.90

### gsk_render_node_contains ()

    gboolean
    gsk_render_node_contains (GskRenderNode *node,
                              GskRenderNode *descendant);

Checks whether `node` contains `descendant` .

#### Parameters

node | a GskRenderNode |
descendant | a GskRenderNode |

#### Returns

`TRUE` if the GskRenderNode contains the given descendant

Since: 3.90

### gsk_render_node_set_bounds ()

    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.

#### Parameters

node | a GskRenderNode |
bounds | the boundaries of `node` . | [nullable]

Since: 3.90

### gsk_render_node_set_transform ()

    void
    gsk_render_node_set_transform (GskRenderNode *node,
                                   const graphene_matrix_t *transform);

Sets the transformation matrix used when rendering the `node` .

#### Parameters

node | a GskRenderNode |
transform | a transformation matrix. | [nullable]

Since: 3.90

### gsk_render_node_set_anchor_point ()

    void
    gsk_render_node_set_anchor_point (GskRenderNode *node,
                                      const graphene_point3d_t *offset);

Set the anchor point used when rendering the `node` .

#### Parameters

node | a GskRenderNode |
offset | the anchor point |

Since: 3.90

### gsk_render_node_set_opacity ()

    void
    gsk_render_node_set_opacity (GskRenderNode *node,
                                 double opacity);

Sets the opacity of the `node` .

#### Parameters

node | a GskRenderNode |
opacity | the opacity of the node, between 0 (fully transparent) and 1 (fully opaque) |

Since: 3.90

### gsk_render_node_set_hidden ()

    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.

#### Parameters

node | a GskRenderNode |
hidden | whether the `node` should be hidden or not |

Since: 3.90

### gsk_render_node_is_hidden ()

    gboolean
    gsk_render_node_is_hidden (GskRenderNode *node);

Checks whether a `node` is hidden.

#### Parameters

node | a GskRenderNode |

#### Returns

`TRUE` if the GskRenderNode is hidden

Since: 3.90

### gsk_render_node_set_opaque ()

    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.

#### Parameters

node | a GskRenderNode |
opaque | whether the node is fully opaque or not |

Since: 3.90

### gsk_render_node_is_opaque ()

    gboolean
    gsk_render_node_is_opaque (GskRenderNode *node);

Retrieves the value set using `gsk_render_node_set_opaque()`.

#### Parameters

node | a GskRenderNode |

#### Returns

`TRUE` if the GskRenderNode is fully opaque

Since: 3.90

### gsk_render_node_get_draw_context ()

    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` .

#### Parameters

node | a GskRenderNode |
renderer | Renderer to optimize for or `NULL` for any. | [nullable]

#### Returns

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

[transfer full]

Since: 3.90

### gsk_render_node_set_blend_mode ()

    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`.

#### Parameters

node | a GskRenderNode |
blend_mode | the blend mode to be applied to the node's children |

Since: 3.90

### gsk_render_node_set_name ()

    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.

#### Parameters

node | a GskRenderNode |
name | a name for the node. | [nullable]

Since: 3.90

### gsk_value_set_render_node ()

    void
    gsk_value_set_render_node (GValue *value,
                               GskRenderNode *node);

Sets the `node` into the `value` .

This function acquires a reference on `node` .

#### Parameters

value | a GValue |
node | a GskRenderNode. | [nullable]

Since: 3.90

### gsk_value_take_render_node ()

    void
    gsk_value_take_render_node (GValue *value,
                                GskRenderNode *node);

Sets the `node` into the `value` , without taking a reference to it.

#### Parameters

value | a GValue |
node | a GskRenderNode. | [transfer full][nullable]

Since: 3.90

### gsk_value_get_render_node ()

    GskRenderNode *
    gsk_value_get_render_node (const GValue *value);

Retrieves the GskRenderNode stored inside the `value` .

#### Parameters

value | a GValue |

#### Returns

a GskRenderNode.

[transfer none][nullable]

Since: 3.90

### gsk_value_dup_render_node ()

    GskRenderNode *
    gsk_value_dup_render_node (const GValue *value);

Retrieves the GskRenderNode stored inside the `value` , and acquires a reference to it.

#### Parameters

value | a GValue |

#### Returns

a GskRenderNode.

[transfer none][nullable]

Since: 3.90

## Types and Values

### enum GskBlendMode

The blend modes available for render nodes.

The implementation of each blend mode is deferred to the rendering pipeline.

#### Members

GSK_BLEND_MODE_DEFAULT | The default blend mode, which specifies no blending |
GSK_BLEND_MODE_MULTIPLY | The source color is multiplied by the destination and replaces the destination |
GSK_BLEND_MODE_SCREEN | ... |
GSK_BLEND_MODE_OVERLAY | ... |
GSK_BLEND_MODE_DARKEN | ... |
GSK_BLEND_MODE_LIGHTEN | ... |
GSK_BLEND_MODE_COLOR_DODGE | ... |
GSK_BLEND_MODE_COLOR_BURN | ... |
GSK_BLEND_MODE_HARD_LIGHT | ... |
GSK_BLEND_MODE_SOFT_LIGHT | ... |
GSK_BLEND_MODE_DIFFERENCE | ... |
GSK_BLEND_MODE_EXCLUSION | ... |

Since: 3.90

### enum GskScalingFilter

The filters used when scaling texture data.

The actual implementation of each filter is deferred to the rendering pipeline.

#### Members

GSK_SCALING_FILTER_LINEAR | linear interpolation filter |
GSK_SCALING_FILTER_NEAREST | nearest neighbor interpolation filter |
GSK_SCALING_FILTER_TRILINEAR | linear interpolation along each axis, plus mipmap generation, with linear interpolation along the mipmap levels |

Since: 3.90