pixman: Branch 'master'
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Thu Jun 14 10:02:17 PDT 2007
pixman/pixman-image.c | 25 ++++++++++++++++++++-----
pixman/pixman-trap.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 5 deletions(-)
New commits:
diff-tree 596bd530205e9835ede0bc8816c9b2dfff75e921 (from e8dfb54ccea26b7e7948ca9806c97194892f0791)
Author: Søren Sandmann <sandmann at redhat.com>
Date: Thu Jun 14 12:59:15 2007 -0400
Reset clip regions correctly when NULL is passed
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 8483068..1eee840 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -283,6 +283,23 @@ create_bits (pixman_format_code_t format
return calloc (buf_size, 1);
}
+static void
+reset_clip_region (pixman_image_t *image)
+{
+ pixman_region_fini (&image->common.clip_region);
+
+ if (image->type == BITS)
+ {
+ pixman_region_init_rect (&image->common.clip_region, 0, 0,
+ image->bits.width, image->bits.height);
+
+ }
+ else
+ {
+ pixman_region_init (&image->common.clip_region);
+ }
+}
+
pixman_image_t *
pixman_image_create_bits (pixman_format_code_t format,
int width,
@@ -319,8 +336,7 @@ pixman_image_create_bits (pixman_format_
*/
image->bits.indexed = NULL;
- pixman_region_fini (&image->common.clip_region);
- pixman_region_init_rect (&image->common.clip_region, 0, 0, width, height);
+ reset_clip_region (image);
return image;
}
@@ -337,9 +353,8 @@ pixman_image_set_clip_region (pixman_ima
}
else
{
- pixman_region_fini (&common->clip_region);
- pixman_region_init (&common->clip_region);
-
+ reset_clip_region (image);
+
return TRUE;
}
}
diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c
index 31f08d8..204ca04 100644
--- a/pixman/pixman-trap.c
+++ b/pixman/pixman-trap.c
@@ -86,6 +86,36 @@ pixman_add_traps (pixman_image_t * image
fbFinishAccess (pPicture->pDrawable);
}
+static void
+dump_image (pixman_image_t *image,
+ const char *title)
+{
+ int i, j;
+
+ if (!image->type == BITS)
+ {
+ printf ("%s is not a regular image\n", title);
+ }
+
+ if (!image->bits.format == PIXMAN_a8)
+ {
+ printf ("%s is not an alpha mask\n", title);
+ }
+
+ printf ("\n\n\n%s: \n", title);
+
+ for (i = 0; i < image->bits.height; ++i)
+ {
+ uint8_t *line =
+ (uint8_t *)&(image->bits.bits[i * image->bits.rowstride]);
+
+ for (j = 0; j < image->bits.width; ++j)
+ printf ("%c", line[j]? '#' : ' ');
+
+ printf ("\n");
+ }
+}
+
void
pixman_add_trapezoids (pixman_image_t *image,
int16_t x_off,
@@ -95,6 +125,10 @@ pixman_add_trapezoids (pixman_imag
{
int i;
+#if 0
+ dump_image (image, "before");
+#endif
+
for (i = 0; i < ntraps; ++i)
{
const pixman_trapezoid_t *trap = &(traps[i]);
@@ -104,6 +138,10 @@ pixman_add_trapezoids (pixman_imag
pixman_rasterize_trapezoid (image, trap, x_off, y_off);
}
+
+#if 0
+ dump_image (image, "after");
+#endif
}
void
More information about the xorg-commit
mailing list