summaryrefslogtreecommitdiff
path: root/gsk/gskvulkanclip.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-12-24 04:58:51 +0100
committerBenjamin Otte <otte@redhat.com>2016-12-24 06:19:16 +0100
commit81c487b8415fed4990b069b03245b2aa11f12ab7 (patch)
tree2ab48d9138ac457a6e1cc6e04c4cf55d568d9c6d /gsk/gskvulkanclip.c
parent18b65a23789008a68c53e0430aa2dffadcc259f4 (diff)
downloadgtk+-81c487b8415fed4990b069b03245b2aa11f12ab7.tar.gz
vulkan: Fold clip into push constants
As a side effect, the clipping data is now available inside shaders. Not that any shader would use them yet, but they could!
Diffstat (limited to 'gsk/gskvulkanclip.c')
-rw-r--r--gsk/gskvulkanclip.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gsk/gskvulkanclip.c b/gsk/gskvulkanclip.c
index 38755f5c24..9a3ad8696f 100644
--- a/gsk/gskvulkanclip.c
+++ b/gsk/gskvulkanclip.c
@@ -128,6 +128,34 @@ gsk_vulkan_clip_intersect_rounded_rect (GskVulkanClip *dest,
}
gboolean
+gsk_vulkan_clip_transform (GskVulkanClip *dest,
+ const GskVulkanClip *src,
+ const graphene_matrix_t *transform,
+ const graphene_rect_t *viewport)
+{
+ switch (dest->type)
+ {
+ default:
+ g_assert_not_reached();
+ return FALSE;
+
+ case GSK_VULKAN_CLIP_ALL_CLIPPED:
+ gsk_vulkan_clip_init_copy (dest, src);
+ return TRUE;
+
+ case GSK_VULKAN_CLIP_NONE:
+ gsk_vulkan_clip_init_empty (dest, viewport);
+ return TRUE;
+
+ case GSK_VULKAN_CLIP_RECT:
+ case GSK_VULKAN_CLIP_ROUNDED_CIRCULAR:
+ case GSK_VULKAN_CLIP_ROUNDED:
+ /* FIXME: Handle 2D operations, in particular transform and scale */
+ return FALSE;
+ }
+}
+
+gboolean
gsk_vulkan_clip_contains_rect (const GskVulkanClip *self,
const graphene_rect_t *rect)
{