[gtk/wip/otte/for-master: 2/4] vulkan: Improve rounded rect clipping
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 2/4] vulkan: Improve rounded rect clipping
- Date: Tue, 9 Mar 2021 18:54:50 +0000 (UTC)
commit fea67dea6acad0504adeb6d36af9e8fbd975dc1e
Author: Benjamin Otte <otte redhat com>
Date: Sat Mar 6 20:44:38 2021 +0100
vulkan: Improve rounded rect clipping
Handle the case where the inner rounded rect is fully contained
within the outer rounded rect.
gsk/vulkan/gskvulkanclip.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gsk/vulkan/gskvulkanclip.c b/gsk/vulkan/gskvulkanclip.c
index d7e0582124..fa8d561c00 100644
--- a/gsk/vulkan/gskvulkanclip.c
+++ b/gsk/vulkan/gskvulkanclip.c
@@ -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:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]