diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-12-21 11:00:18 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2016-12-21 14:01:34 +0100 |
commit | 2d4b46f4f95025be01ffa5cf0f5abfe354d79a93 (patch) | |
tree | 3edebc0e1f3ca8a60dd3c163fc5cf76a38c95c2d | |
parent | 4ee45b76cad0204a0d78a0279f31f8a79eeaff7f (diff) | |
download | gtk+-2d4b46f4f95025be01ffa5cf0f5abfe354d79a93.tar.gz |
gsk: Drop gsk_render_node_make_immutable, nodes are always immutable
-rw-r--r-- | gsk/gskrenderer.c | 3 | ||||
-rw-r--r-- | gsk/gskrendernode.c | 25 | ||||
-rw-r--r-- | gsk/gskrendernodeimpl.c | 122 | ||||
-rw-r--r-- | gsk/gskrendernodeprivate.h | 6 |
4 files changed, 3 insertions, 153 deletions
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index 5c22d1b31c..b50ebd7f56 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -616,7 +616,7 @@ gsk_renderer_unrealize (GskRenderer *renderer) * using the given #GdkDrawingContext. * * The @renderer will acquire a reference on the #GskRenderNode tree while - * the rendering is in progress, and will make the tree immutable. + * the rendering is in progress. * * Since: 3.90 */ @@ -635,7 +635,6 @@ gsk_renderer_render (GskRenderer *renderer, g_return_if_fail (context == priv->drawing_context); priv->root_node = gsk_render_node_ref (root); - gsk_render_node_make_immutable (priv->root_node); #ifdef G_ENABLE_DEBUG gsk_profiler_reset (priv->profiler); diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c index 20d9bef092..1cd01f4b63 100644 --- a/gsk/gskrendernode.c +++ b/gsk/gskrendernode.c @@ -35,8 +35,8 @@ * * 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. + * All #GskRenderNodes are immutable, you can only specify their properties + * during construction. */ #include "config.h" @@ -68,8 +68,6 @@ G_DEFINE_BOXED_TYPE (GskRenderNode, gsk_render_node, static void gsk_render_node_finalize (GskRenderNode *self) { - self->is_mutable = TRUE; - self->node_class->finalize (self); g_clear_pointer (&self->name, g_free); @@ -100,8 +98,6 @@ gsk_render_node_new (const GskRenderNodeClass *node_class) self->min_filter = GSK_SCALING_FILTER_NEAREST; self->mag_filter = GSK_SCALING_FILTER_NEAREST; - self->is_mutable = TRUE; - return self; } @@ -237,23 +233,6 @@ gsk_render_node_get_name (GskRenderNode *node) return node->name; } -/*< private > - * gsk_render_node_make_immutable: - * @node: a #GskRenderNode - * - * Marks @node, and all its children, as immutable. - */ -void -gsk_render_node_make_immutable (GskRenderNode *node) -{ - if (!node->is_mutable) - return; - - node->node_class->make_immutable (node); - - node->is_mutable = FALSE; -} - /** * gsk_render_node_draw: * @node: a #GskRenderNode diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 20ff9487ef..53c14e95ff 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -42,11 +42,6 @@ gsk_color_node_finalize (GskRenderNode *node) } static void -gsk_color_node_make_immutable (GskRenderNode *node) -{ -} - -static void gsk_color_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -74,7 +69,6 @@ static const GskRenderNodeClass GSK_COLOR_NODE_CLASS = { sizeof (GskColorNode), "GskColorNode", gsk_color_node_finalize, - gsk_color_node_make_immutable, gsk_color_node_draw, gsk_color_node_get_bounds }; @@ -142,11 +136,6 @@ gsk_linear_gradient_node_finalize (GskRenderNode *node) } static void -gsk_linear_gradient_node_make_immutable (GskRenderNode *node) -{ -} - -static void gsk_linear_gradient_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -193,7 +182,6 @@ static const GskRenderNodeClass GSK_LINEAR_GRADIENT_NODE_CLASS = { sizeof (GskLinearGradientNode), "GskLinearGradientNode", gsk_linear_gradient_node_finalize, - gsk_linear_gradient_node_make_immutable, gsk_linear_gradient_node_draw, gsk_linear_gradient_node_get_bounds }; @@ -203,7 +191,6 @@ static const GskRenderNodeClass GSK_REPEATING_LINEAR_GRADIENT_NODE_CLASS = { sizeof (GskLinearGradientNode), "GskLinearGradientNode", gsk_linear_gradient_node_finalize, - gsk_linear_gradient_node_make_immutable, gsk_linear_gradient_node_draw, gsk_linear_gradient_node_get_bounds }; @@ -291,11 +278,6 @@ gsk_border_node_finalize (GskRenderNode *node) } static void -gsk_border_node_make_immutable (GskRenderNode *node) -{ -} - -static void gsk_border_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -392,7 +374,6 @@ static const GskRenderNodeClass GSK_BORDER_NODE_CLASS = { sizeof (GskBorderNode), "GskBorderNode", gsk_border_node_finalize, - gsk_border_node_make_immutable, gsk_border_node_draw, gsk_border_node_get_bounds }; @@ -479,11 +460,6 @@ gsk_texture_node_finalize (GskRenderNode *node) } static void -gsk_texture_node_make_immutable (GskRenderNode *node) -{ -} - -static void gsk_texture_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -521,7 +497,6 @@ static const GskRenderNodeClass GSK_TEXTURE_NODE_CLASS = { sizeof (GskTextureNode), "GskTextureNode", gsk_texture_node_finalize, - gsk_texture_node_make_immutable, gsk_texture_node_draw, gsk_texture_node_get_bounds }; @@ -586,11 +561,6 @@ gsk_inset_shadow_node_finalize (GskRenderNode *node) { } -static void -gsk_inset_shadow_node_make_immutable (GskRenderNode *node) -{ -} - static gboolean has_empty_clip (cairo_t *cr) { @@ -988,7 +958,6 @@ static const GskRenderNodeClass GSK_INSET_SHADOW_NODE_CLASS = { sizeof (GskInsetShadowNode), "GskInsetShadowNode", gsk_inset_shadow_node_finalize, - gsk_inset_shadow_node_make_immutable, gsk_inset_shadow_node_draw, gsk_inset_shadow_node_get_bounds }; @@ -1056,11 +1025,6 @@ gsk_outset_shadow_node_finalize (GskRenderNode *node) } static void -gsk_outset_shadow_node_make_immutable (GskRenderNode *node) -{ -} - -static void gsk_outset_shadow_get_extents (GskOutsetShadowNode *self, float *top, float *right, @@ -1202,7 +1166,6 @@ static const GskRenderNodeClass GSK_OUTSET_SHADOW_NODE_CLASS = { sizeof (GskOutsetShadowNode), "GskOutsetShadowNode", gsk_outset_shadow_node_finalize, - gsk_outset_shadow_node_make_immutable, gsk_outset_shadow_node_draw, gsk_outset_shadow_node_get_bounds }; @@ -1270,11 +1233,6 @@ gsk_cairo_node_finalize (GskRenderNode *node) } static void -gsk_cairo_node_make_immutable (GskRenderNode *node) -{ -} - -static void gsk_cairo_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -1301,7 +1259,6 @@ static const GskRenderNodeClass GSK_CAIRO_NODE_CLASS = { sizeof (GskCairoNode), "GskCairoNode", gsk_cairo_node_finalize, - gsk_cairo_node_make_immutable, gsk_cairo_node_draw, gsk_cairo_node_get_bounds }; @@ -1374,7 +1331,6 @@ gsk_cairo_node_get_draw_context (GskRenderNode *node, cairo_t *res; g_return_val_if_fail (GSK_IS_RENDER_NODE_TYPE (node, GSK_CAIRO_NODE), NULL); - g_return_val_if_fail (node->is_mutable, NULL); g_return_val_if_fail (renderer == NULL || GSK_IS_RENDERER (renderer), NULL); width = ceilf (self->bounds.size.width); @@ -1460,18 +1416,6 @@ gsk_container_node_finalize (GskRenderNode *node) } static void -gsk_container_node_make_immutable (GskRenderNode *node) -{ - GskContainerNode *container = (GskContainerNode *) node; - guint i; - - for (i = 1; i < container->n_children; i++) - { - gsk_render_node_make_immutable (container->children[i]); - } -} - -static void gsk_container_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -1513,7 +1457,6 @@ static const GskRenderNodeClass GSK_CONTAINER_NODE_CLASS = { sizeof (GskContainerNode), "GskContainerNode", gsk_container_node_finalize, - gsk_container_node_make_immutable, gsk_container_node_draw, gsk_container_node_get_bounds }; @@ -1601,14 +1544,6 @@ gsk_transform_node_finalize (GskRenderNode *node) } static void -gsk_transform_node_make_immutable (GskRenderNode *node) -{ - GskTransformNode *self = (GskTransformNode *) node; - - gsk_render_node_make_immutable (self->child); -} - -static void gsk_transform_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -1656,7 +1591,6 @@ static const GskRenderNodeClass GSK_TRANSFORM_NODE_CLASS = { sizeof (GskTransformNode), "GskTransformNode", gsk_transform_node_finalize, - gsk_transform_node_make_immutable, gsk_transform_node_draw, gsk_transform_node_get_bounds }; @@ -1740,14 +1674,6 @@ gsk_opacity_node_finalize (GskRenderNode *node) } static void -gsk_opacity_node_make_immutable (GskRenderNode *node) -{ - GskOpacityNode *self = (GskOpacityNode *) node; - - gsk_render_node_make_immutable (self->child); -} - -static void gsk_opacity_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -1785,7 +1711,6 @@ static const GskRenderNodeClass GSK_OPACITY_NODE_CLASS = { sizeof (GskOpacityNode), "GskOpacityNode", gsk_opacity_node_finalize, - gsk_opacity_node_make_immutable, gsk_opacity_node_draw, gsk_opacity_node_get_bounds }; @@ -1867,14 +1792,6 @@ gsk_clip_node_finalize (GskRenderNode *node) } static void -gsk_clip_node_make_immutable (GskRenderNode *node) -{ - GskClipNode *self = (GskClipNode *) node; - - gsk_render_node_make_immutable (self->child); -} - -static void gsk_clip_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -1909,7 +1826,6 @@ static const GskRenderNodeClass GSK_CLIP_NODE_CLASS = { sizeof (GskClipNode), "GskClipNode", gsk_clip_node_finalize, - gsk_clip_node_make_immutable, gsk_clip_node_draw, gsk_clip_node_get_bounds }; @@ -1992,14 +1908,6 @@ gsk_rounded_clip_node_finalize (GskRenderNode *node) } static void -gsk_rounded_clip_node_make_immutable (GskRenderNode *node) -{ - GskRoundedClipNode *self = (GskRoundedClipNode *) node; - - gsk_render_node_make_immutable (self->child); -} - -static void gsk_rounded_clip_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -2032,7 +1940,6 @@ static const GskRenderNodeClass GSK_ROUNDED_CLIP_NODE_CLASS = { sizeof (GskRoundedClipNode), "GskRoundedClipNode", gsk_rounded_clip_node_finalize, - gsk_rounded_clip_node_make_immutable, gsk_rounded_clip_node_draw, gsk_rounded_clip_node_get_bounds }; @@ -2119,14 +2026,6 @@ gsk_shadow_node_finalize (GskRenderNode *node) } static void -gsk_shadow_node_make_immutable (GskRenderNode *node) -{ - GskShadowNode *self = (GskShadowNode *) node; - - gsk_render_node_make_immutable (self->child); -} - -static void gsk_shadow_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -2193,7 +2092,6 @@ static const GskRenderNodeClass GSK_SHADOW_NODE_CLASS = { sizeof (GskShadowNode), "GskShadowNode", gsk_shadow_node_finalize, - gsk_shadow_node_make_immutable, gsk_shadow_node_draw, gsk_shadow_node_get_bounds }; @@ -2328,15 +2226,6 @@ gsk_blend_node_finalize (GskRenderNode *node) } static void -gsk_blend_node_make_immutable (GskRenderNode *node) -{ - GskBlendNode *self = (GskBlendNode *) node; - - gsk_render_node_make_immutable (self->bottom); - gsk_render_node_make_immutable (self->top); -} - -static void gsk_blend_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -2374,7 +2263,6 @@ static const GskRenderNodeClass GSK_BLEND_NODE_CLASS = { sizeof (GskBlendNode), "GskBlendNode", gsk_blend_node_finalize, - gsk_blend_node_make_immutable, gsk_blend_node_draw, gsk_blend_node_get_bounds }; @@ -2464,15 +2352,6 @@ gsk_cross_fade_node_finalize (GskRenderNode *node) } static void -gsk_cross_fade_node_make_immutable (GskRenderNode *node) -{ - GskCrossFadeNode *self = (GskCrossFadeNode *) node; - - gsk_render_node_make_immutable (self->start); - gsk_render_node_make_immutable (self->end); -} - -static void gsk_cross_fade_node_draw (GskRenderNode *node, cairo_t *cr) { @@ -2510,7 +2389,6 @@ static const GskRenderNodeClass GSK_CROSS_FADE_NODE_CLASS = { sizeof (GskCrossFadeNode), "GskCrossFadeNode", gsk_cross_fade_node_finalize, - gsk_cross_fade_node_make_immutable, gsk_cross_fade_node_draw, gsk_cross_fade_node_get_bounds }; diff --git a/gsk/gskrendernodeprivate.h b/gsk/gskrendernodeprivate.h index d56c85ce3b..0566f8a528 100644 --- a/gsk/gskrendernodeprivate.h +++ b/gsk/gskrendernodeprivate.h @@ -22,9 +22,6 @@ struct _GskRenderNode /* Scaling filters */ GskScalingFilter min_filter; GskScalingFilter mag_filter; - - /* Bit fields; leave at the end */ - gboolean is_mutable : 1; }; struct _GskRenderNodeClass @@ -33,7 +30,6 @@ struct _GskRenderNodeClass gsize struct_size; const char *type_name; void (* finalize) (GskRenderNode *node); - void (* make_immutable) (GskRenderNode *node); void (* draw) (GskRenderNode *node, cairo_t *cr); void (* get_bounds) (GskRenderNode *node, @@ -42,8 +38,6 @@ struct _GskRenderNodeClass GskRenderNode *gsk_render_node_new (const GskRenderNodeClass *node_class); -void gsk_render_node_make_immutable (GskRenderNode *node); - void gsk_render_node_get_bounds (GskRenderNode *node, graphene_rect_t *frame); double gsk_opacity_node_get_opacity (GskRenderNode *node); |