pixman: Branch 'master' - 2 commits
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Thu Jun 26 22:25:13 PDT 2008
pixman/pixman-private.h | 3 +
pixman/pixman-region.c | 129 ++---------------------------------------------
pixman/pixman-region16.c | 8 ++
3 files changed, 19 insertions(+), 121 deletions(-)
New commits:
commit 3c43b869f3821495978c61b9195f0b0e9e9e1245
Author: Søren Sandmann <sandmann at redhat.com>
Date: Fri Jun 27 01:11:30 2008 -0400
Unexport or delete various functions
- Delete pixman_region_append()
- Delete pixman_region_empty()
- Make pixman_region_validate() static and don't export it.
Reported by Julien Cristau.
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index 40094ae..559454a 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -1219,109 +1219,6 @@ PREFIX(_union) (region_type_t *newReg,
* Batch Rectangle Union
*====================================================================*/
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_append --
- *
- * "Append" the rgn rectangles onto the end of dstrgn, maintaining
- * knowledge of YX-banding when it's easy. Otherwise, dstrgn just
- * becomes a non-y-x-banded random collection of rectangles, and not
- * yet a true region. After a sequence of appends, the caller must
- * call pixman_region_validate to ensure that a valid region is
- * constructed.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * dstrgn is modified if rgn has rectangles.
- *
- */
-PIXMAN_EXPORT pixman_bool_t
-PREFIX(_append) (region_type_t * dstrgn,
- region_type_t * rgn)
-{
- int numRects, dnumRects, size;
- box_type_t *new, *old;
- int prepend;
-
- if (PIXREGION_NAR(rgn))
- return pixman_break (dstrgn);
-
- if (!rgn->data && (dstrgn->data == pixman_region_emptyData))
- {
- dstrgn->extents = rgn->extents;
- dstrgn->data = (region_data_type_t *)NULL;
- return TRUE;
- }
-
- numRects = PIXREGION_NUM_RECTS(rgn);
- if (!numRects)
- return TRUE;
- prepend = FALSE;
- size = numRects;
- dnumRects = PIXREGION_NUM_RECTS(dstrgn);
- if (!dnumRects && (size < 200))
- size = 200; /* XXX pick numbers out of a hat */
- RECTALLOC(dstrgn, size);
- old = PIXREGION_RECTS(rgn);
- if (!dnumRects)
- dstrgn->extents = rgn->extents;
- else if (dstrgn->extents.x2 > dstrgn->extents.x1)
- {
- box_type_t *first, *last;
-
- first = old;
- last = PIXREGION_BOXPTR(dstrgn) + (dnumRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y2 = rgn->extents.y2;
- }
- else
- {
- first = PIXREGION_BOXPTR(dstrgn);
- last = old + (numRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- prepend = TRUE;
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y1 = rgn->extents.y1;
- }
- else
- dstrgn->extents.x2 = dstrgn->extents.x1;
- }
- }
- if (prepend)
- {
- new = PIXREGION_BOX(dstrgn, numRects);
- if (dnumRects == 1)
- *new = *PIXREGION_BOXPTR(dstrgn);
- else
- memmove((char *)new,(char *)PIXREGION_BOXPTR(dstrgn),
- dnumRects * sizeof(box_type_t));
- new = PIXREGION_BOXPTR(dstrgn);
- }
- else
- new = PIXREGION_BOXPTR(dstrgn) + dnumRects;
- if (numRects == 1)
- *new = *old;
- else
- memmove((char *)new, (char *)old, numRects * sizeof(box_type_t));
- dstrgn->data->numRects += numRects;
- return TRUE;
-}
-
#define ExchangeRects(a, b) \
{ \
box_type_t t; \
@@ -1422,9 +1319,9 @@ QuickSortRects(
*-----------------------------------------------------------------------
*/
-PIXMAN_EXPORT pixman_bool_t
-PREFIX(_validate) (region_type_t * badreg,
- int *pOverlap)
+static pixman_bool_t
+validate (region_type_t * badreg,
+ int *pOverlap)
{
/* Descriptor for regions under construction in Step 2. */
typedef struct {
@@ -2127,16 +2024,6 @@ PREFIX(_not_empty) (region_type_t * region)
return(!PIXREGION_NIL(region));
}
-PIXMAN_EXPORT void
-PREFIX(_empty) (region_type_t * region)
-{
- good(region);
- freeData(region);
- region->extents.x2 = region->extents.x1;
- region->extents.y2 = region->extents.y1;
- region->data = pixman_region_emptyData;
-}
-
PIXMAN_EXPORT box_type_t *
PREFIX(_extents) (region_type_t * region)
{
@@ -2233,5 +2120,5 @@ PREFIX(_init_rects) (region_type_t *region,
/* Validate */
region->extents.x1 = region->extents.x2 = 0;
- return PREFIX(_validate) (region, &overlap);
+ return validate (region, &overlap);
}
commit 36b05f2cac7fa28e31131ca0d6b8b133ccd95ab8
Author: Søren Sandmann <sandmann at redhat.com>
Date: Fri Jun 27 01:05:30 2008 -0400
Only export the 16 bit version of pixman_region_set_static_pointers()
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 3bbf641..a27d2a8 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -738,6 +738,9 @@ pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
pixman_region16_t *src);
pixman_bool_t pixman_region16_copy_from_region32 (pixman_region16_t *dst,
pixman_region32_t *src);
+void pixman_region_internal_set_static_pointers (pixman_box16_t *empty_box,
+ pixman_region16_data_t *empty_data,
+ pixman_region16_data_t *broken_data);
#ifdef PIXMAN_TIMING
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index be419ff..40094ae 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -95,10 +95,10 @@ static region_data_type_t *pixman_brokendata = (region_data_type_t *)&PREFIX(_br
* the addresses of those structs which makes the existing code continue to
* work.
*/
-PIXMAN_EXPORT void
-PREFIX(_set_static_pointers) (box_type_t *empty_box,
- region_data_type_t *empty_data,
- region_data_type_t *broken_data)
+void
+PREFIX(_internal_set_static_pointers) (box_type_t *empty_box,
+ region_data_type_t *empty_data,
+ region_data_type_t *broken_data)
{
pixman_region_emptyBox = empty_box;
pixman_region_emptyData = empty_data;
diff --git a/pixman/pixman-region16.c b/pixman/pixman-region16.c
index e0dc008..acee094 100644
--- a/pixman/pixman-region16.c
+++ b/pixman/pixman-region16.c
@@ -42,6 +42,14 @@ typedef struct {
#define PREFIX(x) pixman_region##x
+PIXMAN_EXPORT void
+pixman_region_set_static_pointers (pixman_box16_t *empty_box,
+ pixman_region16_data_t *empty_data,
+ pixman_region16_data_t *broken_data)
+{
+ pixman_region_internal_set_static_pointers (empty_box, empty_data, broken_data);
+}
+
pixman_bool_t
pixman_region16_copy_from_region32 (pixman_region16_t *dst,
pixman_region32_t *src)
More information about the xorg-commit
mailing list