diff options
author | Søren Sandmann <sandmann@redhat.com> | 2009-02-17 23:40:02 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2009-03-28 18:01:19 -0400 |
commit | cfa7a384b730289233bef556fe1919f781eac684 (patch) | |
tree | 1602bd80c5e6695c76b0855b01a31a010f176037 | |
parent | 15564d1949778124e553d792f85cae2b031aad45 (diff) |
[region] Add _cairo_region_contains_point()
-rw-r--r-- | src/cairo-region-private.h | 5 | ||||
-rw-r--r-- | src/cairo-region.c | 15 | ||||
-rw-r--r-- | src/cairo.h | 1 |
3 files changed, 18 insertions, 3 deletions
diff --git a/src/cairo-region-private.h b/src/cairo-region-private.h index 533b3d69..78ba5fc5 100644 --- a/src/cairo-region-private.h +++ b/src/cairo-region-private.h @@ -113,12 +113,15 @@ _cairo_region_empty (cairo_region_t *region); cairo_private void _cairo_region_translate (cairo_region_t *region, - int x, int y); + int dx, int dy); cairo_private cairo_region_overlap_t _cairo_region_contains_rectangle (cairo_region_t *region, const cairo_rectangle_int_t *rect); +cairo_private cairo_bool_t +_cairo_region_contains_point (cairo_region_t *region, + int x, int y); CAIRO_END_DECLS diff --git a/src/cairo-region.c b/src/cairo-region.c index e702d2c0..04bfbd97 100644 --- a/src/cairo-region.c +++ b/src/cairo-region.c @@ -287,12 +287,12 @@ _cairo_region_empty (cairo_region_t *region) void _cairo_region_translate (cairo_region_t *region, - int x, int y) + int dx, int dy) { if (region->status) return; - pixman_region32_translate (®ion->rgn, x, y); + pixman_region32_translate (®ion->rgn, dx, dy); } cairo_region_overlap_t @@ -326,3 +326,14 @@ _cairo_region_contains_rectangle (cairo_region_t *region, return CAIRO_REGION_OVERLAP_OUT; } + +cairo_private cairo_bool_t +_cairo_region_contains_point (cairo_region_t *region, + int x, + int y) +{ + if (region->status) + return FALSE; + + return pixman_region32_contains_point (®ion->rgn, x, y, NULL); +} diff --git a/src/cairo.h b/src/cairo.h index 206861da..f359d796 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -2353,6 +2353,7 @@ cairo_matrix_transform_point (const cairo_matrix_t *matrix, cairo_public void cairo_debug_reset_static_data (void); + CAIRO_END_DECLS #endif /* CAIRO_H */ |