From 904b1815b5ccfda3b57405b3c7e88270a74c4c01 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 9 Aug 2024 19:24:51 +0200 Subject: [PATCH] nodeprocessor: Consult scissor after rounded clip If we apply a rounded clip, we might change the clip in a way that makes it intersectable with the scissor again, if both had diverged before. So try and intersect with the clip. --- gsk/gpu/gskgpunodeprocessor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 77d251870c..aea8d9914a 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -1254,6 +1254,7 @@ gsk_gpu_node_processor_add_rounded_clip_node (GskGpuNodeProcessor *self, GskRoundedRect clip; const GskRoundedRect *original_clip; GskRenderNode *child; + graphene_rect_t scissor; child = gsk_rounded_clip_node_get_child (node); original_clip = gsk_rounded_clip_node_get_clip (node); @@ -1287,6 +1288,15 @@ gsk_gpu_node_processor_add_rounded_clip_node (GskGpuNodeProcessor *self, return; } + if (gsk_gpu_node_processor_rect_device_to_clip (self, + &GSK_RECT_INIT_CAIRO (&self->scissor), + &scissor)) + { + GskGpuClip scissored_clip; + if (gsk_gpu_clip_intersect_rect (&scissored_clip, &self->clip, &scissor)) + gsk_gpu_clip_init_copy (&self->clip, &scissored_clip); + } + if (self->clip.type == GSK_GPU_CLIP_ALL_CLIPPED) { gsk_gpu_clip_init_copy (&self->clip, &old_clip);