diff options
author | Timm Bäder <mail@baedert.org> | 2018-07-08 12:50:21 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-07-08 21:50:59 +0200 |
commit | a0b8e324621d1f60576e158b143470f99ac40553 (patch) | |
tree | 95b9e6dac0270a9caf671593fbe008999e648de1 | |
parent | 50f76eb8cca9e4707a03d0f4948c52ff03ad9890 (diff) | |
download | gtk+-a0b8e324621d1f60576e158b143470f99ac40553.tar.gz |
rendernodes: Fix unconditionally impossible diffs
Some of the _diff implementations did a whole bunch of work just to
throw it away afterwards and invalidate the entire union of the two
render nodes, most notably the two clip nodes. Fix this to only call
gsk_render_node_diff_impossible if the previous if-condition is FALSE
and not always.
-rw-r--r-- | gsk/gskrendernodeimpl.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c index 2777c4ca74..8b704aedda 100644 --- a/gsk/gskrendernodeimpl.c +++ b/gsk/gskrendernodeimpl.c @@ -3565,7 +3565,7 @@ gsk_clip_node_diff (GskRenderNode *node1, { cairo_region_t *sub; cairo_rectangle_int_t clip_rect; - + sub = cairo_region_create(); gsk_render_node_diff (self1->child, self2->child, sub); rectangle_init_from_graphene (&clip_rect, &self1->clip); @@ -3573,8 +3573,10 @@ gsk_clip_node_diff (GskRenderNode *node1, cairo_region_union (region, sub); cairo_region_destroy (sub); } - - gsk_render_node_diff_impossible (node1, node2, region); + else + { + gsk_render_node_diff_impossible (node1, node2, region); + } } #define GSK_CLIP_NODE_VARIANT_TYPE "(dddduv)" @@ -3737,7 +3739,7 @@ gsk_rounded_clip_node_diff (GskRenderNode *node1, { cairo_region_t *sub; cairo_rectangle_int_t clip_rect; - + sub = cairo_region_create(); gsk_render_node_diff (self1->child, self2->child, sub); rectangle_init_from_graphene (&clip_rect, &self1->clip.bounds); @@ -3745,8 +3747,10 @@ gsk_rounded_clip_node_diff (GskRenderNode *node1, cairo_region_union (region, sub); cairo_region_destroy (sub); } - - gsk_render_node_diff_impossible (node1, node2, region); + else + { + gsk_render_node_diff_impossible (node1, node2, region); + } } #define GSK_ROUNDED_CLIP_NODE_VARIANT_TYPE "(dddddddddddduv)" @@ -4262,8 +4266,10 @@ gsk_blend_node_diff (GskRenderNode *node1, gsk_render_node_diff (self1->top, self2->top, region); gsk_render_node_diff (self1->bottom, self2->bottom, region); } - - gsk_render_node_diff_impossible (node1, node2, region); + else + { + gsk_render_node_diff_impossible (node1, node2, region); + } } #define GSK_BLEND_NODE_VARIANT_TYPE "(uvuvu)" |