[gtk/wip/otte/no-clip-on-draw: 7/9] gsk: Clip shadow node before push_group()



commit 6203cecf97eb33b7349abc80dc0af50fc4f602dc
Author: Benjamin Otte <otte redhat com>
Date:   Thu Feb 13 01:53:12 2020 +0100

    gsk: Clip shadow node before push_group()
    
    We want to be sure to push a group that's as small as possible, so we
    clip to the child's bounds, because that's the smallest we can go.

 gsk/gskrendernodeimpl.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index d8bec7047e..aad1fa59ef 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -2899,9 +2899,14 @@ gsk_shadow_node_draw (GskRenderNode *node,
   cairo_pattern_t *pattern;
   gsize i;
 
+  cairo_save (cr);
+  /* clip so the push_group() creates a small surface */
+  gsk_cairo_rectangle (cr, &self->child->bounds);
+  cairo_clip (cr);
   cairo_push_group (cr);
   gsk_render_node_draw (self->child, cr);
   pattern = cairo_pop_group (cr);
+  cairo_restore (cr);
 
   for (i = 0; i < self->n_shadows; i++)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]