gpu: Consider scissor when intersecting with recangle

The clip might be different from the scissor due to incompatible
intersections.

But the resulting intersection might be fully clipped, so we should
consider it.

Testsuite with longer explanation attached.

Fixes #7044
This commit is contained in:
Benjamin Otte
2024-09-29 05:58:55 +02:00
parent 187763d286
commit e18c553457
4 changed files with 56 additions and 0 deletions

View File

@@ -1039,6 +1039,19 @@ gsk_gpu_node_processor_add_node_clipped (GskGpuNodeProcessor *self,
}
else
{
graphene_rect_t scissored_clip;
if (gsk_gpu_node_processor_rect_device_to_clip (self,
&GSK_RECT_INIT_CAIRO (&self->scissor),
&scissored_clip))
{
if (!gsk_rect_intersection (&scissored_clip, &clip, &clip))
{
gsk_gpu_clip_init_copy (&self->clip, &old_clip);
return;
}
}
if (!gsk_gpu_clip_intersect_rect (&self->clip, &old_clip, &clip))
{
GskGpuImage *image;