configure.ac | 4 - pixman/pixman-compose.c | 155 ++++++++++++++++++++++------------------------- pixman/pixman-edge-imp.h | 4 - pixman/pixman-edge.c | 2 pixman/pixman-image.c | 32 +++++---- pixman/pixman-private.h | 2 pixman/pixman-region.c | 5 + pixman/pixman.h | 64 ++++++++++++++----- test/composite-test.c | 5 - 9 files changed, 154 insertions(+), 119 deletions(-)
New commits: commit 8ff7213f39edc1b2b8b60d6b0cc5d5f14ca1928d Author: Vladimir Vukicevic <[EMAIL PROTECTED]> Date: Sat Aug 25 23:30:41 2007 -0700 rasterize traps that extend outside of the image bounds correctly Traps that extend outside of the image bounds are rasterized incorrectly currently; the problem is a signed vs. unsigned comparison that got introduced when a width parameter went from int -> uint. This patch puts it back to int (since it's stored as an int in the bits structure to begin with), and also fixes a similar warning in the memset wrapper diff --git a/pixman/pixman-edge-imp.h b/pixman/pixman-edge-imp.h index 5655318..c242aa4 100644 --- a/pixman/pixman-edge-imp.h +++ b/pixman/pixman-edge-imp.h @@ -35,8 +35,8 @@ rasterizeEdges (pixman_image_t *image, pixman_fixed_t y = t; uint32_t *line; uint32_t *buf = (image)->bits.bits; - uint32_t stride = (image)->bits.rowstride; - uint32_t width = (image)->bits.width; + int32_t stride = (image)->bits.rowstride; + int32_t width = (image)->bits.width; line = buf + pixman_fixed_to_int (y) * stride; diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c index 191752f..24758c3 100644 --- a/pixman/pixman-edge.c +++ b/pixman/pixman-edge.c @@ -129,7 +129,7 @@ fbRasterizeEdges8 (pixman_image_t *image, int fill_size = 0; uint32_t *buf = (image)->bits.bits; int32_t stride = (image)->bits.rowstride; - uint32_t width = (image)->bits.width; + int32_t width = (image)->bits.width; line = buf + pixman_fixed_to_int (y) * stride; diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 89abf8f..775f7a7 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -630,7 +630,7 @@ union pixman_image do { \ size_t _i; \ uint8_t *_dst = (uint8_t*)(dst); \ - for(_i = 0; _i < size; _i++) { \ + for(_i = 0; _i < (size_t) size; _i++) { \ WRITE(_dst +_i, (val)); \ } \ } while (0) commit 028993aacb9ec48aa9d347d0d189250b464cf30f Author: Søren Sandmann <[EMAIL PROTECTED]> Date: Fri Aug 24 16:49:29 2007 -0400 Set accessors for the destination image in composite-test.c diff --git a/test/composite-test.c b/test/composite-test.c index cee9609..d6596f4 100644 --- a/test/composite-test.c +++ b/test/composite-test.c @@ -122,13 +122,14 @@ main (int argc, char **argv) src, WIDTH * 4); - pixman_image_set_accessors (src_img, reader, writer); - dest_img = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4); + pixman_image_set_accessors (src_img, reader, writer); + pixman_image_set_accessors (dest_img, reader, writer); + pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dest_img, 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT); commit 341be6a408e86d5b8976e63746e646ef973339bb Author: Søren Sandmann <[EMAIL PROTECTED]> Date: Fri Aug 24 16:30:10 2007 -0400 Add missing comma in enum diff --git a/pixman/pixman.h b/pixman/pixman.h index f445261..d76cc12 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -182,7 +182,7 @@ typedef enum typedef enum { - PIXMAN_OP_CLEAR = 0x00 + PIXMAN_OP_CLEAR = 0x00, PIXMAN_OP_SRC = 0x01, PIXMAN_OP_DST = 0x02, PIXMAN_OP_OVER = 0x03, commit fb667257ab8f5cf9c6af399ac394b8aa7826fd96 Author: Søren Sandmann <[EMAIL PROTECTED]> Date: Fri Aug 24 16:19:31 2007 -0400 Remove trailing comma in enum diff --git a/pixman/pixman.h b/pixman/pixman.h index e9d2077..f445261 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -221,7 +221,7 @@ typedef enum PIXMAN_OP_CONJOINT_OUT_REVERSE = 0x28, PIXMAN_OP_CONJOINT_ATOP = 0x29, PIXMAN_OP_CONJOINT_ATOP_REVERSE = 0x2a, - PIXMAN_OP_CONJOINT_XOR = 0x2b, + PIXMAN_OP_CONJOINT_XOR = 0x2b } pixman_op_t; /* commit c7dad7b9a038fbe94a2bdc67cc0a5f40f8a40d5c Author: Søren Sandmann <[EMAIL PROTECTED]> Date: Fri Aug 24 16:12:30 2007 -0400 Add conjoint and disjoint operators to pixman.h diff --git a/pixman/pixman.h b/pixman/pixman.h index 670f25a..e9d2077 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -182,20 +182,46 @@ typedef enum typedef enum { - PIXMAN_OP_CLEAR, - PIXMAN_OP_SRC, - PIXMAN_OP_DST, - PIXMAN_OP_OVER, - PIXMAN_OP_OVER_REVERSE, - PIXMAN_OP_IN, - PIXMAN_OP_IN_REVERSE, - PIXMAN_OP_OUT, - PIXMAN_OP_OUT_REVERSE, - PIXMAN_OP_ATOP, - PIXMAN_OP_ATOP_REVERSE, - PIXMAN_OP_XOR, - PIXMAN_OP_ADD, - PIXMAN_OP_SATURATE + PIXMAN_OP_CLEAR = 0x00 + PIXMAN_OP_SRC = 0x01, + PIXMAN_OP_DST = 0x02, + PIXMAN_OP_OVER = 0x03, + PIXMAN_OP_OVER_REVERSE = 0x04, + PIXMAN_OP_IN = 0x05, + PIXMAN_OP_IN_REVERSE = 0x06, + PIXMAN_OP_OUT = 0x07, + PIXMAN_OP_OUT_REVERSE = 0x08, + PIXMAN_OP_ATOP = 0x09, + PIXMAN_OP_ATOP_REVERSE = 0x0a, + PIXMAN_OP_XOR = 0x0b, + PIXMAN_OP_ADD = 0x0c, + PIXMAN_OP_SATURATE = 0x0d, + + PIXMAN_OP_DISJOINT_CLEAR = 0x10, + PIXMAN_OP_DISJOINT_SRC = 0x11, + PIXMAN_OP_DISJOINT_DST = 0x12, + PIXMAN_OP_DISJOINT_OVER = 0x13, + PIXMAN_OP_DISJOINT_OVER_REVERSE = 0x14, + PIXMAN_OP_DISJOINT_IN = 0x15, + PIXMAN_OP_DISJOINT_IN_REVERSE = 0x16, + PIXMAN_OP_DISJOINT_OUT = 0x17, + PIXMAN_OP_DISJOINT_OUT_REVERSE = 0x18, + PIXMAN_OP_DISJOINT_ATOP = 0x19, + PIXMAN_OP_DISJOINT_ATOP_REVERSE = 0x1a, + PIXMAN_OP_DISJOINT_XOR = 0x1b, + + PIXMAN_OP_CONJOINT_CLEAR = 0x20, + PIXMAN_OP_CONJOINT_SRC = 0x21, + PIXMAN_OP_CONJOINT_DST = 0x22, + PIXMAN_OP_CONJOINT_OVER = 0x23, + PIXMAN_OP_CONJOINT_OVER_REVERSE = 0x24, + PIXMAN_OP_CONJOINT_IN = 0x25, + PIXMAN_OP_CONJOINT_IN_REVERSE = 0x26, + PIXMAN_OP_CONJOINT_OUT = 0x27, + PIXMAN_OP_CONJOINT_OUT_REVERSE = 0x28, + PIXMAN_OP_CONJOINT_ATOP = 0x29, + PIXMAN_OP_CONJOINT_ATOP_REVERSE = 0x2a, + PIXMAN_OP_CONJOINT_XOR = 0x2b, } pixman_op_t; /* @@ -278,8 +304,10 @@ pixman_bool_t pixman_region_subtract (pixman_region16_t *regD, pixman_bool_t pixman_region_inverse (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_box16_t *invRect); -pixman_bool_t pixman_region_contains_point (pixman_region16_t *region, int x, int y, pixman_box16_t *box); -pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t, pixman_box16_t *prect); +pixman_bool_t pixman_region_contains_point (pixman_region16_t *region, + int x, int y, pixman_box16_t *box); +pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t, + pixman_box16_t *prect); pixman_bool_t pixman_region_not_empty (pixman_region16_t *region); pixman_box16_t * pixman_region_extents (pixman_region16_t *region); int pixman_region_n_rects (pixman_region16_t *region); @@ -288,7 +316,7 @@ pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region, pixman_bool_t pixman_region_equal (pixman_region16_t *region1, pixman_region16_t *region2); pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region); -void pixman_region_reset(pixman_region16_t *region, pixman_box16_t *box); +void pixman_region_reset (pixman_region16_t *region, pixman_box16_t *box); pixman_bool_t pixman_region_init_rects (pixman_region16_t *region, pixman_box16_t *boxes, int count); commit 25846ed93a87fcaefbfdb397343e986c8f53f997 Author: Søren Sandmann Pedersen <[EMAIL PROTECTED]> Date: Tue Aug 21 14:11:54 2007 -0400 Fix bug 12039, based on Chris Wilson's patch. diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c index ffd92d6..94b6dcc 100644 --- a/pixman/pixman-region.c +++ b/pixman/pixman-region.c @@ -1507,6 +1507,8 @@ pixman_region_validate(pixman_region16_t * badreg, box = PIXREGION_BOXPTR(&ri[0].reg); ri[0].reg.extents = *box; ri[0].reg.data->numRects = 1; + badreg->extents = *pixman_region_emptyBox; + badreg->data = pixman_region_emptyData; /* Now scatter rectangles into the minimum set of valid regions. If the next rectangle to be added to a region would force an existing rectangle @@ -1620,6 +1622,8 @@ NextRect: ; freeData(hreg); } numRI -= half; + if (!ret) + goto bail; } *badreg = ri[0].reg; free(ri); @@ -1629,6 +1633,7 @@ bail: for (i = 0; i < numRI; i++) freeData(&ri[i].reg); free (ri); + return pixman_break (badreg); } commit 9c09561a91debfd7c77a39b337b51b2ab16d6da9 Author: Eric Anholt <[EMAIL PROTECTED]> Date: Mon Aug 20 12:58:47 2007 -0700 Fix failure to set identity transform in pixman. While here, optimize out a free/malloc in the case where a transform existed previously and the new transform is non-identity. diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 2cbf88c..32ffaee 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -403,25 +403,17 @@ pixman_image_set_transform (pixman_image_t *image, if (memcmp (&id, transform, sizeof (pixman_transform_t)) == 0) { - transform = NULL; + free(common->transform); + common->transform = NULL; return TRUE; } - if (common->transform) - free (common->transform); - - if (transform) - { + if (common->transform == NULL) common->transform = malloc (sizeof (pixman_transform_t)); - if (!common->transform) - return FALSE; + if (common->transform == NULL) + return FALSE; - *common->transform = *transform; - } - else - { - common->transform = NULL; - } + memcpy(common->transform, transform, sizeof(pixman_transform_t)); return TRUE; } commit 3e74bc431908dd42775d8e82ca2e4d589de820cb Author: Søren Sandmann Pedersen <[EMAIL PROTECTED]> Date: Fri Aug 17 18:01:09 2007 -0400 Add pixman_image_set_source_clipping() diff --git a/configure.ac b/configure.ac index 2901226..5bb6c27 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_PREREQ([2.57]) m4_define([pixman_major], 0) m4_define([pixman_minor], 9) -m4_define([pixman_micro], 4) +m4_define([pixman_micro], 5) m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro]) diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 2cbf88c..113ddec 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -466,6 +466,18 @@ pixman_image_set_filter (pixman_image_t *image, return TRUE; } +void +pixman_image_set_source_clipping (pixman_image_t *image, + pixman_bool_t source_clipping) +{ + image_common_t *common = &image->common; + + if (source_clipping) + common->src_clip = &common->clip_region; + else + common->src_clip = &common->full_region; +} + /* Unlike all the other property setters, this function does not * copy the content of indexed. Doing this copying is simply * way, way too expensive. diff --git a/pixman/pixman.h b/pixman/pixman.h index ae5aa7a..670f25a 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -470,6 +470,8 @@ pixman_bool_t pixman_image_set_filter (pixman_image_t void pixman_image_set_filter_params (pixman_image_t *image, pixman_fixed_t *params, int n_params); +void pixman_image_set_source_cliping (pixman_image_t *image, + pixman_bool_t source_clipping); void pixman_image_set_alpha_map (pixman_image_t *image, pixman_image_t *alpha_map, int16_t x, commit c7bec5898891f3077986c141b48e5ff77f1d5046 Author: Carl Worth <[EMAIL PROTECTED]> Date: Wed Aug 15 10:16:11 2007 -0700 Fix typo AC_MAJOR -> PIXMAN_MAJOR This typo was causing build failures for some. Thanks to David Sharp for pointing out the problem. diff --git a/configure.ac b/configure.ac index 2a0eb63..2901226 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ m4_define([lt_age], [pixman_minor]) LT_VERSION_INFO="lt_current:lt_revision:lt_age" PIXMAN_MAJOR=pixman_major -AC_SUBST(AC_MAJOR) +AC_SUBST(PIXMAN_MAJOR) AC_SUBST(LT_VERSION_INFO) commit d9b989c890724480d27aec471d5f5fbcc09c0a61 Author: Aaron Plattner <[EMAIL PROTECTED]> Date: Tue Aug 14 16:16:27 2007 -0700 Remove redundant defines. diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c index 6a9a2e7..b48251d 100644 --- a/pixman/pixman-compose.c +++ b/pixman/pixman-compose.c @@ -993,13 +993,6 @@ fbFetchPixel_x4a4 (pixman_image_t *image, return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24; } -#define Fetch8(l,o) (READ((uint8_t *)(l) + ((o) >> 2))) -#if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4) -#else -#define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) >> 4 : Fetch8(l,o) & 0xf) -#endif - static FASTCALL uint32_t fbFetchPixel_a4 (pixman_image_t *image, const uint32_t *bits, int offset, const pixman_indexed_t * indexed) commit 7bdb9840eb414b41ad41871864baa4f2445d8c05 Author: Arcady Goldmints-Orlov <[EMAIL PROTECTED]> Date: Mon Aug 13 17:37:59 2007 -0700 One more minor wrapping fix Signed-off-by: Aaron Plattner <[EMAIL PROTECTED]> diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c index bb1c7c0..6a9a2e7 100644 --- a/pixman/pixman-compose.c +++ b/pixman/pixman-compose.c @@ -1078,7 +1078,7 @@ static FASTCALL uint32_t fbFetchPixel_a1 (pixman_image_t *image, const uint32_t *bits, int offset, const pixman_indexed_t * indexed) { - uint32_t pixel = ((uint32_t *)bits)[offset >> 5]; + uint32_t pixel = READ(bits + (offset >> 5)); uint32_t a; #if BITMAP_BIT_ORDER == MSBFirst a = pixel >> (0x1f - (offset & 0x1f)); @@ -1096,7 +1096,7 @@ static FASTCALL uint32_t fbFetchPixel_g1 (pixman_image_t *image, const uint32_t *bits, int offset, const pixman_indexed_t * indexed) { - uint32_t pixel = ((uint32_t *)bits)[offset >> 5]; + uint32_t pixel = READ(bits + (offset >> 5)); uint32_t a; #if BITMAP_BIT_ORDER == MSBFirst a = pixel >> (0x1f - (offset & 0x1f)); commit 166b78295683d9bcf688702e98259e62f9b25c86 Author: Arcady Goldmints-Orlov <[EMAIL PROTECTED]> Date: Mon Aug 13 15:20:18 2007 -0700 Remove unnecessary wrapping from fbFetch/fbStore. These functions fetch from a picture to a scanline buffer, or store from a scanline buffer to a picture. Since pixman allocates its own scanline buffer, we don't need to wrap accesses to it. Signed-off-by: Aaron Plattner <[EMAIL PROTECTED]> diff --git a/pixman/pixman-compose.c b/pixman/pixman-compose.c index 2082cb6..bb1c7c0 100644 --- a/pixman/pixman-compose.c +++ b/pixman/pixman-compose.c @@ -134,7 +134,7 @@ fbFetch_x8r8g8b8 (pixman_image_t *image, const uint32_t *pixel = (const uint32_t *)bits + x; const uint32_t *end = pixel + width; while (pixel < end) { - WRITE(buffer++, READ(pixel++) | 0xff000000); + *buffer++ = READ(pixel++) | 0xff000000; } } @@ -145,10 +145,10 @@ fbFetch_a8b8g8r8 (pixman_image_t *image, const uint32_t *pixel = (uint32_t *)bits + x; const uint32_t *end = pixel + width; while (pixel < end) { - WRITE(buffer++, ((READ(pixel) & 0xff00ff00) | - ((READ(pixel) >> 16) & 0xff) | - ((READ(pixel) & 0xff) << 16))); - ++pixel; + uint32_t p = READ(pixel++); + *buffer++ = (p & 0xff00ff00) | + ((p >> 16) & 0xff) | + ((p & 0xff) << 16); } } @@ -159,11 +159,11 @@ fbFetch_x8b8g8r8 (pixman_image_t *image, const uint32_t *pixel = (uint32_t *)bits + x; const uint32_t *end = pixel + width; while (pixel < end) { - WRITE(buffer++, 0xff000000 | - ((READ(pixel) & 0x0000ff00) | - ((READ(pixel) >> 16) & 0xff) | - ((READ(pixel) & 0xff) << 16))); - ++pixel; + uint32_t p = READ(pixel++); + *buffer++ = 0xff000000 | + (p & 0x0000ff00) | + ((p >> 16) & 0xff) | + ((p & 0xff) << 16); } } @@ -176,7 +176,7 @@ fbFetch_r8g8b8 (pixman_image_t *image, while (pixel < end) { uint32_t b = Fetch24(pixel) | 0xff000000; pixel += 3; - WRITE(buffer++, b); + *buffer++ = b; } } @@ -197,7 +197,7 @@ fbFetch_b8g8r8 (pixman_image_t *image, b |= (READ(pixel++) << 8); b |= (READ(pixel++)); #endif - WRITE(buffer++, b); + *buffer++ = b; } } @@ -209,13 +209,13 @@ fbFetch_r5g6b5 (pixman_image_t *image, const uint16_t *pixel = (const uint16_t *)bits + x; const uint16_t *end = pixel + width; while (pixel < end) { - uint32_t p = READ(pixel++); + uint32_t p = READ(pixel++); uint32_t r = (((p) << 3) & 0xf8) | (((p) << 5) & 0xfc00) | (((p) << 8) & 0xf80000); r |= (r >> 5) & 0x70007; r |= (r >> 6) & 0x300; - WRITE(buffer++, 0xff000000 | r); + *buffer++ = 0xff000000 | r; } } @@ -233,7 +233,7 @@ fbFetch_b5g6r5 (pixman_image_t *image, b = ((p & 0xf800) | ((p & 0xe000) >> 5)) >> 8; g = ((p & 0x07e0) | ((p & 0x0600) >> 6)) << 5; r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -252,7 +252,7 @@ fbFetch_a1r5g5b5 (pixman_image_t *image, r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9; g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2; - WRITE(buffer++, (a | r | g | b)); + *buffer++ = a | r | g | b; } } @@ -270,7 +270,7 @@ fbFetch_x1r5g5b5 (pixman_image_t *image, r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9; g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2; - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -289,7 +289,7 @@ fbFetch_a1b5g5r5 (pixman_image_t *image, b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7; g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; - WRITE(buffer++, (a | r | g | b)); + *buffer++ = a | r | g | b; } } @@ -307,7 +307,7 @@ fbFetch_x1b5g5r5 (pixman_image_t *image, b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7; g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6; r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14; - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -325,7 +325,7 @@ fbFetch_a4r4g4b4 (pixman_image_t *image, r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; b = ((p & 0x000f) | ((p & 0x000f) << 4)); - WRITE(buffer++, (a | r | g | b)); + *buffer++ = a | r | g | b; } } @@ -343,7 +343,7 @@ fbFetch_x4r4g4b4 (pixman_image_t *image, r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12; g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; b = ((p & 0x000f) | ((p & 0x000f) << 4)); - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -362,7 +362,7 @@ fbFetch_a4b4g4r4 (pixman_image_t *image, b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; - WRITE(buffer++, (a | r | g | b)); + *buffer++ = a | r | g | b; } } @@ -380,7 +380,7 @@ fbFetch_x4b4g4r4 (pixman_image_t *image, b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4; g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8; r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16; - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -391,7 +391,7 @@ fbFetch_a8 (pixman_image_t *image, const uint8_t *pixel = (const uint8_t *)bits + x; const uint8_t *end = pixel + width; while (pixel < end) { - WRITE(buffer++, READ(pixel++) << 24); + *buffer++ = READ(pixel++) << 24; } } @@ -412,7 +412,7 @@ fbFetch_r3g3b2 (pixman_image_t *image, ((p & 0x03) << 2) | ((p & 0x03) << 4) | ((p & 0x03) << 6)); - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -435,7 +435,7 @@ fbFetch_b2g3r3 (pixman_image_t *image, r = (((p & 0x07) ) | ((p & 0x07) << 3) | ((p & 0x06) << 6)) << 16; - WRITE(buffer++, (0xff000000 | r | g | b)); + *buffer++ = 0xff000000 | r | g | b; } } @@ -453,7 +453,7 @@ fbFetch_a2r2g2b2 (pixman_image_t *image, r = ((p & 0x30) * 0x55) << 12; g = ((p & 0x0c) * 0x55) << 6; b = ((p & 0x03) * 0x55); - WRITE(buffer++, a|r|g|b); + *buffer++ = a|r|g|b; } } @@ -471,7 +471,7 @@ fbFetch_a2b2g2r2 (pixman_image_t *image, b = ((p & 0x30) * 0x55) >> 6; g = ((p & 0x0c) * 0x55) << 6; r = ((p & 0x03) * 0x55) << 16; - WRITE(buffer++, a|r|g|b); + *buffer++ = a|r|g|b; } } @@ -483,7 +483,7 @@ fbFetch_c8 (pixman_image_t *image, const uint8_t *end = pixel + width; while (pixel < end) { uint32_t p = READ(pixel++); - WRITE(buffer++, indexed->rgba[p]); + *buffer++ = indexed->rgba[p]; } } @@ -495,11 +495,11 @@ fbFetch_x4a4 (pixman_image_t *image, const uint8_t *end = pixel + width; while (pixel < end) { uint8_t p = READ(pixel++) & 0xf; - WRITE(buffer++, (p | (p << 4)) << 24); + *buffer++ = (p | (p << 4)) << 24; } } -#define Fetch8(l,o) (((uint8_t *) (l))[(o) >> 2]) +#define Fetch8(l,o) (READ((uint8_t *)(l) + ((o) >> 2))) #if IMAGE_BYTE_ORDER == MSBFirst #define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4) #else @@ -515,7 +515,7 @@ fbFetch_a4 (pixman_image_t *image, uint32_t p = Fetch4(bits, i + x); p |= p << 4; - WRITE(buffer++, p << 24); + *buffer++ = p << 24; } } @@ -531,7 +531,7 @@ fbFetch_r1g2b1 (pixman_image_t *image, r = ((p & 0x8) * 0xff) << 13; g = ((p & 0x6) * 0x55) << 7; b = ((p & 0x1) * 0xff); - WRITE(buffer++, 0xff000000|r|g|b); + *buffer++ = 0xff000000|r|g|b; } } @@ -547,7 +547,7 @@ fbFetch_b1g2r1 (pixman_image_t *image, b = ((p & 0x8) * 0xff) >> 3; g = ((p & 0x6) * 0x55) << 7; r = ((p & 0x1) * 0xff) << 16; - WRITE(buffer++, 0xff000000|r|g|b); + *buffer++ = 0xff000000|r|g|b; } } @@ -564,7 +564,7 @@ fbFetch_a1r1g1b1 (pixman_image_t *image, r = ((p & 0x4) * 0xff) << 14; g = ((p & 0x2) * 0xff) << 7; b = ((p & 0x1) * 0xff); - WRITE(buffer++, a|r|g|b); + *buffer++ = a|r|g|b; } } @@ -581,7 +581,7 @@ fbFetch_a1b1g1r1 (pixman_image_t *image, r = ((p & 0x4) * 0xff) >> 3; g = ((p & 0x2) * 0xff) << 7; b = ((p & 0x1) * 0xff) << 16; - WRITE(buffer++, a|r|g|b); + *buffer++ = a|r|g|b; } } @@ -593,7 +593,7 @@ fbFetch_c4 (pixman_image_t *image, for (i = 0; i < width; ++i) { uint32_t p = Fetch4(bits, i + x); - WRITE(buffer++, indexed->rgba[p]); + *buffer++ = indexed->rgba[p]; } } @@ -604,7 +604,7 @@ fbFetch_a1 (pixman_image_t *image, { int i; for (i = 0; i < width; ++i) { - uint32_t p = ((uint32_t *)bits)[(i + x) >> 5]; + uint32_t p = READ(bits + ((i + x) >> 5)); uint32_t a; #if BITMAP_BIT_ORDER == MSBFirst a = p >> (0x1f - ((i+x) & 0x1f)); @@ -615,7 +615,7 @@ fbFetch_a1 (pixman_image_t *image, a |= a << 1; a |= a << 2; a |= a << 4; - WRITE(buffer++, a << 24); + *buffer++ = a << 24; } } @@ -625,7 +625,7 @@ fbFetch_g1 (pixman_image_t *image, { int i; for (i = 0; i < width; ++i) { - uint32_t p = ((uint32_t *)bits)[(i+x) >> 5]; + uint32_t p = READ(bits + ((i+x) >> 5)); uint32_t a; #if BITMAP_BIT_ORDER == MSBFirst a = p >> (0x1f - ((i+x) & 0x1f)); @@ -633,7 +633,7 @@ fbFetch_g1 (pixman_image_t *image, a = p >> ((i+x) & 0x1f); #endif a = a & 1; - WRITE(buffer++, indexed->rgba[a]); + *buffer++ = indexed->rgba[a]; } } @@ -993,7 +993,7 @@ fbFetchPixel_x4a4 (pixman_image_t *image, return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24; } -#define Fetch8(l,o) (((uint8_t *) (l))[(o) >> 2]) +#define Fetch8(l,o) (READ((uint8_t *)(l) + ((o) >> 2))) #if IMAGE_BYTE_ORDER == MSBFirst #define Fetch4(l,o) ((o) & 2 ? Fetch8(l,o) & 0xf : Fetch8(l,o) >> 4) #else @@ -1185,7 +1185,7 @@ fbStore_x8r8g8b8 (pixman_image_t *image, int i; uint32_t *pixel = (uint32_t *)bits + x; for (i = 0; i < width; ++i) - WRITE(pixel++, READ(values + i) & 0xffffff); + WRITE(pixel++, values[i] & 0xffffff); } static FASTCALL void @@ -1195,7 +1195,7 @@ fbStore_a8b8g8r8 (pixman_image_t *image, int i; uint32_t *pixel = (uint32_t *)bits + x; for (i = 0; i < width; ++i) - WRITE(pixel++, (READ(values + i) & 0xff00ff00) | ((READ(values + i) >> 16) & 0xff) | ((READ(values + i) & 0xff) << 16)); + WRITE(pixel++, (values[i] & 0xff00ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16)); } static FASTCALL void @@ -1205,7 +1205,7 @@ fbStore_x8b8g8r8 (pixman_image_t *image, int i; uint32_t *pixel = (uint32_t *)bits + x; for (i = 0; i < width; ++i) - WRITE(pixel++, (READ(values + i) & 0x0000ff00) | ((READ(values + i) >> 16) & 0xff) | ((READ(values + i) & 0xff) << 16)); + WRITE(pixel++, (values[i] & 0x0000ff00) | ((values[i] >> 16) & 0xff) | ((values[i] & 0xff) << 16)); } static FASTCALL void @@ -1216,7 +1216,7 @@ fbStore_r8g8b8 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + 3*x; for (i = 0; i < width; ++i) { - Store24(pixel, READ(values + i)); + Store24(pixel, values[i]); pixel += 3; } } @@ -1228,7 +1228,7 @@ fbStore_b8g8r8 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + 3*x; for (i = 0; i < width; ++i) { - uint32_t val = READ(values + i); + uint32_t val = values[i]; #if IMAGE_BYTE_ORDER == MSBFirst WRITE(pixel++, Blue(val)); WRITE(pixel++, Green(val)); @@ -1248,7 +1248,7 @@ fbStore_r5g6b5 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - uint32_t s = READ(values + i); + uint32_t s = values[i]; WRITE(pixel++, ((s >> 3) & 0x001f) | ((s >> 5) & 0x07e0) | ((s >> 8) & 0xf800)); @@ -1262,7 +1262,7 @@ fbStore_b5g6r5 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((b << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((r >> 3) )); @@ -1276,7 +1276,7 @@ fbStore_a1r5g5b5 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Splita(READ(values + i)); + Splita(values[i]); WRITE(pixel++, ((a << 8) & 0x8000) | ((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | @@ -1291,7 +1291,7 @@ fbStore_x1r5g5b5 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((b >> 3) )); @@ -1305,7 +1305,7 @@ fbStore_a1b5g5r5 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Splita(READ(values + i)); + Splita(values[i]); WRITE(pixel++, ((a << 8) & 0x8000) | ((b << 7) & 0x7c00) | ((g << 2) & 0x03e0) | @@ -1320,7 +1320,7 @@ fbStore_x1b5g5r5 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((b << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((r >> 3) )); @@ -1334,7 +1334,7 @@ fbStore_a4r4g4b4 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Splita(READ(values + i)); + Splita(values[i]); WRITE(pixel++, ((a << 8) & 0xf000) | ((r << 4) & 0x0f00) | ((g ) & 0x00f0) | @@ -1349,7 +1349,7 @@ fbStore_x4r4g4b4 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((r << 4) & 0x0f00) | ((g ) & 0x00f0) | ((b >> 4) )); @@ -1363,7 +1363,7 @@ fbStore_a4b4g4r4 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Splita(READ(values + i)); + Splita(values[i]); WRITE(pixel++, ((a << 8) & 0xf000) | ((b << 4) & 0x0f00) | ((g ) & 0x00f0) | @@ -1378,7 +1378,7 @@ fbStore_x4b4g4r4 (pixman_image_t *image, int i; uint16_t *pixel = ((uint16_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((b << 4) & 0x0f00) | ((g ) & 0x00f0) | ((r >> 4) )); @@ -1392,7 +1392,7 @@ fbStore_a8 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + x; for (i = 0; i < width; ++i) { - WRITE(pixel++, READ(values + i) >> 24); + WRITE(pixel++, values[i] >> 24); } } @@ -1403,7 +1403,7 @@ fbStore_r3g3b2 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((r ) & 0xe0) | ((g >> 3) & 0x1c) | @@ -1418,7 +1418,7 @@ fbStore_b2g3r3 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + x; for (i = 0; i < width; ++i) { - Split(READ(values + i)); + Split(values[i]); WRITE(pixel++, ((b ) & 0xc0) | ((g >> 2) & 0x1c) | @@ -1433,7 +1433,7 @@ fbStore_a2r2g2b2 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + x; for (i = 0; i < width; ++i) { - Splita(READ(values + i)); + Splita(values[i]); WRITE(pixel++, ((a ) & 0xc0) | ((r >> 2) & 0x30) | ((g >> 4) & 0x0c) | @@ -1448,7 +1448,7 @@ fbStore_c8 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + x; for (i = 0; i < width; ++i) { - WRITE(pixel++, miIndexToEnt24(indexed,READ(values + i))); + WRITE(pixel++, miIndexToEnt24(indexed,values[i])); } } @@ -1459,11 +1459,11 @@ fbStore_x4a4 (pixman_image_t *image, int i; uint8_t *pixel = ((uint8_t *) bits) + x; for (i = 0; i < width; ++i) { - WRITE(pixel++, READ(values + i) >> 28); + WRITE(pixel++, values[i] >> 28); } } -#define Store8(l,o,v) (((uint8_t *) l)[(o) >> 3] = (v)) +#define Store8(l,o,v) (WRITE((uint8_t *)(l) + ((o) >> 3), (v))) #if IMAGE_BYTE_ORDER == MSBFirst #define Store4(l,o,v) Store8(l,o,((o) & 4 ? \ (Fetch8(l,o) & 0xf0) | (v) : \ @@ -1480,7 +1480,7 @@ fbStore_a4 (pixman_image_t *image, { int i; for (i = 0; i < width; ++i) { - Store4(bits, i + x, READ(values + i)>>28); + Store4(bits, i + x, values[i]>>28); } } @@ -1492,7 +1492,7 @@ fbStore_r1g2b1 (pixman_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; - Split(READ(values + i)); + Split(values[i]); pixel = (((r >> 4) & 0x8) | ((g >> 5) & 0x6) | ((b >> 7) )); @@ -1508,7 +1508,7 @@ fbStore_b1g2r1 (pixman_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]