diff options
author | marha <marha@users.sourceforge.net> | 2010-10-11 19:26:38 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-10-11 19:26:38 +0000 |
commit | 4d66284976afa1ededd651407c5b3e6bf1a26cec (patch) | |
tree | 90148881f236e03da912410ad318f8cf36c009f1 /pixman/test/alphamap.c | |
parent | 9b0d01a832e5ee7fc7f097c4ff8b0945fb0643f1 (diff) | |
parent | db79aa18ff5d8102d50bcf149e9a331bda3636ab (diff) | |
download | vcxsrv-4d66284976afa1ededd651407c5b3e6bf1a26cec.tar.gz vcxsrv-4d66284976afa1ededd651407c5b3e6bf1a26cec.tar.bz2 vcxsrv-4d66284976afa1ededd651407c5b3e6bf1a26cec.zip |
svn merge ^/branches/released .
Diffstat (limited to 'pixman/test/alphamap.c')
-rw-r--r-- | pixman/test/alphamap.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pixman/test/alphamap.c b/pixman/test/alphamap.c index eb7a330f9..6d150cf69 100644 --- a/pixman/test/alphamap.c +++ b/pixman/test/alphamap.c @@ -45,15 +45,29 @@ format_name (pixman_format_code_t format) return "<unknown - bug in alphamap.c>";
}
+static void
+on_destroy (pixman_image_t *image, void *data)
+{
+ uint32_t *bits = pixman_image_get_data (image);
+
+ fence_free (bits);
+}
+
static pixman_image_t *
make_image (pixman_format_code_t format)
{
uint32_t *bits;
uint8_t bpp = PIXMAN_FORMAT_BPP (format) / 8;
+ pixman_image_t *image;
bits = (uint32_t *)make_random_bytes (WIDTH * HEIGHT * bpp);
- return pixman_image_create_bits (format, WIDTH, HEIGHT, bits, WIDTH * bpp);
+ image = pixman_image_create_bits (format, WIDTH, HEIGHT, bits, WIDTH * bpp);
+
+ if (image && bits)
+ pixman_image_set_destroy_function (image, on_destroy, NULL);
+
+ return image;
}
static pixman_image_t *
|