From 9879f6cfc40b4ef3bdca4ee9aaedacff8fb87244 Mon Sep 17 00:00:00 2001 From: Loukas Agorgianitis Date: Thu, 24 Apr 2025 20:49:39 +0300 Subject: [PATCH] region: add image clip and composite functions for fractional regions Signed-off-by: Loukas Agorgianitis --- pixman/pixman-image.c | 24 ++++++++++++++++++++++++ pixman/pixman.c | 18 ++++++++++++++++++ pixman/pixman.h | 18 ++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 72796fc..d089cb1 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -613,6 +613,30 @@ pixman_image_set_clip_region (pixman_image_t * image, return result; } +PIXMAN_EXPORT pixman_bool_t +pixman_image_set_clip_region64f (pixman_image_t * image, + const pixman_region64f_t *region) +{ + image_common_t *common = (image_common_t *)image; + pixman_bool_t result; + + if (region) + { + if ((result = pixman_region32_copy_from_region64f (&common->clip_region, region))) + image->common.have_clip_region = TRUE; + } + else + { + _pixman_image_reset_clip_region (image); + + result = TRUE; + } + + image_property_changed (image); + + return result; +} + PIXMAN_EXPORT void pixman_image_set_has_client_clip (pixman_image_t *image, pixman_bool_t client_clip) diff --git a/pixman/pixman.c b/pixman/pixman.c index 2b408c6..1d77f8e 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -739,6 +739,24 @@ pixman_image_composite (pixman_op_t op, mask_x, mask_y, dest_x, dest_y, width, height); } +PIXMAN_EXPORT void +pixman_image_composite64f (pixman_op_t op, + pixman_image_t * src, + pixman_image_t * mask, + pixman_image_t * dest, + double src_x, + double src_y, + double mask_x, + double mask_y, + double dest_x, + double dest_y, + double width, + double height) +{ + pixman_image_composite32 (op, src, mask, dest, src_x, src_y, + mask_x, mask_y, dest_x, dest_y, width, height); +} + PIXMAN_EXPORT pixman_bool_t pixman_blt (uint32_t *src_bits, uint32_t *dst_bits, diff --git a/pixman/pixman.h b/pixman/pixman.h index ff90e13..7a3dff8 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -1192,6 +1192,10 @@ PIXMAN_API pixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image, const pixman_region32_t *region); +PIXMAN_API +pixman_bool_t pixman_image_set_clip_region64f (pixman_image_t *image, + const pixman_region64f_t *region); + PIXMAN_API void pixman_image_set_has_client_clip (pixman_image_t *image, pixman_bool_t clien_clip); @@ -1348,6 +1352,20 @@ void pixman_image_composite32 (pixman_op_t op, int32_t width, int32_t height); +PIXMAN_API +void pixman_image_composite64f (pixman_op_t op, + pixman_image_t *src, + pixman_image_t *mask, + pixman_image_t *dest, + double src_x, + double src_y, + double mask_x, + double mask_y, + double dest_x, + double dest_y, + double width, + double height); + /* Executive Summary: This function is a no-op that only exists * for historical reasons. *