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.
This commit is contained in:
Benjamin Otte 2024-08-09 19:24:51 +02:00
parent d6322c6389
commit 904b1815b5

View File

@ -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);