diff options
author | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-02-17 23:03:25 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@redhat.com> | 2009-10-03 11:48:51 -0400 |
commit | 55270c03c32cc84d952760cb7a600cc015a45742 (patch) | |
tree | 6cd3f24e9a9e851c9dad6abbdf0f3e4674008472 | |
parent | 93acc10617c88fbf933120c6980ae8ef80cf94f0 (diff) |
Add pixman_region{,32}_intersect_rect()intersect-rect
-rw-r--r-- | pixman/pixman-region.c | 18 | ||||
-rw-r--r-- | pixman/pixman.h | 13 |
2 files changed, 30 insertions, 1 deletions
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c index f88955f3..a90b5333 100644 --- a/pixman/pixman-region.c +++ b/pixman/pixman-region.c @@ -1334,6 +1334,24 @@ pixman_region_union_o (region_type_t *region, return TRUE; } +PIXMAN_EXPORT pixman_bool_t +PREFIX(_intersect_rect) (region_type_t *dest, + region_type_t *source, + int x, int y, + unsigned int width, + unsigned int height) +{ + region_type_t region; + + region.data = NULL; + region.extents.x1 = x; + region.extents.y1 = y; + region.extents.x2 = x + width; + region.extents.y2 = y + height; + + return PREFIX(_intersect) (dest, source, ®ion); +} + /* Convenience function for performing union of region with a * single rectangle */ diff --git a/pixman/pixman.h b/pixman/pixman.h index 35a5eb70..c1f4008a 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -399,7 +399,6 @@ void pixman_region_init_with_extents (pixman_region16_t *reg void pixman_region_fini (pixman_region16_t *region); - /* manipulation */ void pixman_region_translate (pixman_region16_t *region, int x, @@ -418,6 +417,12 @@ pixman_bool_t pixman_region_union_rect (pixman_region16_t *des int y, unsigned int width, unsigned int height); +pixman_bool_t pixman_region_intersect_rect (pixman_region16_t *dest, + pixman_region16_t *source, + int x, + int y, + unsigned int width, + unsigned int height); pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d, pixman_region16_t *reg_m, pixman_region16_t *reg_s); @@ -498,6 +503,12 @@ pixman_bool_t pixman_region32_intersect (pixman_region32_t *n pixman_bool_t pixman_region32_union (pixman_region32_t *new_reg, pixman_region32_t *reg1, pixman_region32_t *reg2); +pixman_bool_t pixman_region32_intersect_rect (pixman_region32_t *dest, + pixman_region32_t *source, + int x, + int y, + unsigned int width, + unsigned int height); pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest, pixman_region32_t *source, int x, |