mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
gsk: Add GskRenderNodeClass.make_immutable()
This commit is contained in:
parent
e4ee65fd19
commit
d907f60843
@ -841,19 +841,12 @@ gsk_render_node_get_blend_mode (GskRenderNode *node)
|
||||
void
|
||||
gsk_render_node_make_immutable (GskRenderNode *node)
|
||||
{
|
||||
GskRenderNode *child;
|
||||
|
||||
if (!node->is_mutable)
|
||||
return;
|
||||
|
||||
node->is_mutable = FALSE;
|
||||
node->node_class->make_immutable (node);
|
||||
|
||||
for (child = gsk_render_node_get_first_child (node);
|
||||
child != NULL;
|
||||
child = gsk_render_node_get_next_sibling (child))
|
||||
{
|
||||
gsk_render_node_make_immutable (child);
|
||||
}
|
||||
node->is_mutable = FALSE;
|
||||
}
|
||||
|
||||
/*< private >
|
||||
|
@ -41,11 +41,17 @@ gsk_texture_node_finalize (GskRenderNode *node)
|
||||
gsk_texture_unref (self->texture);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_texture_node_make_immutable (GskRenderNode *node)
|
||||
{
|
||||
}
|
||||
|
||||
static const GskRenderNodeClass GSK_TEXTURE_NODE_CLASS = {
|
||||
GSK_TEXTURE_NODE,
|
||||
sizeof (GskTextureNode),
|
||||
"GskTextureNode",
|
||||
gsk_texture_node_finalize
|
||||
gsk_texture_node_finalize,
|
||||
gsk_texture_node_make_immutable
|
||||
};
|
||||
|
||||
GskTexture *
|
||||
@ -109,11 +115,17 @@ gsk_cairo_node_finalize (GskRenderNode *node)
|
||||
cairo_surface_destroy (self->surface);
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_cairo_node_make_immutable (GskRenderNode *node)
|
||||
{
|
||||
}
|
||||
|
||||
static const GskRenderNodeClass GSK_CAIRO_NODE_CLASS = {
|
||||
GSK_CAIRO_NODE,
|
||||
sizeof (GskCairoNode),
|
||||
"GskCairoNode",
|
||||
gsk_cairo_node_finalize
|
||||
gsk_cairo_node_finalize,
|
||||
gsk_cairo_node_make_immutable
|
||||
};
|
||||
|
||||
/*< private >
|
||||
@ -252,11 +264,25 @@ gsk_container_node_finalize (GskRenderNode *node)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_container_node_make_immutable (GskRenderNode *node)
|
||||
{
|
||||
GskRenderNode *child;
|
||||
|
||||
for (child = gsk_render_node_get_first_child (node);
|
||||
child != NULL;
|
||||
child = gsk_render_node_get_next_sibling (child))
|
||||
{
|
||||
gsk_render_node_make_immutable (child);
|
||||
}
|
||||
}
|
||||
|
||||
static const GskRenderNodeClass GSK_CONTAINER_NODE_CLASS = {
|
||||
GSK_CONTAINER_NODE,
|
||||
sizeof (GskRenderNode),
|
||||
"GskContainerNode",
|
||||
gsk_container_node_finalize
|
||||
gsk_container_node_finalize,
|
||||
gsk_container_node_make_immutable
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -62,6 +62,7 @@ struct _GskRenderNodeClass
|
||||
gsize struct_size;
|
||||
const char *type_name;
|
||||
void (* finalize) (GskRenderNode *node);
|
||||
void (* make_immutable) (GskRenderNode *node);
|
||||
};
|
||||
|
||||
GskRenderNode *gsk_render_node_new (const GskRenderNodeClass *node_class);
|
||||
|
Loading…
Reference in New Issue
Block a user