pixman: Branch 'region32' - 11 commits
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Sun Jun 8 16:34:21 PDT 2008
pixman/Makefile.am | 3
pixman/pixman-region.c | 638 ++++++++++++-----------------------------------
pixman/pixman-region16.c | 41 +++
pixman/pixman-region32.c | 41 +++
pixman/pixman.h | 115 ++++++++
5 files changed, 358 insertions(+), 480 deletions(-)
New commits:
commit 81369a4c4f09bc6cceef173947df4c9a78952c7a
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:32:15 2008 -0400
Fix up types in pixman32-region.c
diff --git a/pixman/pixman-region32.c b/pixman/pixman-region32.c
index 2e63b00..5a62b3e 100644
--- a/pixman/pixman-region32.c
+++ b/pixman/pixman-region32.c
@@ -28,9 +28,9 @@
#include "pixman-private.h"
-typedef pixman_box16_t box_type_t;
-typedef pixman_region16_data_t region_data_type_t;
-typedef pixman_region16_t region_type_t;
+typedef pixman_box32_t box_type_t;
+typedef pixman_region32_data_t region_data_type_t;
+typedef pixman_region32_t region_type_t;
typedef struct {
int x, y;
commit 4cf2b696266214482dad6e40184b74e1161e8ea7
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:31:31 2008 -0400
Add prototypes for 32 bit region methods
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 1224d2b..c493457 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -274,12 +274,6 @@ typedef enum
PIXMAN_REGION_PART
} pixman_region_overlap_t;
-PIXMAN_EXPORT
-int pixman_version (void);
-
-PIXMAN_EXPORT
-const char* pixman_version_string (void);
-
/* This function exists only to make it possible to preserve the X ABI - it should
* go away at first opportunity.
*/
@@ -360,6 +354,115 @@ PIXMAN_EXPORT
pixman_bool_t pixman_region_init_rects (pixman_region16_t *region,
pixman_box16_t *boxes, int count);
+/*
+ * 32 bit regions
+ */
+typedef struct pixman_region32_data pixman_region32_data_t;
+typedef struct pixman_box32 pixman_box32_t;
+typedef struct pixman_rectangle32 pixman_rectangle32_t;
+typedef struct pixman_region32 pixman_region32_t;
+
+struct pixman_region32_data {
+ long size;
+ long numRects;
+/* pixman_box32_t rects[size]; in memory but not explicitly declared */
+};
+
+struct pixman_rectangle32
+{
+ int32_t x, y;
+ uint32_t width, height;
+};
+
+struct pixman_box32
+{
+ int32_t x1, y1, x2, y2;
+};
+
+struct pixman_region32
+{
+ pixman_box32_t extents;
+ pixman_region32_data_t *data;
+};
+
+/* creation/destruction */
+PIXMAN_EXPORT
+void pixman_region32_init (pixman_region32_t *region);
+PIXMAN_EXPORT
+void pixman_region32_init_rect (pixman_region32_t *region,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height);
+PIXMAN_EXPORT
+void pixman_region32_init_with_extents (pixman_region32_t *region,
+ pixman_box32_t *extents);
+PIXMAN_EXPORT
+void pixman_region32_fini (pixman_region32_t *region);
+
+
+/* manipulation */
+PIXMAN_EXPORT
+void pixman_region32_translate (pixman_region32_t *region,
+ int x,
+ int y);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_copy (pixman_region32_t *dest,
+ pixman_region32_t *source);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_intersect (pixman_region32_t *newReg,
+ pixman_region32_t *reg1,
+ pixman_region32_t *reg2);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_union (pixman_region32_t *newReg,
+ pixman_region32_t *reg1,
+ pixman_region32_t *reg2);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest,
+ pixman_region32_t *source,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_subtract (pixman_region32_t *regD,
+ pixman_region32_t *regM,
+ pixman_region32_t *regS);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_inverse (pixman_region32_t *newReg,
+ pixman_region32_t *reg1,
+ pixman_box32_t *invRect);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_contains_point (pixman_region32_t *region,
+ int x,
+ int y,
+ pixman_box32_t *box);
+PIXMAN_EXPORT
+pixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region,
+ pixman_box32_t *prect);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_not_empty (pixman_region32_t *region);
+PIXMAN_EXPORT
+pixman_box32_t * pixman_region32_extents (pixman_region32_t *region);
+PIXMAN_EXPORT
+int pixman_region32_n_rects (pixman_region32_t *region);
+PIXMAN_EXPORT
+pixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region,
+ int *n_rects);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_equal (pixman_region32_t *region1,
+ pixman_region32_t *region2);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region);
+PIXMAN_EXPORT
+void pixman_region32_reset (pixman_region32_t *region,
+ pixman_box32_t *box);
+PIXMAN_EXPORT
+pixman_bool_t pixman_region32_init_rects (pixman_region32_t *region,
+ pixman_box32_t *boxes,
+ int count);
+
+
/* Copy / Fill */
PIXMAN_EXPORT
pixman_bool_t pixman_blt (uint32_t *src_bits,
commit 7d0c507b084e78217145ab82c35d579e5c8c26db
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:31:04 2008 -0400
Add pixman-region32.c
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index 425ba8c..800106f 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -6,6 +6,7 @@ libpixman_1_la_SOURCES = \
pixman-access.c \
pixman-access-accessors.c \
pixman-region16.c \
+ pixman-region32.c \
pixman-private.h \
pixman-image.c \
pixman-combine32.c \
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index a98c6fe..41a9d4c 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -72,20 +72,20 @@ SOFTWARE.
#define assert(expr)
#endif
-#define good(reg) assert(PREFIX(pixman_region_selfcheck) (reg))
+#define good(reg) assert(PREFIX(_selfcheck) (reg))
#undef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
-static const box_type_t PREFIX(pixman_region_emptyBox_) = {0, 0, 0, 0};
-static const region_data_type_t PREFIX(pixman_region_emptyData_) = {0, 0};
-static const region_data_type_t PREFIX(pixman_region_brokendata_) = {0, 0};
+static const box_type_t PREFIX(_emptyBox_) = {0, 0, 0, 0};
+static const region_data_type_t PREFIX(_emptyData_) = {0, 0};
+static const region_data_type_t PREFIX(_brokendata_) = {0, 0};
-static box_type_t *pixman_region_emptyBox = (box_type_t *)&PREFIX(pixman_region_emptyBox_);
-static region_data_type_t *pixman_region_emptyData = (region_data_type_t *)&PREFIX(pixman_region_emptyData_);
-static region_data_type_t *pixman_brokendata = (region_data_type_t *)&PREFIX(pixman_region_brokendata_);
+static box_type_t *pixman_region_emptyBox = (box_type_t *)&PREFIX(_emptyBox_);
+static region_data_type_t *pixman_region_emptyData = (region_data_type_t *)&PREFIX(_emptyData_);
+static region_data_type_t *pixman_brokendata = (region_data_type_t *)&PREFIX(_brokendata_);
/* This function exists only to make it possible to preserve the X ABI - it should
* go away at first opportunity.
@@ -96,7 +96,7 @@ static region_data_type_t *pixman_brokendata = (region_data_type_t *)&PREFIX(pix
* work.
*/
void
-PREFIX(pixman_region_set_static_pointers) (box_type_t *empty_box,
+PREFIX(_set_static_pointers) (box_type_t *empty_box,
region_data_type_t *empty_data,
region_data_type_t *broken_data)
{
@@ -249,7 +249,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
}
pixman_bool_t
-PREFIX(pixman_region_equal) (reg1, reg2)
+PREFIX(_equal) (reg1, reg2)
region_type_t * reg1;
region_type_t * reg2;
{
@@ -275,7 +275,7 @@ PREFIX(pixman_region_equal) (reg1, reg2)
}
int
-PREFIX(pixman_region_print) (rgn)
+PREFIX(_print) (rgn)
region_type_t * rgn;
{
int num, size;
@@ -297,14 +297,14 @@ PREFIX(pixman_region_print) (rgn)
void
-PREFIX(pixman_region_init) (region_type_t *region)
+PREFIX(_init) (region_type_t *region)
{
region->extents = *pixman_region_emptyBox;
region->data = pixman_region_emptyData;
}
void
-PREFIX(pixman_region_init_rect) (region_type_t *region,
+PREFIX(_init_rect) (region_type_t *region,
int x, int y, unsigned int width, unsigned int height)
{
region->extents.x1 = x;
@@ -315,33 +315,33 @@ PREFIX(pixman_region_init_rect) (region_type_t *region,
}
void
-PREFIX(pixman_region_init_with_extents) (region_type_t *region, box_type_t *extents)
+PREFIX(_init_with_extents) (region_type_t *region, box_type_t *extents)
{
region->extents = *extents;
region->data = NULL;
}
void
-PREFIX(pixman_region_fini) (region_type_t *region)
+PREFIX(_fini) (region_type_t *region)
{
good (region);
freeData (region);
}
int
-PREFIX(pixman_region_n_rects) (region_type_t *region)
+PREFIX(_n_rects) (region_type_t *region)
{
return PIXREGION_NUM_RECTS (region);
}
box_type_t *
-PREFIX(pixman_region_rects) (region_type_t *region)
+PREFIX(_rects) (region_type_t *region)
{
return PIXREGION_RECTS (region);
}
box_type_t *
-PREFIX(pixman_region_rectangles) (region_type_t *region,
+PREFIX(_rectangles) (region_type_t *region,
int *n_rects)
{
if (n_rects)
@@ -404,7 +404,7 @@ pixman_rect_alloc (region_type_t * region, int n)
}
pixman_bool_t
-PREFIX(pixman_region_copy) (region_type_t *dst, region_type_t *src)
+PREFIX(_copy) (region_type_t *dst, region_type_t *src)
{
good(dst);
good(src);
@@ -968,7 +968,7 @@ pixman_region_intersectO (region_type_t *region,
}
pixman_bool_t
-PREFIX(pixman_region_intersect) (region_type_t * newReg,
+PREFIX(_intersect) (region_type_t * newReg,
region_type_t * reg1,
region_type_t * reg2)
{
@@ -1003,15 +1003,15 @@ PREFIX(pixman_region_intersect) (region_type_t * newReg,
}
else if (!reg2->data && SUBSUMES(®2->extents, ®1->extents))
{
- return PREFIX(pixman_region_copy) (newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
}
else if (!reg1->data && SUBSUMES(®1->extents, ®2->extents))
{
- return PREFIX(pixman_region_copy) (newReg, reg2);
+ return PREFIX(_copy) (newReg, reg2);
}
else if (reg1 == reg2)
{
- return PREFIX(pixman_region_copy) (newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
}
else
{
@@ -1125,7 +1125,7 @@ pixman_region_unionO (
* single rectangle
*/
pixman_bool_t
-PREFIX(pixman_region_union_rect) (region_type_t *dest,
+PREFIX(_union_rect) (region_type_t *dest,
region_type_t *source,
int x, int y,
unsigned int width, unsigned int height)
@@ -1133,18 +1133,18 @@ PREFIX(pixman_region_union_rect) (region_type_t *dest,
region_type_t region;
if (!width || !height)
- return PREFIX(pixman_region_copy) (dest, source);
+ return PREFIX(_copy) (dest, source);
region.data = NULL;
region.extents.x1 = x;
region.extents.y1 = y;
region.extents.x2 = x + width;
region.extents.y2 = y + height;
- return PREFIX(pixman_region_union) (dest, source, ®ion);
+ return PREFIX(_union) (dest, source, ®ion);
}
pixman_bool_t
-PREFIX(pixman_region_union) (region_type_t *newReg,
+PREFIX(_union) (region_type_t *newReg,
region_type_t *reg1,
region_type_t *reg2)
{
@@ -1163,7 +1163,7 @@ PREFIX(pixman_region_union) (region_type_t *newReg,
*/
if (reg1 == reg2)
{
- return PREFIX(pixman_region_copy) (newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
}
/*
@@ -1174,7 +1174,7 @@ PREFIX(pixman_region_union) (region_type_t *newReg,
if (PIXREGION_NAR(reg1))
return pixman_break (newReg);
if (newReg != reg2)
- return PREFIX(pixman_region_copy) (newReg, reg2);
+ return PREFIX(_copy) (newReg, reg2);
return TRUE;
}
@@ -1186,7 +1186,7 @@ PREFIX(pixman_region_union) (region_type_t *newReg,
if (PIXREGION_NAR(reg2))
return pixman_break (newReg);
if (newReg != reg1)
- return PREFIX(pixman_region_copy) (newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
return TRUE;
}
@@ -1196,7 +1196,7 @@ PREFIX(pixman_region_union) (region_type_t *newReg,
if (!reg1->data && SUBSUMES(®1->extents, ®2->extents))
{
if (newReg != reg1)
- return PREFIX(pixman_region_copy) (newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
return TRUE;
}
@@ -1206,7 +1206,7 @@ PREFIX(pixman_region_union) (region_type_t *newReg,
if (!reg2->data && SUBSUMES(®2->extents, ®1->extents))
{
if (newReg != reg2)
- return PREFIX(pixman_region_copy) (newReg, reg2);
+ return PREFIX(_copy) (newReg, reg2);
return TRUE;
}
@@ -1244,7 +1244,7 @@ PREFIX(pixman_region_union) (region_type_t *newReg,
*
*/
pixman_bool_t
-PREFIX(pixman_region_append) (region_type_t * dstrgn,
+PREFIX(_append) (region_type_t * dstrgn,
region_type_t * rgn)
{
int numRects, dnumRects, size;
@@ -1429,7 +1429,7 @@ QuickSortRects(
*/
pixman_bool_t
-PREFIX(pixman_region_validate) (region_type_t * badreg,
+PREFIX(_validate) (region_type_t * badreg,
int *pOverlap)
{
/* Descriptor for regions under construction in Step 2. */
@@ -1772,7 +1772,7 @@ pixman_region_subtractO (
*-----------------------------------------------------------------------
*/
pixman_bool_t
-PREFIX(pixman_region_subtract) (region_type_t * regD,
+PREFIX(_subtract) (region_type_t * regD,
region_type_t * regM,
region_type_t * regS)
{
@@ -1787,7 +1787,7 @@ PREFIX(pixman_region_subtract) (region_type_t * regD,
{
if (PIXREGION_NAR (regS))
return pixman_break (regD);
- return PREFIX(pixman_region_copy) (regD, regM);
+ return PREFIX(_copy) (regD, regM);
}
else if (regM == regS)
{
@@ -1836,7 +1836,7 @@ PREFIX(pixman_region_subtract) (region_type_t * regD,
*-----------------------------------------------------------------------
*/
pixman_bool_t
-PREFIX(pixman_region_inverse) (region_type_t * newReg, /* Destination region */
+PREFIX(_inverse) (region_type_t * newReg, /* Destination region */
region_type_t * reg1, /* Region to invert */
box_type_t * invRect) /* Bounding box for inversion */
{
@@ -1895,7 +1895,7 @@ PREFIX(pixman_region_inverse) (region_type_t * newReg, /* Destination r
*/
pixman_region_overlap_t
-PREFIX(pixman_region_contains_rectangle) (region_type_t * region,
+PREFIX(_contains_rectangle) (region_type_t * region,
box_type_t * prect)
{
int x;
@@ -1995,12 +1995,12 @@ PREFIX(pixman_region_contains_rectangle) (region_type_t * region,
}
}
-/* PREFIX(pixman_region_translate) (region, x, y)
+/* PREFIX(_translate) (region, x, y)
translates in place
*/
void
-PREFIX(pixman_region_translate) (region_type_t * region, int x, int y)
+PREFIX(_translate) (region_type_t * region, int x, int y)
{
int x1, x2, y1, y2;
int nbox;
@@ -2082,7 +2082,7 @@ PREFIX(pixman_region_translate) (region_type_t * region, int x, int y)
}
void
-PREFIX(pixman_region_reset) (region_type_t *region, box_type_t *box)
+PREFIX(_reset) (region_type_t *region, box_type_t *box)
{
good(region);
assert(box->x1<=box->x2);
@@ -2094,7 +2094,7 @@ PREFIX(pixman_region_reset) (region_type_t *region, box_type_t *box)
/* box is "return" value */
int
-PREFIX(pixman_region_contains_point) (region_type_t * region,
+PREFIX(_contains_point) (region_type_t * region,
int x, int y,
box_type_t * box)
{
@@ -2127,14 +2127,14 @@ PREFIX(pixman_region_contains_point) (region_type_t * region,
}
int
-PREFIX(pixman_region_not_empty) (region_type_t * region)
+PREFIX(_not_empty) (region_type_t * region)
{
good(region);
return(!PIXREGION_NIL(region));
}
void
-PREFIX(pixman_region_empty) (region_type_t * region)
+PREFIX(_empty) (region_type_t * region)
{
good(region);
freeData(region);
@@ -2144,7 +2144,7 @@ PREFIX(pixman_region_empty) (region_type_t * region)
}
box_type_t *
-PREFIX(pixman_region_extents) (region_type_t * region)
+PREFIX(_extents) (region_type_t * region)
{
good(region);
return(®ion->extents);
@@ -2158,7 +2158,7 @@ PREFIX(pixman_region_extents) (region_type_t * region)
*/
pixman_bool_t
-PREFIX(pixman_region_selfcheck) (reg)
+PREFIX(_selfcheck) (reg)
region_type_t * reg;
{
int i, numRects;
@@ -2204,7 +2204,7 @@ PREFIX(pixman_region_selfcheck) (reg)
}
pixman_bool_t
-PREFIX(pixman_region_init_rects) (region_type_t *region,
+PREFIX(_init_rects) (region_type_t *region,
box_type_t *boxes, int count)
{
int overlap;
@@ -2212,7 +2212,7 @@ PREFIX(pixman_region_init_rects) (region_type_t *region,
/* if it's 1, then we just want to set the extents, so call
* the existing method. */
if (count == 1) {
- PREFIX(pixman_region_init_rect) (region,
+ PREFIX(_init_rect) (region,
boxes[0].x1,
boxes[0].y1,
boxes[0].x2 - boxes[0].x1,
@@ -2220,7 +2220,7 @@ PREFIX(pixman_region_init_rects) (region_type_t *region,
return TRUE;
}
- PREFIX(pixman_region_init) (region);
+ PREFIX(_init) (region);
/* if it's 0, don't call pixman_rect_alloc -- 0 rectangles is
* a special case, and causing pixman_rect_alloc would cause
@@ -2239,5 +2239,5 @@ PREFIX(pixman_region_init_rects) (region_type_t *region,
/* Validate */
region->extents.x1 = region->extents.x2 = 0;
- return PREFIX(pixman_region_validate) (region, &overlap);
+ return PREFIX(_validate) (region, &overlap);
}
diff --git a/pixman/pixman-region16.c b/pixman/pixman-region16.c
index e18c7ac..0eea051 100644
--- a/pixman/pixman-region16.c
+++ b/pixman/pixman-region16.c
@@ -36,6 +36,6 @@ typedef struct {
int x, y;
} point_type_t;
-#define PREFIX(x) x
+#define PREFIX(x) pixman_region##x
#include "pixman-region.c"
diff --git a/pixman/pixman-region32.c b/pixman/pixman-region32.c
new file mode 100644
index 0000000..2e63b00
--- /dev/null
+++ b/pixman/pixman-region32.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Soren Sandmann <sandmann at redhat.com>
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "pixman-private.h"
+
+typedef pixman_box16_t box_type_t;
+typedef pixman_region16_data_t region_data_type_t;
+typedef pixman_region16_t region_type_t;
+
+typedef struct {
+ int x, y;
+} point_type_t;
+
+#define PREFIX(x) pixman_region32##x
+
+#include "pixman-region.c"
commit c22df027d6b9c9957e73ea9e34f14d504deb9d91
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:24:28 2008 -0400
Add prefixes to global primitive regions
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 8cf9564..a98c6fe 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -79,13 +79,13 @@ SOFTWARE.
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
-static const box_type_t _pixman_region_emptyBox = {0, 0, 0, 0};
-static const region_data_type_t _pixman_region_emptyData = {0, 0};
-static const region_data_type_t _pixman_brokendata = {0, 0};
+static const box_type_t PREFIX(pixman_region_emptyBox_) = {0, 0, 0, 0};
+static const region_data_type_t PREFIX(pixman_region_emptyData_) = {0, 0};
+static const region_data_type_t PREFIX(pixman_region_brokendata_) = {0, 0};
-static box_type_t *pixman_region_emptyBox = (box_type_t *)&_pixman_region_emptyBox;
-static region_data_type_t *pixman_region_emptyData = (region_data_type_t *)&_pixman_region_emptyData;
-static region_data_type_t *pixman_brokendata = (region_data_type_t *)&_pixman_brokendata;
+static box_type_t *pixman_region_emptyBox = (box_type_t *)&PREFIX(pixman_region_emptyBox_);
+static region_data_type_t *pixman_region_emptyData = (region_data_type_t *)&PREFIX(pixman_region_emptyData_);
+static region_data_type_t *pixman_brokendata = (region_data_type_t *)&PREFIX(pixman_region_brokendata_);
/* This function exists only to make it possible to preserve the X ABI - it should
* go away at first opportunity.
commit cab6a175ec4a1b29b51060293aacaf2cf2f987a0
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:20:27 2008 -0400
Delete more unused stuff
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 87254b6..8cf9564 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2081,35 +2081,6 @@ PREFIX(pixman_region_translate) (region_type_t * region, int x, int y)
}
}
-/* XXX: Do we need this?
-static pixman_bool_t
-pixman_region16_data_copy(region_type_t * dst, region_type_t * src)
-{
- good(dst);
- good(src);
- if (dst->data)
- return TRUE;
- if (dst == src)
- return TRUE;
- if (!src->data || !src->data->size)
- {
- freeData(dst);
- dst->data = (region_data_type_t *)NULL;
- return TRUE;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- freeData(dst);
- dst->data = allocData(src->data->numRects);
- if (!dst->data)
- return pixman_break (dst);
- }
- dst->data->size = src->data->size;
- dst->data->numRects = src->data->numRects;
- return TRUE;
-}
-*/
-
void
PREFIX(pixman_region_reset) (region_type_t *region, box_type_t *box)
{
@@ -2162,15 +2133,6 @@ PREFIX(pixman_region_not_empty) (region_type_t * region)
return(!PIXREGION_NIL(region));
}
-/* XXX: Do we need this?
-static int
-pixman_region16_broken(region_type_t * region)
-{
- good(region);
- return (PIXREGION_NAR(region));
-}
-*/
-
void
PREFIX(pixman_region_empty) (region_type_t * region)
{
commit 9395f08d6e6316ee853a976b806e57821e13991e
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:16:55 2008 -0400
Delete more unused stuff
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 42371ad..87254b6 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -275,7 +275,7 @@ PREFIX(pixman_region_equal) (reg1, reg2)
}
int
-PREFIX(pixman_region16_print) (rgn)
+PREFIX(pixman_region_print) (rgn)
region_type_t * rgn;
{
int num, size;
@@ -2188,117 +2188,6 @@ PREFIX(pixman_region_extents) (region_type_t * region)
return(®ion->extents);
}
-#define ExchangeSpans(a, b) \
-{ \
- point_type_t tpt; \
- int tw; \
- \
- tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \
- tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \
-}
-
-/* ||| I should apply the merge sort code to rectangle sorting above, and see
- if mapping time can be improved. But right now I've been at work 12 hours,
- so forget it.
-*/
-
-static void QuickSortSpans(
- point_type_t spans[],
- int widths[],
- int numSpans)
-{
- int y;
- int i, j, m;
- point_type_t *r;
-
- /* Always called with numSpans > 1 */
- /* Sorts only by y, doesn't bother to sort by x */
-
- do
- {
- if (numSpans < 9)
- {
- /* Do insertion sort */
- int yprev;
-
- yprev = spans[0].y;
- i = 1;
- do
- { /* while i != numSpans */
- y = spans[i].y;
- if (yprev > y)
- {
- /* spans[i] is out of order. Move into proper location. */
- point_type_t tpt;
- int tw, k;
-
- for (j = 0; y >= spans[j].y; j++) {}
- tpt = spans[i];
- tw = widths[i];
- for (k = i; k != j; k--)
- {
- spans[k] = spans[k-1];
- widths[k] = widths[k-1];
- }
- spans[j] = tpt;
- widths[j] = tw;
- y = spans[i].y;
- } /* if out of order */
- yprev = y;
- i++;
- } while (i != numSpans);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- m = numSpans / 2;
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- if (spans[m].y > spans[numSpans-1].y) ExchangeSpans(m, numSpans-1);
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- y = spans[0].y;
-
- /* Partition array */
- i = 0;
- j = numSpans;
- do
- {
- r = &(spans[i]);
- do
- {
- r++;
- i++;
- } while (i != numSpans && r->y < y);
- r = &(spans[j]);
- do
- {
- r--;
- j--;
- } while (y < r->y);
- if (i < j)
- ExchangeSpans(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeSpans(0, j);
-
- /* Recurse */
- if (numSpans-j-1 > 1)
- QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1);
- numSpans = j;
- } while (numSpans > 1);
-}
-
-#define NextBand() \
-{ \
- clipy1 = pboxBandStart->y1; \
- clipy2 = pboxBandStart->y2; \
- pboxBandEnd = pboxBandStart + 1; \
- while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) { \
- pboxBandEnd++; \
- } \
- for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \
-}
-
/*
Clip a list of scanlines to a region. The caller has allocated the
space. FSorted is non-zero if the scanline origins are in ascending
commit b00fcb6d627370930daec9d1e9601af7ce28944c
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:15:41 2008 -0400
More data types; remove unused stuff
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 7ae3bcf..42371ad 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -80,12 +80,12 @@ SOFTWARE.
#define MAX(a,b) ((a) > (b) ? (a) : (b))
static const box_type_t _pixman_region_emptyBox = {0, 0, 0, 0};
-static const pixman_region16_data_t _pixman_region_emptyData = {0, 0};
-static const pixman_region16_data_t _pixman_brokendata = {0, 0};
+static const region_data_type_t _pixman_region_emptyData = {0, 0};
+static const region_data_type_t _pixman_brokendata = {0, 0};
static box_type_t *pixman_region_emptyBox = (box_type_t *)&_pixman_region_emptyBox;
-static pixman_region16_data_t *pixman_region_emptyData = (pixman_region16_data_t *)&_pixman_region_emptyData;
-static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_pixman_brokendata;
+static region_data_type_t *pixman_region_emptyData = (region_data_type_t *)&_pixman_region_emptyData;
+static region_data_type_t *pixman_brokendata = (region_data_type_t *)&_pixman_brokendata;
/* This function exists only to make it possible to preserve the X ABI - it should
* go away at first opportunity.
@@ -97,8 +97,8 @@ static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_p
*/
void
PREFIX(pixman_region_set_static_pointers) (box_type_t *empty_box,
- pixman_region16_data_t *empty_data,
- pixman_region16_data_t *broken_data)
+ region_data_type_t *empty_data,
+ region_data_type_t *broken_data)
{
pixman_region_emptyBox = empty_box;
pixman_region_emptyData = empty_data;
@@ -106,7 +106,7 @@ PREFIX(pixman_region_set_static_pointers) (box_type_t *empty_box,
}
static pixman_bool_t
-pixman_break (pixman_region16_t *pReg);
+pixman_break (region_type_t *pReg);
/*
* The functions in this file implement the Region abstraction used extensively
@@ -184,10 +184,10 @@ PIXREGION_SZOF(size_t n)
if (n > UINT32_MAX / sizeof(box_type_t))
return 0;
- if (sizeof(pixman_region16_data_t) > UINT32_MAX - size)
+ if (sizeof(region_data_type_t) > UINT32_MAX - size)
return 0;
- return size + sizeof(pixman_region16_data_t);
+ return size + sizeof(region_data_type_t);
}
static void *
@@ -235,12 +235,12 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
#define DOWNSIZE(reg,numRects) \
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
{ \
- pixman_region16_data_t * NewData; \
+ region_data_type_t * NewData; \
size_t data_size = PIXREGION_SZOF(numRects); \
if (!data_size) \
NewData = NULL; \
else \
- NewData = (pixman_region16_data_t *)realloc((reg)->data, data_size); \
+ NewData = (region_data_type_t *)realloc((reg)->data, data_size); \
if (NewData) \
{ \
NewData->size = (numRects); \
@@ -250,8 +250,8 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
pixman_bool_t
PREFIX(pixman_region_equal) (reg1, reg2)
- pixman_region16_t * reg1;
- pixman_region16_t * reg2;
+ region_type_t * reg1;
+ region_type_t * reg2;
{
int i;
box_type_t *rects1;
@@ -276,7 +276,7 @@ PREFIX(pixman_region_equal) (reg1, reg2)
int
PREFIX(pixman_region16_print) (rgn)
- pixman_region16_t * rgn;
+ region_type_t * rgn;
{
int num, size;
int i;
@@ -297,14 +297,14 @@ PREFIX(pixman_region16_print) (rgn)
void
-PREFIX(pixman_region_init) (pixman_region16_t *region)
+PREFIX(pixman_region_init) (region_type_t *region)
{
region->extents = *pixman_region_emptyBox;
region->data = pixman_region_emptyData;
}
void
-PREFIX(pixman_region_init_rect) (pixman_region16_t *region,
+PREFIX(pixman_region_init_rect) (region_type_t *region,
int x, int y, unsigned int width, unsigned int height)
{
region->extents.x1 = x;
@@ -315,33 +315,33 @@ PREFIX(pixman_region_init_rect) (pixman_region16_t *region,
}
void
-PREFIX(pixman_region_init_with_extents) (pixman_region16_t *region, box_type_t *extents)
+PREFIX(pixman_region_init_with_extents) (region_type_t *region, box_type_t *extents)
{
region->extents = *extents;
region->data = NULL;
}
void
-PREFIX(pixman_region_fini) (pixman_region16_t *region)
+PREFIX(pixman_region_fini) (region_type_t *region)
{
good (region);
freeData (region);
}
int
-PREFIX(pixman_region_n_rects) (pixman_region16_t *region)
+PREFIX(pixman_region_n_rects) (region_type_t *region)
{
return PIXREGION_NUM_RECTS (region);
}
box_type_t *
-PREFIX(pixman_region_rects) (pixman_region16_t *region)
+PREFIX(pixman_region_rects) (region_type_t *region)
{
return PIXREGION_RECTS (region);
}
box_type_t *
-PREFIX(pixman_region_rectangles) (pixman_region16_t *region,
+PREFIX(pixman_region_rectangles) (region_type_t *region,
int *n_rects)
{
if (n_rects)
@@ -351,7 +351,7 @@ PREFIX(pixman_region_rectangles) (pixman_region16_t *region,
}
static pixman_bool_t
-pixman_break (pixman_region16_t *region)
+pixman_break (region_type_t *region)
{
freeData (region);
region->extents = *pixman_region_emptyBox;
@@ -360,9 +360,9 @@ pixman_break (pixman_region16_t *region)
}
static pixman_bool_t
-pixman_rect_alloc (pixman_region16_t * region, int n)
+pixman_rect_alloc (region_type_t * region, int n)
{
- pixman_region16_data_t *data;
+ region_data_type_t *data;
if (!region->data)
{
@@ -394,7 +394,7 @@ pixman_rect_alloc (pixman_region16_t * region, int n)
if (!data_size)
data = NULL;
else
- data = (pixman_region16_data_t *)realloc(region->data, PIXREGION_SZOF(n));
+ data = (region_data_type_t *)realloc(region->data, PIXREGION_SZOF(n));
if (!data)
return pixman_break (region);
region->data = data;
@@ -404,7 +404,7 @@ pixman_rect_alloc (pixman_region16_t * region, int n)
}
pixman_bool_t
-PREFIX(pixman_region_copy) (pixman_region16_t *dst, pixman_region16_t *src)
+PREFIX(pixman_region_copy) (region_type_t *dst, region_type_t *src)
{
good(dst);
good(src);
@@ -455,7 +455,7 @@ PREFIX(pixman_region_copy) (pixman_region16_t *dst, pixman_region16_t *src)
*/
static inline int
pixman_coalesce (
- pixman_region16_t * region, /* Region to coalesce */
+ region_type_t * region, /* Region to coalesce */
int prevStart, /* Index of start of previous band */
int curStart) /* Index of start of current band */
{
@@ -538,7 +538,7 @@ pixman_coalesce (
static inline pixman_bool_t
pixman_region_appendNonO (
- pixman_region16_t * region,
+ region_type_t * region,
box_type_t * r,
box_type_t * rEnd,
int y1,
@@ -615,7 +615,7 @@ pixman_region_appendNonO (
*/
typedef pixman_bool_t (*OverlapProcPtr)(
- pixman_region16_t *region,
+ region_type_t *region,
box_type_t *r1,
box_type_t *r1End,
box_type_t *r2,
@@ -626,9 +626,9 @@ typedef pixman_bool_t (*OverlapProcPtr)(
static pixman_bool_t
pixman_op(
- pixman_region16_t *newReg, /* Place to store result */
- pixman_region16_t * reg1, /* First region in operation */
- pixman_region16_t * reg2, /* 2d region in operation */
+ region_type_t *newReg, /* Place to store result */
+ region_type_t * reg1, /* First region in operation */
+ region_type_t * reg2, /* 2d region in operation */
OverlapProcPtr overlapFunc, /* Function to call for over-
* lapping bands */
int appendNon1, /* Append non-overlapping bands */
@@ -643,7 +643,7 @@ pixman_op(
box_type_t * r2End; /* End of 2d region */
short ybot; /* Bottom of intersection */
short ytop; /* Top of intersection */
- pixman_region16_data_t * oldData; /* Old data for newReg */
+ region_data_type_t * oldData; /* Old data for newReg */
int prevBand; /* Index of start of
* previous band in newReg */
int curBand; /* Index of start of current
@@ -680,7 +680,7 @@ pixman_op(
assert(r1 != r1End);
assert(r2 != r2End);
- oldData = (pixman_region16_data_t *)NULL;
+ oldData = (region_data_type_t *)NULL;
if (((newReg == reg1) && (newSize > 1)) ||
((newReg == reg2) && (numRects > 1)))
{
@@ -838,7 +838,7 @@ pixman_op(
{
newReg->extents = *PIXREGION_BOXPTR(newReg);
freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
+ newReg->data = (region_data_type_t *)NULL;
}
else
{
@@ -864,7 +864,7 @@ pixman_op(
*-----------------------------------------------------------------------
*/
static void
-pixman_set_extents (pixman_region16_t *region)
+pixman_set_extents (region_type_t *region)
{
box_type_t *box, *boxEnd;
@@ -922,7 +922,7 @@ pixman_set_extents (pixman_region16_t *region)
*/
/*ARGSUSED*/
static pixman_bool_t
-pixman_region_intersectO (pixman_region16_t *region,
+pixman_region_intersectO (region_type_t *region,
box_type_t *r1,
box_type_t *r1End,
box_type_t *r2,
@@ -968,9 +968,9 @@ pixman_region_intersectO (pixman_region16_t *region,
}
pixman_bool_t
-PREFIX(pixman_region_intersect) (pixman_region16_t * newReg,
- pixman_region16_t * reg1,
- pixman_region16_t * reg2)
+PREFIX(pixman_region_intersect) (region_type_t * newReg,
+ region_type_t * reg1,
+ region_type_t * reg2)
{
good(reg1);
good(reg2);
@@ -999,7 +999,7 @@ PREFIX(pixman_region_intersect) (pixman_region16_t * newReg,
newReg->extents.x2 = MIN(reg1->extents.x2, reg2->extents.x2);
newReg->extents.y2 = MIN(reg1->extents.y2, reg2->extents.y2);
freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
+ newReg->data = (region_data_type_t *)NULL;
}
else if (!reg2->data && SUBSUMES(®2->extents, ®1->extents))
{
@@ -1063,7 +1063,7 @@ PREFIX(pixman_region_intersect) (pixman_region16_t * newReg,
*/
static pixman_bool_t
pixman_region_unionO (
- pixman_region16_t *region,
+ region_type_t *region,
box_type_t *r1,
box_type_t *r1End,
box_type_t *r2,
@@ -1125,12 +1125,12 @@ pixman_region_unionO (
* single rectangle
*/
pixman_bool_t
-PREFIX(pixman_region_union_rect) (pixman_region16_t *dest,
- pixman_region16_t *source,
+PREFIX(pixman_region_union_rect) (region_type_t *dest,
+ region_type_t *source,
int x, int y,
unsigned int width, unsigned int height)
{
- pixman_region16_t region;
+ region_type_t region;
if (!width || !height)
return PREFIX(pixman_region_copy) (dest, source);
@@ -1144,9 +1144,9 @@ PREFIX(pixman_region_union_rect) (pixman_region16_t *dest,
}
pixman_bool_t
-PREFIX(pixman_region_union) (pixman_region16_t *newReg,
- pixman_region16_t *reg1,
- pixman_region16_t *reg2)
+PREFIX(pixman_region_union) (region_type_t *newReg,
+ region_type_t *reg1,
+ region_type_t *reg2)
{
int overlap; /* result ignored */
@@ -1244,8 +1244,8 @@ PREFIX(pixman_region_union) (pixman_region16_t *newReg,
*
*/
pixman_bool_t
-PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
- pixman_region16_t * rgn)
+PREFIX(pixman_region_append) (region_type_t * dstrgn,
+ region_type_t * rgn)
{
int numRects, dnumRects, size;
box_type_t *new, *old;
@@ -1257,7 +1257,7 @@ PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
if (!rgn->data && (dstrgn->data == pixman_region_emptyData))
{
dstrgn->extents = rgn->extents;
- dstrgn->data = (pixman_region16_data_t *)NULL;
+ dstrgn->data = (region_data_type_t *)NULL;
return TRUE;
}
@@ -1429,12 +1429,12 @@ QuickSortRects(
*/
pixman_bool_t
-PREFIX(pixman_region_validate) (pixman_region16_t * badreg,
+PREFIX(pixman_region_validate) (region_type_t * badreg,
int *pOverlap)
{
/* Descriptor for regions under construction in Step 2. */
typedef struct {
- pixman_region16_t reg;
+ region_type_t reg;
int prevBand;
int curBand;
} RegionInfo;
@@ -1446,10 +1446,10 @@ PREFIX(pixman_region_validate) (pixman_region16_t * badreg,
int i; /* Index into rects */
int j; /* Index into ri */
RegionInfo *rit; /* &ri[j] */
- pixman_region16_t * reg; /* ri[j].reg */
+ region_type_t * reg; /* ri[j].reg */
box_type_t * box; /* Current box in rects */
box_type_t * riBox; /* Last box in ri[j].reg */
- pixman_region16_t * hreg; /* ri[j_half].reg */
+ region_type_t * hreg; /* ri[j_half].reg */
pixman_bool_t ret = TRUE;
*pOverlap = FALSE;
@@ -1471,7 +1471,7 @@ PREFIX(pixman_region_validate) (pixman_region16_t * badreg,
if ((numRects) == 1)
{
freeData(badreg);
- badreg->data = (pixman_region16_data_t *) NULL;
+ badreg->data = (region_data_type_t *) NULL;
}
else
{
@@ -1570,7 +1570,7 @@ PREFIX(pixman_region_validate) (pixman_region16_t * badreg,
rit->prevBand = 0;
rit->curBand = 0;
rit->reg.extents = *box;
- rit->reg.data = (pixman_region16_data_t *)NULL;
+ rit->reg.data = (region_data_type_t *)NULL;
if (!pixman_rect_alloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */
goto bail;
NextRect: ;
@@ -1589,7 +1589,7 @@ NextRect: ;
if (reg->data->numRects == 1) /* keep unions happy below */
{
freeData(reg);
- reg->data = (pixman_region16_data_t *)NULL;
+ reg->data = (region_data_type_t *)NULL;
}
}
@@ -1650,7 +1650,7 @@ bail:
/*ARGSUSED*/
static pixman_bool_t
pixman_region_subtractO (
- pixman_region16_t * region,
+ region_type_t * region,
box_type_t * r1,
box_type_t * r1End,
box_type_t * r2,
@@ -1772,9 +1772,9 @@ pixman_region_subtractO (
*-----------------------------------------------------------------------
*/
pixman_bool_t
-PREFIX(pixman_region_subtract) (pixman_region16_t * regD,
- pixman_region16_t * regM,
- pixman_region16_t * regS)
+PREFIX(pixman_region_subtract) (region_type_t * regD,
+ region_type_t * regM,
+ region_type_t * regS)
{
int overlap; /* result ignored */
@@ -1836,11 +1836,11 @@ PREFIX(pixman_region_subtract) (pixman_region16_t * regD,
*-----------------------------------------------------------------------
*/
pixman_bool_t
-PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destination region */
- pixman_region16_t * reg1, /* Region to invert */
+PREFIX(pixman_region_inverse) (region_type_t * newReg, /* Destination region */
+ region_type_t * reg1, /* Region to invert */
box_type_t * invRect) /* Bounding box for inversion */
{
- pixman_region16_t invReg; /* Quick and dirty region made from the
+ region_type_t invReg; /* Quick and dirty region made from the
* bounding box */
int overlap; /* result ignored */
@@ -1853,7 +1853,7 @@ PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destinati
return pixman_break (newReg);
newReg->extents = *invRect;
freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
+ newReg->data = (region_data_type_t *)NULL;
return TRUE;
}
@@ -1861,7 +1861,7 @@ PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destinati
do yucky substraction for overlaps, and
just throw away rectangles in region 2 that aren't in region 1 */
invReg.extents = *invRect;
- invReg.data = (pixman_region16_data_t *)NULL;
+ invReg.data = (region_data_type_t *)NULL;
if (!pixman_op(newReg, &invReg, reg1, pixman_region_subtractO, TRUE, FALSE, &overlap))
return FALSE;
@@ -1895,7 +1895,7 @@ PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destinati
*/
pixman_region_overlap_t
-PREFIX(pixman_region_contains_rectangle) (pixman_region16_t * region,
+PREFIX(pixman_region_contains_rectangle) (region_type_t * region,
box_type_t * prect)
{
int x;
@@ -2000,7 +2000,7 @@ PREFIX(pixman_region_contains_rectangle) (pixman_region16_t * region,
*/
void
-PREFIX(pixman_region_translate) (pixman_region16_t * region, int x, int y)
+PREFIX(pixman_region_translate) (region_type_t * region, int x, int y)
{
int x1, x2, y1, y2;
int nbox;
@@ -2073,7 +2073,7 @@ PREFIX(pixman_region_translate) (pixman_region16_t * region, int x, int y)
{
region->extents = *PIXREGION_BOXPTR(region);
freeData(region);
- region->data = (pixman_region16_data_t *)NULL;
+ region->data = (region_data_type_t *)NULL;
}
else
pixman_set_extents(region);
@@ -2083,7 +2083,7 @@ PREFIX(pixman_region_translate) (pixman_region16_t * region, int x, int y)
/* XXX: Do we need this?
static pixman_bool_t
-pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
+pixman_region16_data_copy(region_type_t * dst, region_type_t * src)
{
good(dst);
good(src);
@@ -2094,7 +2094,7 @@ pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
if (!src->data || !src->data->size)
{
freeData(dst);
- dst->data = (pixman_region16_data_t *)NULL;
+ dst->data = (region_data_type_t *)NULL;
return TRUE;
}
if (!dst->data || (dst->data->size < src->data->numRects))
@@ -2111,19 +2111,19 @@ pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
*/
void
-PREFIX(pixman_region_reset) (pixman_region16_t *region, box_type_t *box)
+PREFIX(pixman_region_reset) (region_type_t *region, box_type_t *box)
{
good(region);
assert(box->x1<=box->x2);
assert(box->y1<=box->y2);
region->extents = *box;
freeData(region);
- region->data = (pixman_region16_data_t *)NULL;
+ region->data = (region_data_type_t *)NULL;
}
/* box is "return" value */
int
-PREFIX(pixman_region_contains_point) (pixman_region16_t * region,
+PREFIX(pixman_region_contains_point) (region_type_t * region,
int x, int y,
box_type_t * box)
{
@@ -2156,7 +2156,7 @@ PREFIX(pixman_region_contains_point) (pixman_region16_t * region,
}
int
-PREFIX(pixman_region_not_empty) (pixman_region16_t * region)
+PREFIX(pixman_region_not_empty) (region_type_t * region)
{
good(region);
return(!PIXREGION_NIL(region));
@@ -2164,7 +2164,7 @@ PREFIX(pixman_region_not_empty) (pixman_region16_t * region)
/* XXX: Do we need this?
static int
-pixman_region16_broken(pixman_region16_t * region)
+pixman_region16_broken(region_type_t * region)
{
good(region);
return (PIXREGION_NAR(region));
@@ -2172,7 +2172,7 @@ pixman_region16_broken(pixman_region16_t * region)
*/
void
-PREFIX(pixman_region_empty) (pixman_region16_t * region)
+PREFIX(pixman_region_empty) (region_type_t * region)
{
good(region);
freeData(region);
@@ -2182,7 +2182,7 @@ PREFIX(pixman_region_empty) (pixman_region16_t * region)
}
box_type_t *
-PREFIX(pixman_region_extents) (pixman_region16_t * region)
+PREFIX(pixman_region_extents) (region_type_t * region)
{
good(region);
return(®ion->extents);
@@ -2306,158 +2306,9 @@ static void QuickSortSpans(
returns the number of new, clipped scanlines.
*/
-#ifdef XXX_DO_WE_NEED_THIS
-static int
-pixman_region16_clip_spans(
- pixman_region16_t *prgnDst,
- point_type_t *ppt,
- int *pwidth,
- int nspans,
- point_type_t *pptNew,
- int *pwidthNew,
- int fSorted)
-{
- point_type_t *pptLast;
- int *pwidthNewStart; /* the vengeance of Xerox! */
- int y, x1, x2;
- int numRects;
-
- good(prgnDst);
- pptLast = ppt + nspans;
- pwidthNewStart = pwidthNew;
-
- if (!prgnDst->data)
- {
- /* Do special fast code with clip boundaries in registers(?) */
- /* It doesn't pay much to make use of fSorted in this case,
- so we lump everything together. */
-
- int clipx1, clipx2, clipy1, clipy2;
-
- clipx1 = prgnDst->extents.x1;
- clipy1 = prgnDst->extents.y1;
- clipx2 = prgnDst->extents.x2;
- clipy2 = prgnDst->extents.y2;
-
- for (; ppt != pptLast; ppt++, pwidth++)
- {
- y = ppt->y;
- x1 = ppt->x;
- if (clipy1 <= y && y < clipy2)
- {
- x2 = x1 + *pwidth;
- if (x1 < clipx1) x1 = clipx1;
- if (x2 > clipx2) x2 = clipx2;
- if (x1 < x2)
- {
- /* part of span in clip rectangle */
- pptNew->x = x1;
- pptNew->y = y;
- *pwidthNew = x2 - x1;
- pptNew++;
- pwidthNew++;
- }
- }
- } /* end for */
-
- }
- else if ((numRects = prgnDst->data->numRects))
- {
- /* Have to clip against many boxes */
- box_type_t *pboxBandStart, *pboxBandEnd;
- box_type_t *pbox;
- box_type_t *pboxLast;
- int clipy1, clipy2;
-
- /* In this case, taking advantage of sorted spans gains more than
- the sorting costs. */
- if ((! fSorted) && (nspans > 1))
- QuickSortSpans(ppt, pwidth, nspans);
-
- pboxBandStart = PIXREGION_BOXPTR(prgnDst);
- pboxLast = pboxBandStart + numRects;
-
- NextBand();
-
- for (; ppt != pptLast; )
- {
- y = ppt->y;
- if (y < clipy2)
- {
- /* span is in the current band */
- pbox = pboxBandStart;
- x1 = ppt->x;
- x2 = x1 + *pwidth;
- do
- { /* For each box in band */
- int newx1, newx2;
-
- newx1 = x1;
- newx2 = x2;
- if (newx1 < pbox->x1) newx1 = pbox->x1;
- if (newx2 > pbox->x2) newx2 = pbox->x2;
- if (newx1 < newx2)
- {
- /* Part of span in clip rectangle */
- pptNew->x = newx1;
- pptNew->y = y;
- *pwidthNew = newx2 - newx1;
- pptNew++;
- pwidthNew++;
- }
- pbox++;
- } while (pbox != pboxBandEnd);
- ppt++;
- pwidth++;
- }
- else
- {
- /* Move to next band, adjust ppt as needed */
- pboxBandStart = pboxBandEnd;
- if (pboxBandStart == pboxLast)
- break; /* We're completely done */
- NextBand();
- }
- }
- }
- return (pwidthNew - pwidthNewStart);
-}
-
-/* find the band in a region with the most rectangles */
-static int
-pixman_region16_find_max_band(pixman_region16_t * prgn)
-{
- int nbox;
- box_type_t * pbox;
- int nThisBand;
- int nMaxBand = 0;
- short yThisBand;
-
- good(prgn);
- nbox = PIXREGION_NUM_RECTS(prgn);
- pbox = PIXREGION_RECTS(prgn);
-
- while(nbox > 0)
- {
- yThisBand = pbox->y1;
- nThisBand = 0;
- while((nbox > 0) && (pbox->y1 == yThisBand))
- {
- nbox--;
- pbox++;
- nThisBand++;
- }
- if (nThisBand > nMaxBand)
- nMaxBand = nThisBand;
- }
- return (nMaxBand);
-}
-#endif /* XXX_DO_WE_NEED_THIS */
-
-
pixman_bool_t
PREFIX(pixman_region_selfcheck) (reg)
- pixman_region16_t * reg;
+ region_type_t * reg;
{
int i, numRects;
@@ -2502,7 +2353,7 @@ PREFIX(pixman_region_selfcheck) (reg)
}
pixman_bool_t
-PREFIX(pixman_region_init_rects) (pixman_region16_t *region,
+PREFIX(pixman_region_init_rects) (region_type_t *region,
box_type_t *boxes, int count)
{
int overlap;
diff --git a/pixman/pixman-region16.c b/pixman/pixman-region16.c
index 3ad6b80..e18c7ac 100644
--- a/pixman/pixman-region16.c
+++ b/pixman/pixman-region16.c
@@ -28,7 +28,9 @@
#include "pixman-private.h"
-typedef pixman_box16_t box_type_t;
+typedef pixman_box16_t box_type_t;
+typedef pixman_region16_data_t region_data_type_t;
+typedef pixman_region16_t region_type_t;
typedef struct {
int x, y;
commit 4bdcd3bdb1223d5e611af9721e2eceb7e867b138
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:12:29 2008 -0400
Add point_type_t
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index a384f86..7ae3bcf 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -50,10 +50,6 @@ SOFTWARE.
#include <string.h>
#include <stdio.h>
-typedef struct pixman_region16_point {
- int x, y;
-} pixman_region16_point_t;
-
#define PIXREGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
/* not a region */
#define PIXREGION_NAR(reg) ((reg)->data == pixman_brokendata)
@@ -2194,7 +2190,7 @@ PREFIX(pixman_region_extents) (pixman_region16_t * region)
#define ExchangeSpans(a, b) \
{ \
- pixman_region16_point_t tpt; \
+ point_type_t tpt; \
int tw; \
\
tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \
@@ -2207,13 +2203,13 @@ PREFIX(pixman_region_extents) (pixman_region16_t * region)
*/
static void QuickSortSpans(
- pixman_region16_point_t spans[],
+ point_type_t spans[],
int widths[],
int numSpans)
{
int y;
int i, j, m;
- pixman_region16_point_t *r;
+ point_type_t *r;
/* Always called with numSpans > 1 */
/* Sorts only by y, doesn't bother to sort by x */
@@ -2233,7 +2229,7 @@ static void QuickSortSpans(
if (yprev > y)
{
/* spans[i] is out of order. Move into proper location. */
- pixman_region16_point_t tpt;
+ point_type_t tpt;
int tw, k;
for (j = 0; y >= spans[j].y; j++) {}
@@ -2314,14 +2310,14 @@ static void QuickSortSpans(
static int
pixman_region16_clip_spans(
pixman_region16_t *prgnDst,
- pixman_region16_point_t *ppt,
+ point_type_t *ppt,
int *pwidth,
int nspans,
- pixman_region16_point_t *pptNew,
+ point_type_t *pptNew,
int *pwidthNew,
int fSorted)
{
- pixman_region16_point_t *pptLast;
+ point_type_t *pptLast;
int *pwidthNewStart; /* the vengeance of Xerox! */
int y, x1, x2;
int numRects;
diff --git a/pixman/pixman-region16.c b/pixman/pixman-region16.c
index b897e1f..3ad6b80 100644
--- a/pixman/pixman-region16.c
+++ b/pixman/pixman-region16.c
@@ -30,6 +30,10 @@
typedef pixman_box16_t box_type_t;
+typedef struct {
+ int x, y;
+} point_type_t;
+
#define PREFIX(x) x
#include "pixman-region.c"
commit abf6b6ca6ce8f54cb8ba9d34570d4cdf0537bbd2
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:11:24 2008 -0400
Replace pixman_box16_t with box_type_t
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 7d6d8a2..a384f86 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -45,17 +45,11 @@ SOFTWARE.
******************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
-#include "pixman-private.h"
-
typedef struct pixman_region16_point {
int x, y;
} pixman_region16_point_t;
@@ -65,9 +59,9 @@ typedef struct pixman_region16_point {
#define PIXREGION_NAR(reg) ((reg)->data == pixman_brokendata)
#define PIXREGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
#define PIXREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
-#define PIXREGION_RECTS(reg) ((reg)->data ? (pixman_box16_t *)((reg)->data + 1) \
+#define PIXREGION_RECTS(reg) ((reg)->data ? (box_type_t *)((reg)->data + 1) \
: &(reg)->extents)
-#define PIXREGION_BOXPTR(reg) ((pixman_box16_t *)((reg)->data + 1))
+#define PIXREGION_BOXPTR(reg) ((box_type_t *)((reg)->data + 1))
#define PIXREGION_BOX(reg,i) (&PIXREGION_BOXPTR(reg)[i])
#define PIXREGION_TOP(reg) PIXREGION_BOX(reg, (reg)->data->numRects)
#define PIXREGION_END(reg) PIXREGION_BOX(reg, (reg)->data->numRects - 1)
@@ -82,8 +76,6 @@ typedef struct pixman_region16_point {
#define assert(expr)
#endif
-#define PREFIX(x) x
-
#define good(reg) assert(PREFIX(pixman_region_selfcheck) (reg))
#undef MIN
@@ -91,11 +83,11 @@ typedef struct pixman_region16_point {
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
-static const pixman_box16_t _pixman_region_emptyBox = {0, 0, 0, 0};
+static const box_type_t _pixman_region_emptyBox = {0, 0, 0, 0};
static const pixman_region16_data_t _pixman_region_emptyData = {0, 0};
static const pixman_region16_data_t _pixman_brokendata = {0, 0};
-static pixman_box16_t *pixman_region_emptyBox = (pixman_box16_t *)&_pixman_region_emptyBox;
+static box_type_t *pixman_region_emptyBox = (box_type_t *)&_pixman_region_emptyBox;
static pixman_region16_data_t *pixman_region_emptyData = (pixman_region16_data_t *)&_pixman_region_emptyData;
static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_pixman_brokendata;
@@ -108,7 +100,7 @@ static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_p
* work.
*/
void
-PREFIX(pixman_region_set_static_pointers) (pixman_box16_t *empty_box,
+PREFIX(pixman_region_set_static_pointers) (box_type_t *empty_box,
pixman_region16_data_t *empty_data,
pixman_region16_data_t *broken_data)
{
@@ -192,8 +184,8 @@ pixman_break (pixman_region16_t *pReg);
static size_t
PIXREGION_SZOF(size_t n)
{
- size_t size = n * sizeof(pixman_box16_t);
- if (n > UINT32_MAX / sizeof(pixman_box16_t))
+ size_t size = n * sizeof(box_type_t);
+ if (n > UINT32_MAX / sizeof(box_type_t))
return 0;
if (sizeof(pixman_region16_data_t) > UINT32_MAX - size)
@@ -266,8 +258,8 @@ PREFIX(pixman_region_equal) (reg1, reg2)
pixman_region16_t * reg2;
{
int i;
- pixman_box16_t *rects1;
- pixman_box16_t *rects2;
+ box_type_t *rects1;
+ box_type_t *rects2;
if (reg1->extents.x1 != reg2->extents.x1) return FALSE;
if (reg1->extents.x2 != reg2->extents.x2) return FALSE;
@@ -292,7 +284,7 @@ PREFIX(pixman_region16_print) (rgn)
{
int num, size;
int i;
- pixman_box16_t * rects;
+ box_type_t * rects;
num = PIXREGION_NUM_RECTS(rgn);
size = PIXREGION_SIZE(rgn);
@@ -327,7 +319,7 @@ PREFIX(pixman_region_init_rect) (pixman_region16_t *region,
}
void
-PREFIX(pixman_region_init_with_extents) (pixman_region16_t *region, pixman_box16_t *extents)
+PREFIX(pixman_region_init_with_extents) (pixman_region16_t *region, box_type_t *extents)
{
region->extents = *extents;
region->data = NULL;
@@ -346,13 +338,13 @@ PREFIX(pixman_region_n_rects) (pixman_region16_t *region)
return PIXREGION_NUM_RECTS (region);
}
-pixman_box16_t *
+box_type_t *
PREFIX(pixman_region_rects) (pixman_region16_t *region)
{
return PIXREGION_RECTS (region);
}
-pixman_box16_t *
+box_type_t *
PREFIX(pixman_region_rectangles) (pixman_region16_t *region,
int *n_rects)
{
@@ -439,7 +431,7 @@ PREFIX(pixman_region_copy) (pixman_region16_t *dst, pixman_region16_t *src)
}
dst->data->numRects = src->data->numRects;
memmove((char *)PIXREGION_BOXPTR(dst),(char *)PIXREGION_BOXPTR(src),
- dst->data->numRects * sizeof(pixman_box16_t));
+ dst->data->numRects * sizeof(box_type_t));
return TRUE;
}
@@ -471,8 +463,8 @@ pixman_coalesce (
int prevStart, /* Index of start of previous band */
int curStart) /* Index of start of current band */
{
- pixman_box16_t * pPrevBox; /* Current box in previous band */
- pixman_box16_t * pCurBox; /* Current box in current band */
+ box_type_t * pPrevBox; /* Current box in previous band */
+ box_type_t * pCurBox; /* Current box in current band */
int numRects; /* Number rectangles in both bands */
int y2; /* Bottom of current band */
/*
@@ -551,12 +543,12 @@ pixman_coalesce (
static inline pixman_bool_t
pixman_region_appendNonO (
pixman_region16_t * region,
- pixman_box16_t * r,
- pixman_box16_t * rEnd,
+ box_type_t * r,
+ box_type_t * rEnd,
int y1,
int y2)
{
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
int newRects;
newRects = rEnd - r;
@@ -592,7 +584,7 @@ pixman_region_appendNonO (
if ((newRects = rEnd - r)) { \
RECTALLOC(newReg, newRects); \
memmove((char *)PIXREGION_TOP(newReg),(char *)r, \
- newRects * sizeof(pixman_box16_t)); \
+ newRects * sizeof(box_type_t)); \
newReg->data->numRects += newRects; \
} \
}
@@ -628,10 +620,10 @@ pixman_region_appendNonO (
typedef pixman_bool_t (*OverlapProcPtr)(
pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
+ box_type_t *r1,
+ box_type_t *r1End,
+ box_type_t *r2,
+ box_type_t *r2End,
short y1,
short y2,
int *pOverlap);
@@ -649,10 +641,10 @@ pixman_op(
/* in region 2 ? */
int *pOverlap)
{
- pixman_box16_t * r1; /* Pointer into first region */
- pixman_box16_t * r2; /* Pointer into 2d region */
- pixman_box16_t * r1End; /* End of 1st region */
- pixman_box16_t * r2End; /* End of 2d region */
+ box_type_t * r1; /* Pointer into first region */
+ box_type_t * r2; /* Pointer into 2d region */
+ box_type_t * r1End; /* End of 1st region */
+ box_type_t * r2End; /* End of 2d region */
short ybot; /* Bottom of intersection */
short ytop; /* Top of intersection */
pixman_region16_data_t * oldData; /* Old data for newReg */
@@ -660,8 +652,8 @@ pixman_op(
* previous band in newReg */
int curBand; /* Index of start of current
* band in newReg */
- pixman_box16_t * r1BandEnd; /* End of current band in r1 */
- pixman_box16_t * r2BandEnd; /* End of current band in r2 */
+ box_type_t * r1BandEnd; /* End of current band in r1 */
+ box_type_t * r2BandEnd; /* End of current band in r2 */
short top; /* Top of non-overlapping band */
short bot; /* Bottom of non-overlapping band*/
int r1y1; /* Temps for r1->y1 and r2->y1 */
@@ -878,7 +870,7 @@ pixman_op(
static void
pixman_set_extents (pixman_region16_t *region)
{
- pixman_box16_t *box, *boxEnd;
+ box_type_t *box, *boxEnd;
if (!region->data)
return;
@@ -935,17 +927,17 @@ pixman_set_extents (pixman_region16_t *region)
/*ARGSUSED*/
static pixman_bool_t
pixman_region_intersectO (pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
+ box_type_t *r1,
+ box_type_t *r1End,
+ box_type_t *r2,
+ box_type_t *r2End,
short y1,
short y2,
int *pOverlap)
{
int x1;
int x2;
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
pNextRect = PIXREGION_TOP(region);
@@ -1076,15 +1068,15 @@ PREFIX(pixman_region_intersect) (pixman_region16_t * newReg,
static pixman_bool_t
pixman_region_unionO (
pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
+ box_type_t *r1,
+ box_type_t *r1End,
+ box_type_t *r2,
+ box_type_t *r2End,
short y1,
short y2,
int *pOverlap)
{
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
int x1; /* left and right side of current union */
int x2;
@@ -1260,7 +1252,7 @@ PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
pixman_region16_t * rgn)
{
int numRects, dnumRects, size;
- pixman_box16_t *new, *old;
+ box_type_t *new, *old;
int prepend;
if (PIXREGION_NAR(rgn))
@@ -1287,7 +1279,7 @@ PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
dstrgn->extents = rgn->extents;
else if (dstrgn->extents.x2 > dstrgn->extents.x1)
{
- pixman_box16_t *first, *last;
+ box_type_t *first, *last;
first = old;
last = PIXREGION_BOXPTR(dstrgn) + (dnumRects - 1);
@@ -1327,7 +1319,7 @@ PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
*new = *PIXREGION_BOXPTR(dstrgn);
else
memmove((char *)new,(char *)PIXREGION_BOXPTR(dstrgn),
- dnumRects * sizeof(pixman_box16_t));
+ dnumRects * sizeof(box_type_t));
new = PIXREGION_BOXPTR(dstrgn);
}
else
@@ -1335,14 +1327,14 @@ PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
if (numRects == 1)
*new = *old;
else
- memmove((char *)new, (char *)old, numRects * sizeof(pixman_box16_t));
+ memmove((char *)new, (char *)old, numRects * sizeof(box_type_t));
dstrgn->data->numRects += numRects;
return TRUE;
}
#define ExchangeRects(a, b) \
{ \
- pixman_box16_t t; \
+ box_type_t t; \
t = rects[a]; \
rects[a] = rects[b]; \
rects[b] = t; \
@@ -1350,13 +1342,13 @@ PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
static void
QuickSortRects(
- pixman_box16_t rects[],
+ box_type_t rects[],
int numRects)
{
int y1;
int x1;
int i, j;
- pixman_box16_t *r;
+ box_type_t *r;
/* Always called with numRects > 1 */
@@ -1459,8 +1451,8 @@ PREFIX(pixman_region_validate) (pixman_region16_t * badreg,
int j; /* Index into ri */
RegionInfo *rit; /* &ri[j] */
pixman_region16_t * reg; /* ri[j].reg */
- pixman_box16_t * box; /* Current box in rects */
- pixman_box16_t * riBox; /* Last box in ri[j].reg */
+ box_type_t * box; /* Current box in rects */
+ box_type_t * riBox; /* Last box in ri[j].reg */
pixman_region16_t * hreg; /* ri[j_half].reg */
pixman_bool_t ret = TRUE;
@@ -1663,15 +1655,15 @@ bail:
static pixman_bool_t
pixman_region_subtractO (
pixman_region16_t * region,
- pixman_box16_t * r1,
- pixman_box16_t * r1End,
- pixman_box16_t * r2,
- pixman_box16_t * r2End,
+ box_type_t * r1,
+ box_type_t * r1End,
+ box_type_t * r2,
+ box_type_t * r2End,
short y1,
short y2,
int *pOverlap)
{
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
int x1;
x1 = r1->x1;
@@ -1850,7 +1842,7 @@ PREFIX(pixman_region_subtract) (pixman_region16_t * regD,
pixman_bool_t
PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destination region */
pixman_region16_t * reg1, /* Region to invert */
- pixman_box16_t * invRect) /* Bounding box for inversion */
+ box_type_t * invRect) /* Bounding box for inversion */
{
pixman_region16_t invReg; /* Quick and dirty region made from the
* bounding box */
@@ -1908,12 +1900,12 @@ PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destinati
pixman_region_overlap_t
PREFIX(pixman_region_contains_rectangle) (pixman_region16_t * region,
- pixman_box16_t * prect)
+ box_type_t * prect)
{
int x;
int y;
- pixman_box16_t * pbox;
- pixman_box16_t * pboxEnd;
+ box_type_t * pbox;
+ box_type_t * pboxEnd;
int partIn, partOut;
int numRects;
@@ -2016,7 +2008,7 @@ PREFIX(pixman_region_translate) (pixman_region16_t * region, int x, int y)
{
int x1, x2, y1, y2;
int nbox;
- pixman_box16_t * pbox;
+ box_type_t * pbox;
good(region);
region->extents.x1 = x1 = region->extents.x1 + x;
@@ -2055,7 +2047,7 @@ PREFIX(pixman_region_translate) (pixman_region16_t * region, int x, int y)
region->extents.y2 = SHRT_MAX;
if (region->data && (nbox = region->data->numRects))
{
- pixman_box16_t * pboxout;
+ box_type_t * pboxout;
for (pboxout = pbox = PIXREGION_BOXPTR(region); nbox--; pbox++)
{
@@ -2123,7 +2115,7 @@ pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
*/
void
-PREFIX(pixman_region_reset) (pixman_region16_t *region, pixman_box16_t *box)
+PREFIX(pixman_region_reset) (pixman_region16_t *region, box_type_t *box)
{
good(region);
assert(box->x1<=box->x2);
@@ -2137,9 +2129,9 @@ PREFIX(pixman_region_reset) (pixman_region16_t *region, pixman_box16_t *box)
int
PREFIX(pixman_region_contains_point) (pixman_region16_t * region,
int x, int y,
- pixman_box16_t * box)
+ box_type_t * box)
{
- pixman_box16_t *pbox, *pboxEnd;
+ box_type_t *pbox, *pboxEnd;
int numRects;
good(region);
@@ -2193,7 +2185,7 @@ PREFIX(pixman_region_empty) (pixman_region16_t * region)
region->data = pixman_region_emptyData;
}
-pixman_box16_t *
+box_type_t *
PREFIX(pixman_region_extents) (pixman_region16_t * region)
{
good(region);
@@ -2376,9 +2368,9 @@ pixman_region16_clip_spans(
else if ((numRects = prgnDst->data->numRects))
{
/* Have to clip against many boxes */
- pixman_box16_t *pboxBandStart, *pboxBandEnd;
- pixman_box16_t *pbox;
- pixman_box16_t *pboxLast;
+ box_type_t *pboxBandStart, *pboxBandEnd;
+ box_type_t *pbox;
+ box_type_t *pboxLast;
int clipy1, clipy2;
/* In this case, taking advantage of sorted spans gains more than
@@ -2440,7 +2432,7 @@ static int
pixman_region16_find_max_band(pixman_region16_t * prgn)
{
int nbox;
- pixman_box16_t * pbox;
+ box_type_t * pbox;
int nThisBand;
int nMaxBand = 0;
short yThisBand;
@@ -2485,8 +2477,8 @@ PREFIX(pixman_region_selfcheck) (reg)
return (!reg->data);
else
{
- pixman_box16_t * pboxP, * pboxN;
- pixman_box16_t box;
+ box_type_t * pboxP, * pboxN;
+ box_type_t box;
pboxP = PIXREGION_RECTS(reg);
box = *pboxP;
@@ -2515,7 +2507,7 @@ PREFIX(pixman_region_selfcheck) (reg)
pixman_bool_t
PREFIX(pixman_region_init_rects) (pixman_region16_t *region,
- pixman_box16_t *boxes, int count)
+ box_type_t *boxes, int count)
{
int overlap;
@@ -2544,7 +2536,7 @@ PREFIX(pixman_region_init_rects) (pixman_region16_t *region,
return FALSE;
/* Copy in the rects */
- memcpy (PIXREGION_RECTS(region), boxes, sizeof(pixman_box16_t) * count);
+ memcpy (PIXREGION_RECTS(region), boxes, sizeof(box_type_t) * count);
region->data->numRects = count;
/* Validate */
diff --git a/pixman/pixman-region16.c b/pixman/pixman-region16.c
index 2dedc53..b897e1f 100644
--- a/pixman/pixman-region16.c
+++ b/pixman/pixman-region16.c
@@ -22,6 +22,13 @@
*
* Author: Soren Sandmann <sandmann at redhat.com>
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "pixman-private.h"
+
+typedef pixman_box16_t box_type_t;
#define PREFIX(x) x
commit 68ccaa06751e76b9d9c70a7c0b8e9b22cf7d6f62
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:07:30 2008 -0400
Add pixman-region16.c; compile that instead of pixman-region.c
diff --git a/pixman/Makefile.am b/pixman/Makefile.am
index 176189b..425ba8c 100644
--- a/pixman/Makefile.am
+++ b/pixman/Makefile.am
@@ -5,7 +5,7 @@ libpixman_1_la_SOURCES = \
pixman.h \
pixman-access.c \
pixman-access-accessors.c \
- pixman-region.c \
+ pixman-region16.c \
pixman-private.h \
pixman-image.c \
pixman-combine32.c \
diff --git a/pixman/pixman-region16.c b/pixman/pixman-region16.c
new file mode 100644
index 0000000..2dedc53
--- /dev/null
+++ b/pixman/pixman-region16.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Soren Sandmann <sandmann at redhat.com>
+ */
+
+#define PREFIX(x) x
+
+#include "pixman-region.c"
commit 149477457c9463e22350c15ccfca5ddf8a78e7af
Author: Søren Sandmann <sandmann at redhat.com>
Date: Sun Jun 8 19:05:43 2008 -0400
macroize pixman-region.c
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 496ce77..7d6d8a2 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -82,7 +82,9 @@ typedef struct pixman_region16_point {
#define assert(expr)
#endif
-#define good(reg) assert(pixman_region_selfcheck(reg))
+#define PREFIX(x) x
+
+#define good(reg) assert(PREFIX(pixman_region_selfcheck) (reg))
#undef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -106,7 +108,7 @@ static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_p
* work.
*/
void
-pixman_region_set_static_pointers (pixman_box16_t *empty_box,
+PREFIX(pixman_region_set_static_pointers) (pixman_box16_t *empty_box,
pixman_region16_data_t *empty_data,
pixman_region16_data_t *broken_data)
{
@@ -259,7 +261,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
}
pixman_bool_t
-pixman_region_equal(reg1, reg2)
+PREFIX(pixman_region_equal) (reg1, reg2)
pixman_region16_t * reg1;
pixman_region16_t * reg2;
{
@@ -285,7 +287,7 @@ pixman_region_equal(reg1, reg2)
}
int
-pixman_region16_print(rgn)
+PREFIX(pixman_region16_print) (rgn)
pixman_region16_t * rgn;
{
int num, size;
@@ -307,14 +309,14 @@ pixman_region16_print(rgn)
void
-pixman_region_init (pixman_region16_t *region)
+PREFIX(pixman_region_init) (pixman_region16_t *region)
{
region->extents = *pixman_region_emptyBox;
region->data = pixman_region_emptyData;
}
void
-pixman_region_init_rect (pixman_region16_t *region,
+PREFIX(pixman_region_init_rect) (pixman_region16_t *region,
int x, int y, unsigned int width, unsigned int height)
{
region->extents.x1 = x;
@@ -325,34 +327,34 @@ pixman_region_init_rect (pixman_region16_t *region,
}
void
-pixman_region_init_with_extents (pixman_region16_t *region, pixman_box16_t *extents)
+PREFIX(pixman_region_init_with_extents) (pixman_region16_t *region, pixman_box16_t *extents)
{
region->extents = *extents;
region->data = NULL;
}
void
-pixman_region_fini (pixman_region16_t *region)
+PREFIX(pixman_region_fini) (pixman_region16_t *region)
{
good (region);
freeData (region);
}
int
-pixman_region_n_rects (pixman_region16_t *region)
+PREFIX(pixman_region_n_rects) (pixman_region16_t *region)
{
return PIXREGION_NUM_RECTS (region);
}
pixman_box16_t *
-pixman_region_rects (pixman_region16_t *region)
+PREFIX(pixman_region_rects) (pixman_region16_t *region)
{
return PIXREGION_RECTS (region);
}
pixman_box16_t *
-pixman_region_rectangles (pixman_region16_t *region,
- int *n_rects)
+PREFIX(pixman_region_rectangles) (pixman_region16_t *region,
+ int *n_rects)
{
if (n_rects)
*n_rects = PIXREGION_NUM_RECTS (region);
@@ -414,7 +416,7 @@ pixman_rect_alloc (pixman_region16_t * region, int n)
}
pixman_bool_t
-pixman_region_copy (pixman_region16_t *dst, pixman_region16_t *src)
+PREFIX(pixman_region_copy) (pixman_region16_t *dst, pixman_region16_t *src)
{
good(dst);
good(src);
@@ -978,7 +980,7 @@ pixman_region_intersectO (pixman_region16_t *region,
}
pixman_bool_t
-pixman_region_intersect (pixman_region16_t * newReg,
+PREFIX(pixman_region_intersect) (pixman_region16_t * newReg,
pixman_region16_t * reg1,
pixman_region16_t * reg2)
{
@@ -1013,15 +1015,15 @@ pixman_region_intersect (pixman_region16_t * newReg,
}
else if (!reg2->data && SUBSUMES(®2->extents, ®1->extents))
{
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(pixman_region_copy) (newReg, reg1);
}
else if (!reg1->data && SUBSUMES(®1->extents, ®2->extents))
{
- return pixman_region_copy(newReg, reg2);
+ return PREFIX(pixman_region_copy) (newReg, reg2);
}
else if (reg1 == reg2)
{
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(pixman_region_copy) (newReg, reg1);
}
else
{
@@ -1135,7 +1137,7 @@ pixman_region_unionO (
* single rectangle
*/
pixman_bool_t
-pixman_region_union_rect (pixman_region16_t *dest,
+PREFIX(pixman_region_union_rect) (pixman_region16_t *dest,
pixman_region16_t *source,
int x, int y,
unsigned int width, unsigned int height)
@@ -1143,18 +1145,18 @@ pixman_region_union_rect (pixman_region16_t *dest,
pixman_region16_t region;
if (!width || !height)
- return pixman_region_copy (dest, source);
+ return PREFIX(pixman_region_copy) (dest, source);
region.data = NULL;
region.extents.x1 = x;
region.extents.y1 = y;
region.extents.x2 = x + width;
region.extents.y2 = y + height;
- return pixman_region_union (dest, source, ®ion);
+ return PREFIX(pixman_region_union) (dest, source, ®ion);
}
pixman_bool_t
-pixman_region_union (pixman_region16_t *newReg,
+PREFIX(pixman_region_union) (pixman_region16_t *newReg,
pixman_region16_t *reg1,
pixman_region16_t *reg2)
{
@@ -1173,7 +1175,7 @@ pixman_region_union (pixman_region16_t *newReg,
*/
if (reg1 == reg2)
{
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(pixman_region_copy) (newReg, reg1);
}
/*
@@ -1184,7 +1186,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (PIXREGION_NAR(reg1))
return pixman_break (newReg);
if (newReg != reg2)
- return pixman_region_copy(newReg, reg2);
+ return PREFIX(pixman_region_copy) (newReg, reg2);
return TRUE;
}
@@ -1196,7 +1198,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (PIXREGION_NAR(reg2))
return pixman_break (newReg);
if (newReg != reg1)
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(pixman_region_copy) (newReg, reg1);
return TRUE;
}
@@ -1206,7 +1208,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (!reg1->data && SUBSUMES(®1->extents, ®2->extents))
{
if (newReg != reg1)
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(pixman_region_copy) (newReg, reg1);
return TRUE;
}
@@ -1216,7 +1218,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (!reg2->data && SUBSUMES(®2->extents, ®1->extents))
{
if (newReg != reg2)
- return pixman_region_copy(newReg, reg2);
+ return PREFIX(pixman_region_copy) (newReg, reg2);
return TRUE;
}
@@ -1254,7 +1256,7 @@ pixman_region_union (pixman_region16_t *newReg,
*
*/
pixman_bool_t
-pixman_region_append (pixman_region16_t * dstrgn,
+PREFIX(pixman_region_append) (pixman_region16_t * dstrgn,
pixman_region16_t * rgn)
{
int numRects, dnumRects, size;
@@ -1439,7 +1441,7 @@ QuickSortRects(
*/
pixman_bool_t
-pixman_region_validate(pixman_region16_t * badreg,
+PREFIX(pixman_region_validate) (pixman_region16_t * badreg,
int *pOverlap)
{
/* Descriptor for regions under construction in Step 2. */
@@ -1782,7 +1784,7 @@ pixman_region_subtractO (
*-----------------------------------------------------------------------
*/
pixman_bool_t
-pixman_region_subtract(pixman_region16_t * regD,
+PREFIX(pixman_region_subtract) (pixman_region16_t * regD,
pixman_region16_t * regM,
pixman_region16_t * regS)
{
@@ -1797,7 +1799,7 @@ pixman_region_subtract(pixman_region16_t * regD,
{
if (PIXREGION_NAR (regS))
return pixman_break (regD);
- return pixman_region_copy(regD, regM);
+ return PREFIX(pixman_region_copy) (regD, regM);
}
else if (regM == regS)
{
@@ -1846,7 +1848,7 @@ pixman_region_subtract(pixman_region16_t * regD,
*-----------------------------------------------------------------------
*/
pixman_bool_t
-pixman_region_inverse(pixman_region16_t * newReg, /* Destination region */
+PREFIX(pixman_region_inverse) (pixman_region16_t * newReg, /* Destination region */
pixman_region16_t * reg1, /* Region to invert */
pixman_box16_t * invRect) /* Bounding box for inversion */
{
@@ -1905,7 +1907,7 @@ pixman_region_inverse(pixman_region16_t * newReg, /* Destination region
*/
pixman_region_overlap_t
-pixman_region_contains_rectangle(pixman_region16_t * region,
+PREFIX(pixman_region_contains_rectangle) (pixman_region16_t * region,
pixman_box16_t * prect)
{
int x;
@@ -2005,12 +2007,12 @@ pixman_region_contains_rectangle(pixman_region16_t * region,
}
}
-/* pixman_region_translate (region, x, y)
+/* PREFIX(pixman_region_translate) (region, x, y)
translates in place
*/
void
-pixman_region_translate (pixman_region16_t * region, int x, int y)
+PREFIX(pixman_region_translate) (pixman_region16_t * region, int x, int y)
{
int x1, x2, y1, y2;
int nbox;
@@ -2121,7 +2123,7 @@ pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
*/
void
-pixman_region_reset(pixman_region16_t *region, pixman_box16_t *box)
+PREFIX(pixman_region_reset) (pixman_region16_t *region, pixman_box16_t *box)
{
good(region);
assert(box->x1<=box->x2);
@@ -2133,7 +2135,7 @@ pixman_region_reset(pixman_region16_t *region, pixman_box16_t *box)
/* box is "return" value */
int
-pixman_region_contains_point(pixman_region16_t * region,
+PREFIX(pixman_region_contains_point) (pixman_region16_t * region,
int x, int y,
pixman_box16_t * box)
{
@@ -2166,7 +2168,7 @@ pixman_region_contains_point(pixman_region16_t * region,
}
int
-pixman_region_not_empty(pixman_region16_t * region)
+PREFIX(pixman_region_not_empty) (pixman_region16_t * region)
{
good(region);
return(!PIXREGION_NIL(region));
@@ -2182,7 +2184,7 @@ pixman_region16_broken(pixman_region16_t * region)
*/
void
-pixman_region_empty(pixman_region16_t * region)
+PREFIX(pixman_region_empty) (pixman_region16_t * region)
{
good(region);
freeData(region);
@@ -2192,7 +2194,7 @@ pixman_region_empty(pixman_region16_t * region)
}
pixman_box16_t *
-pixman_region_extents(pixman_region16_t * region)
+PREFIX(pixman_region_extents) (pixman_region16_t * region)
{
good(region);
return(®ion->extents);
@@ -2466,7 +2468,7 @@ pixman_region16_find_max_band(pixman_region16_t * prgn)
pixman_bool_t
-pixman_region_selfcheck (reg)
+PREFIX(pixman_region_selfcheck) (reg)
pixman_region16_t * reg;
{
int i, numRects;
@@ -2512,7 +2514,7 @@ pixman_region_selfcheck (reg)
}
pixman_bool_t
-pixman_region_init_rects (pixman_region16_t *region,
+PREFIX(pixman_region_init_rects) (pixman_region16_t *region,
pixman_box16_t *boxes, int count)
{
int overlap;
@@ -2520,7 +2522,7 @@ pixman_region_init_rects (pixman_region16_t *region,
/* if it's 1, then we just want to set the extents, so call
* the existing method. */
if (count == 1) {
- pixman_region_init_rect(region,
+ PREFIX(pixman_region_init_rect) (region,
boxes[0].x1,
boxes[0].y1,
boxes[0].x2 - boxes[0].x1,
@@ -2528,7 +2530,7 @@ pixman_region_init_rects (pixman_region16_t *region,
return TRUE;
}
- pixman_region_init(region);
+ PREFIX(pixman_region_init) (region);
/* if it's 0, don't call pixman_rect_alloc -- 0 rectangles is
* a special case, and causing pixman_rect_alloc would cause
@@ -2547,5 +2549,5 @@ pixman_region_init_rects (pixman_region16_t *region,
/* Validate */
region->extents.x1 = region->extents.x2 = 0;
- return pixman_region_validate (region, &overlap);
+ return PREFIX(pixman_region_validate) (region, &overlap);
}
More information about the xorg-commit
mailing list