From 195100527f6c678bf9848dc6c2a08658ed39a17d Mon Sep 17 00:00:00 2001 From: Soren Sandmann Pedersen Date: Tue, 15 May 2007 16:40:40 -0400 Subject: [PATCH] Various formatting fixes Rename pixman_image_composite() to pixman_image_composite_rect() --- pixman/pixman-image.c | 38 +++++++++++++++++++++----------------- pixman/pixman.h | 6 +++--- test/composite-test.c | 4 ++-- test/gradient-test.c | 4 ++-- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 2031243..2ae0655 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -77,7 +77,7 @@ static pixman_image_t * allocate_image (void) { pixman_image_t *image = malloc (sizeof (pixman_image_t)); - + if (image) { image_common_t *common = &image->common; @@ -108,12 +108,12 @@ pixman_image_ref (pixman_image_t *image) void pixman_image_unref (pixman_image_t *image) { - image->common.ref_count--; + image_common_t *common = (image_common_t *)image; - if (image->common.ref_count == 0) - { - image_common_t *common = (image_common_t *)image; + common->ref_count--; + if (common->ref_count == 0) + { pixman_region_fini (&common->clip_region); if (common->transform) @@ -125,6 +125,10 @@ pixman_image_unref (pixman_image_t *image) if (common->alpha_map) pixman_image_unref ((pixman_image_t *)common->alpha_map); +#if 0 + memset (image, 0xaa, sizeof (pixman_image_t)); +#endif + free (image); } } @@ -390,18 +394,18 @@ pixman_image_set_component_alpha (pixman_image_t *image, #define SCANLINE_BUFFER_LENGTH 2048 void -pixman_image_composite (pixman_op_t op, - pixman_image_t *src_img, - pixman_image_t *mask_img, - pixman_image_t *dest_img, - int src_x, - int src_y, - int mask_x, - int mask_y, - int dest_x, - int dest_y, - int width, - int height) +pixman_image_composite_rect (pixman_op_t op, + pixman_image_t *src_img, + pixman_image_t *mask_img, + pixman_image_t *dest_img, + int src_x, + int src_y, + int mask_x, + int mask_y, + int dest_x, + int dest_y, + int width, + int height) { FbComposeData compose_data; uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3]; diff --git a/pixman/pixman.h b/pixman/pixman.h index 42dc675..ccbd31c 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -104,7 +104,7 @@ typedef uint32_t pixman_fixed_1_16_t; typedef int32_t pixman_fixed_16_16_t; typedef pixman_fixed_16_16_t pixman_fixed_t; -#define pixman_fixed_e ((pixman_fixed) 1) +#define pixman_fixed_e ((pixman_fixed_t) 1) #define pixman_fixed_1 (pixman_int_to_fixed(1)) #define pixman_fixed_1_minus_e (pixman_fixed_1 - pixman_fixed_e) #define pixman_fixed_to_int(f) ((int) ((f) >> 16)) @@ -298,7 +298,7 @@ typedef struct pixman_gradient_stop pixman_gradient_stop_t; struct pixman_gradient_stop { pixman_fixed_t x; - pixman_color_t color; + pixman_color_t color; }; #define PIXMAN_MAX_INDEXED 256 /* XXX depth must be <= 8 */ @@ -449,7 +449,7 @@ void pixman_image_set_component_alpha (pixman_image_t /* Composite */ -void pixman_image_composite (pixman_op_t op, +void pixman_image_composite_rect (pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, pixman_image_t *dest, diff --git a/test/composite-test.c b/test/composite-test.c index bc09943..d96213a 100644 --- a/test/composite-test.c +++ b/test/composite-test.c @@ -89,8 +89,8 @@ main (int argc, char **argv) dest, 10 * 4); - pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img, - 0, 0, 0, 0, 0, 0, 10, 10); + pixman_image_composite_rect (PIXMAN_OP_OVER, src_img, NULL, dest_img, + 0, 0, 0, 0, 0, 0, 10, 10); for (i = 0; i < 10; ++i) { diff --git a/test/gradient-test.c b/test/gradient-test.c index 5317bfa..4d1bd8c 100644 --- a/test/gradient-test.c +++ b/test/gradient-test.c @@ -129,8 +129,8 @@ main (int argc, char **argv) #endif pixman_image_set_transform (src_img, &trans); - pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img, - 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT); + pixman_image_composite_rect (PIXMAN_OP_OVER, src_img, NULL, dest_img, + 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT); printf ("0, 0: %x\n", dest[0]); printf ("10, 10: %x\n", dest[10 * 10 + 10]); -- 2.7.4