summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2010-08-16 04:32:21 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-03-24 17:34:28 -0400
commit5c1608b94b06c38ad854041b280cf731bc987623 (patch)
tree14e7cc400546ec0b014d3287b0b1ca1661a57ac8
parente2c6ae795d22f238b8f4697164a7ec112d7b07bc (diff)
Get rid of bits->free_me.
Instead, just allocate a bit in the common bit fields. This saves another 4 bytes.
-rw-r--r--pixman/pixman-bits-image.c2
-rw-r--r--pixman/pixman-image.c4
-rw-r--r--pixman/pixman-private.h8
-rw-r--r--test/stress-test.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 208a3e9f..a08045e1 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -1468,7 +1468,7 @@ _pixman_bits_image_init (pixman_image_t * image,
image->bits.width = width;
image->bits.height = height;
image->bits.bits = bits;
- image->bits.free_me = free_me;
+ image->common.free_bits = free_bits;
/* The rowstride is stored in number of uint32_t */
image->bits.rowstride = rowstride_bytes / (int) sizeof (uint32_t);
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index c135f194..22e003b6 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -167,8 +167,8 @@ _pixman_image_fini (pixman_image_t *image)
image->common.property_changed == gradient_property_changed);
}
- if (image->type == BITS && image->bits.free_me)
- free (image->bits.free_me);
+ if (image->type == BITS && image->common.free_bits)
+ free (image->bits.bits);
if (common->uncommon)
{
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index 8108271b..6e9732cf 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -115,15 +115,16 @@ struct image_common
ENUM (pixman_filter_t) filter : 3;
unsigned int dirty : 1;
-
+ unsigned int free_bits : 1;
+
int32_t ref_count;
pixman_region32_t clip_region;
pixman_transform_t * transform;
- property_changed_func_t property_changed;
-
pixman_image_destroy_func_t destroy_func;
void * destroy_data;
+ property_changed_func_t property_changed;
+
uint32_t flags;
pixman_format_code_t extended_format_code;
@@ -187,7 +188,6 @@ struct bits_image
int width;
int height;
uint32_t * bits;
- uint32_t * free_me;
int rowstride; /* in number of uint32_t's */
fetch_scanline_t get_scanline_32;
diff --git a/test/stress-test.c b/test/stress-test.c
index 3174621e..c89590e4 100644
--- a/test/stress-test.c
+++ b/test/stress-test.c
@@ -102,7 +102,7 @@ get_size (void)
static void
destroy (pixman_image_t *image, void *data)
{
- if (image->type == BITS && image->bits.free_me != image->bits.bits)
+ if (image->type == BITS && !image->common.free_bits)
{
uint32_t *bits;