summaryrefslogtreecommitdiffstats
path: root/common/region.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-02-17 21:33:23 +0100
committerAlexander Larsson <alexl@redhat.com>2010-02-23 22:52:06 +0100
commit98dde80ed3c01f6ac08bcd14d34d6643da9f8418 (patch)
treea872eb82b7012195c4dd08dc7d2115f0cfac7e71 /common/region.h
parent8f912e49179803fa640b3bddf75b62e81b2f7178 (diff)
downloadspice-98dde80ed3c01f6ac08bcd14d34d6643da9f8418.tar.gz
spice-98dde80ed3c01f6ac08bcd14d34d6643da9f8418.tar.xz
spice-98dde80ed3c01f6ac08bcd14d34d6643da9f8418.zip
Replace custom region implementation with pixman_region32_t
pixman_region32_t is an efficient well tested region implementation (its the one used in X) that we already depend on via pixman and use in some places. No need to have a custom region implementation.
Diffstat (limited to 'common/region.h')
-rw-r--r--common/region.h20
1 files changed, 3 insertions, 17 deletions
diff --git a/common/region.h b/common/region.h
index f981ef3d..c0bf4087 100644
--- a/common/region.h
+++ b/common/region.h
@@ -21,20 +21,9 @@
#include <stdint.h>
#include <spice/draw.h>
+#include <pixman_utils.h>
-#define REGION_USE_IMPROVED
-
-#define RECTS_BUF_SIZE 4
-
-typedef struct QRegion {
- uint32_t num_rects;
- SpiceRect bbox;
- SpiceRect *rects;
- uint32_t rects_size;
- SpiceRect buf[RECTS_BUF_SIZE];
-} QRegion;
-
-#ifdef REGION_USE_IMPROVED
+typedef pixman_region32_t QRegion;
#define REGION_TEST_LEFT_EXCLUSIVE (1 << 0)
#define REGION_TEST_RIGHT_EXCLUSIVE (1 << 1)
@@ -42,16 +31,13 @@ typedef struct QRegion {
#define REGION_TEST_ALL \
(REGION_TEST_LEFT_EXCLUSIVE | REGION_TEST_RIGHT_EXCLUSIVE | REGION_TEST_SHARED)
-#endif
-
void region_init(QRegion *rgn);
void region_clear(QRegion *rgn);
void region_destroy(QRegion *rgn);
void region_clone(QRegion *dest, const QRegion *src);
+SpiceRect *region_dup_rects(const QRegion *rgn, uint32_t *num_rects);
-#ifdef REGION_USE_IMPROVED
int region_test(const QRegion *rgn, const QRegion *other_rgn, int query);
-#endif
int region_is_valid(const QRegion *rgn);
int region_is_empty(const QRegion *rgn);
int region_is_equal(const QRegion *rgn1, const QRegion *rgn2);