2023-03-31 19:11:10 +00:00
|
|
|
#pragma once
|
2016-12-23 20:36:17 +00:00
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include <graphene.h>
|
|
|
|
#include <gsk/gskroundedrect.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* The whole area is clipped, no drawing is necessary.
|
|
|
|
* This can't be handled by return values because for return
|
|
|
|
* values we return if clips could even be computed.
|
|
|
|
*/
|
|
|
|
GSK_VULKAN_CLIP_ALL_CLIPPED,
|
2017-09-05 02:58:05 +00:00
|
|
|
/* No clipping is necessary, but the clip rect is set
|
2016-12-23 20:36:17 +00:00
|
|
|
* to the actual bounds of the underlying framebuffer
|
|
|
|
*/
|
|
|
|
GSK_VULKAN_CLIP_NONE,
|
|
|
|
/* The clip is a rectangular area */
|
|
|
|
GSK_VULKAN_CLIP_RECT,
|
|
|
|
/* The clip is a rounded rectangle */
|
|
|
|
GSK_VULKAN_CLIP_ROUNDED
|
|
|
|
} GskVulkanClipComplexity;
|
|
|
|
|
|
|
|
typedef struct _GskVulkanClip GskVulkanClip;
|
|
|
|
|
|
|
|
struct _GskVulkanClip
|
|
|
|
{
|
|
|
|
GskVulkanClipComplexity type;
|
|
|
|
GskRoundedRect rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
void gsk_vulkan_clip_init_empty (GskVulkanClip *clip,
|
2023-05-14 02:15:06 +00:00
|
|
|
const graphene_rect_t *rect);
|
2023-05-19 03:35:18 +00:00
|
|
|
void gsk_vulkan_clip_init_copy (GskVulkanClip *self,
|
|
|
|
const GskVulkanClip *src);
|
2023-05-14 02:15:06 +00:00
|
|
|
void gsk_vulkan_clip_init_rect (GskVulkanClip *clip,
|
2016-12-23 20:36:17 +00:00
|
|
|
const graphene_rect_t *rect);
|
|
|
|
|
|
|
|
gboolean gsk_vulkan_clip_intersect_rect (GskVulkanClip *dest,
|
|
|
|
const GskVulkanClip *src,
|
|
|
|
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
|
|
|
|
gboolean gsk_vulkan_clip_intersect_rounded_rect (GskVulkanClip *dest,
|
|
|
|
const GskVulkanClip *src,
|
|
|
|
const GskRoundedRect *rounded) G_GNUC_WARN_UNUSED_RESULT;
|
2023-05-12 03:15:28 +00:00
|
|
|
void gsk_vulkan_clip_scale (GskVulkanClip *dest,
|
|
|
|
const GskVulkanClip *src,
|
|
|
|
float scale_x,
|
|
|
|
float scale_y);
|
2016-12-24 03:58:51 +00:00
|
|
|
gboolean gsk_vulkan_clip_transform (GskVulkanClip *dest,
|
|
|
|
const GskVulkanClip *src,
|
2021-03-06 00:35:04 +00:00
|
|
|
GskTransform *transform,
|
2016-12-24 03:58:51 +00:00
|
|
|
const graphene_rect_t *viewport) G_GNUC_WARN_UNUSED_RESULT;
|
2016-12-23 20:36:17 +00:00
|
|
|
|
|
|
|
gboolean gsk_vulkan_clip_contains_rect (const GskVulkanClip *self,
|
2023-05-17 23:18:30 +00:00
|
|
|
const graphene_point_t *offset,
|
2016-12-23 20:36:17 +00:00
|
|
|
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
|
2023-05-18 01:03:10 +00:00
|
|
|
gboolean gsk_vulkan_clip_intersects_rect (const GskVulkanClip *self,
|
|
|
|
const graphene_point_t *offset,
|
|
|
|
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
|
2016-12-23 20:36:17 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|