vulkan: Improve rounded rect clipping

Handle the case where the inner rounded rect is fully contained
within the outer rounded rect.
This commit is contained in:
Benjamin Otte
2021-03-06 20:44:38 +01:00
parent 9f18c138d1
commit fea67dea6a

View File

@@ -126,7 +126,13 @@ gsk_vulkan_clip_intersect_rounded_rect (GskVulkanClip *dest,
case GSK_VULKAN_CLIP_ROUNDED_CIRCULAR:
case GSK_VULKAN_CLIP_ROUNDED:
/* XXX: improve */
if (gsk_rounded_rect_contains_rect (&src->rect, &rounded->bounds))
{
dest->type = gsk_rounded_rect_is_circular (rounded) ? GSK_VULKAN_CLIP_ROUNDED_CIRCULAR : GSK_VULKAN_CLIP_ROUNDED;
gsk_rounded_rect_init_copy (&dest->rect, rounded);
return TRUE;
}
/* XXX: Can be improved for the case where one of the rects is a slighty shrunk version of the other */
return FALSE;
default: