From d2a4281376786fc7f31f7367807c7caa8a99d414 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 29 Jun 2009 07:46:11 -0400 Subject: [PATCH] Various simple renamings s/CvtR8G8B8toY15/CONVERT_RGB24_TO_Y15/g; s/cvt8888to0565/CONVERT_8888_TO_0565/g; s/cvt0565to0888/CONVERT_0565_TO_0888/g; s/miIndexToEnt15/RGB16_TO_ENTRY/g; s/miIndexToEnt24/RGB24_TO_ENTRY/g; s/miIndexToEntY24/RGB24_TO_ENTRY_Y/g; s/miCvtR8G8B8to15/CONVERT_RGB24_TO_RGB15/g; s/is_same/IS_SAME/g; s/is_zero/IS_ZERO/g; s/is_int([ (])/IS_INT$1/g; s/is_one/IS_ONE/g; s/is_unit/IS_UNIT/g; s/Fetch4/FETCH_4/g; s/Store4/STORE_4/g; s/Fetch8/FETCH_8/g; s/Store8/STORE_8/g; s/Fetch24/fetch_24/g; s/Store24/store_24/g; s/_64_generic/64_generic/g; s/64_generic/_generic_64/g; s/32_generic_lossy/_generic_lossy_32/g; s/PdfSeparableBlendMode/PDF_SEPARABLE_BLEND_MODE/g; s/PdfNonSeparableBlendMode/PDF_NON_SEPARABLE_BLEND_MODE/g; s/([^_])HSL/$1Hsl/g; s/Blend/blend_/g; s/FbScrLeft/SCREEN_SHIFT_LEFT/g; s/FbScrRigth/SCREEN_SHIFT_RIGHT/g; s/FbLeftMask/LEFT_MASK/g; s/FbRightMask/RIGHT_MASK/g; s/Splita/SPLIT_A/g; s/Split/SPLIT/g; s/MMX_Extensions/MMX_EXTENSIONS/g; --- pixman/pixman-access.c | 140 +++++++++++++++++++-------------------- pixman/pixman-bits-image.c | 4 +- pixman/pixman-combine.c.template | 94 +++++++++++++------------- pixman/pixman-conical-gradient.c | 2 +- pixman/pixman-cpu.c | 10 +-- pixman/pixman-edge-imp.h | 14 ++-- pixman/pixman-fast-path.c | 42 ++++++------ pixman/pixman-image.c | 2 +- pixman/pixman-linear-gradient.c | 2 +- pixman/pixman-matrix.c | 66 +++++++++--------- pixman/pixman-private.h | 6 +- pixman/pixman-radial-gradient.c | 2 +- pixman/pixman-solid-fill.c | 2 +- pixman/pixman.c | 2 +- 14 files changed, 194 insertions(+), 194 deletions(-) diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c index eacb19c..217a02d 100644 --- a/pixman/pixman-access.c +++ b/pixman/pixman-access.c @@ -35,16 +35,16 @@ #include "pixman-private.h" #include "pixman-accessor.h" -#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \ +#define CONVERT_RGB24_TO_Y15(s) (((((s) >> 16) & 0xff) * 153 + \ (((s) >> 8) & 0xff) * 301 + \ (((s) ) & 0xff) * 58) >> 2) -#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \ +#define CONVERT_RGB24_TO_RGB15(s) ((((s) >> 3) & 0x001f) | \ (((s) >> 6) & 0x03e0) | \ (((s) >> 9) & 0x7c00)) -#define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15]) -#define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24)) +#define RGB16_TO_ENTRY(mif,rgb15) ((mif)->ent[rgb15]) +#define RGB24_TO_ENTRY(mif,rgb24) RGB16_TO_ENTRY(mif,CONVERT_RGB24_TO_RGB15(rgb24)) -#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)]) +#define RGB24_TO_ENTRY_Y(mif,rgb24) ((mif)->ent[CONVERT_RGB24_TO_Y15(rgb24)]) /* * YV12 setup and access macros @@ -621,11 +621,11 @@ fetch_scanline_x4a4 (pixman_image_t *image, int x, int y, int width, uint32_t *b } } -#define Fetch8(img,l,o) (READ(img, (uint8_t *)(l) + ((o) >> 2))) +#define FETCH_8(img,l,o) (READ(img, (uint8_t *)(l) + ((o) >> 2))) #ifdef WORDS_BIGENDIAN -#define Fetch4(img,l,o) ((o) & 2 ? Fetch8(img,l,o) & 0xf : Fetch8(img,l,o) >> 4) +#define FETCH_4(img,l,o) ((o) & 2 ? FETCH_8(img,l,o) & 0xf : FETCH_8(img,l,o) >> 4) #else -#define Fetch4(img,l,o) ((o) & 2 ? Fetch8(img,l,o) >> 4 : Fetch8(img,l,o) & 0xf) +#define FETCH_4(img,l,o) ((o) & 2 ? FETCH_8(img,l,o) >> 4 : FETCH_8(img,l,o) & 0xf) #endif static void @@ -635,7 +635,7 @@ fetch_scanline_a4 (pixman_image_t *image, int x, int y, int width, uint32_t *buf const uint32_t *bits = image->bits.bits + y*image->bits.rowstride; int i; for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(image, bits, i + x); + uint32_t p = FETCH_4(image, bits, i + x); p |= p << 4; *buffer++ = p << 24; @@ -650,7 +650,7 @@ fetch_scanline_r1g2b1 (pixman_image_t *image, int x, int y, int width, uint32_t const uint32_t *bits = image->bits.bits + y*image->bits.rowstride; int i; for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(image, bits, i + x); + uint32_t p = FETCH_4(image, bits, i + x); r = ((p & 0x8) * 0xff) << 13; g = ((p & 0x6) * 0x55) << 7; @@ -667,7 +667,7 @@ fetch_scanline_b1g2r1 (pixman_image_t *image, int x, int y, int width, uint32_t const uint32_t *bits = image->bits.bits + y*image->bits.rowstride; int i; for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(image, bits, i + x); + uint32_t p = FETCH_4(image, bits, i + x); b = ((p & 0x8) * 0xff) >> 3; g = ((p & 0x6) * 0x55) << 7; @@ -684,7 +684,7 @@ fetch_scanline_a1r1g1b1 (pixman_image_t *image, int x, int y, int width, uint32_ const uint32_t *bits = image->bits.bits + y*image->bits.rowstride; int i; for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(image, bits, i + x); + uint32_t p = FETCH_4(image, bits, i + x); a = ((p & 0x8) * 0xff) << 21; r = ((p & 0x4) * 0xff) << 14; @@ -702,7 +702,7 @@ fetch_scanline_a1b1g1r1 (pixman_image_t *image, int x, int y, int width, uint32_ const uint32_t *bits = image->bits.bits + y*image->bits.rowstride; int i; for (i = 0; i < width; ++i) { - uint32_t p = Fetch4(image, bits, i + x); + uint32_t p = FETCH_4(image, bits, i + x); a = ((p & 0x8) * 0xff) << 21; r = ((p & 0x4) * 0xff) >> 3; @@ -720,7 +720,7 @@ fetch_scanline_c4 (pixman_image_t *image, int x, int y, int width, uint32_t *buf const pixman_indexed_t * indexed = image->bits.indexed; int i; for (i = 0; i < width; ++i) { - uint32_t p = Fetch4 (image, bits, i + x); + uint32_t p = FETCH_4 (image, bits, i + x); *buffer++ = indexed->rgba[p]; } @@ -1690,7 +1690,7 @@ fetch_pixels_a4 (bits_image_t *pict, uint32_t *buffer, int n_pixels) else { uint32_t *bits = pict->bits + line*pict->rowstride; - uint32_t pixel = Fetch4 (pict, bits, offset); + uint32_t pixel = FETCH_4 (pict, bits, offset); pixel |= pixel << 4; buffer[i] = pixel << 24; @@ -1716,7 +1716,7 @@ fetch_pixels_r1g2b1 (bits_image_t *pict, uint32_t *buffer, int n_pixels) { uint32_t r,g,b; uint32_t *bits = pict->bits + line*pict->rowstride; - uint32_t pixel = Fetch4 (pict, bits, offset); + uint32_t pixel = FETCH_4 (pict, bits, offset); r = ((pixel & 0x8) * 0xff) << 13; g = ((pixel & 0x6) * 0x55) << 7; @@ -1744,7 +1744,7 @@ fetch_pixels_b1g2r1 (bits_image_t *pict, uint32_t *buffer, int n_pixels) { uint32_t r,g,b; uint32_t *bits = pict->bits + line*pict->rowstride; - uint32_t pixel = Fetch4 (pict, bits, offset); + uint32_t pixel = FETCH_4 (pict, bits, offset); b = ((pixel & 0x8) * 0xff) >> 3; g = ((pixel & 0x6) * 0x55) << 7; @@ -1772,7 +1772,7 @@ fetch_pixels_a1r1g1b1 (bits_image_t *pict, uint32_t *buffer, int n_pixels) { uint32_t a,r,g,b; uint32_t *bits = pict->bits + line*pict->rowstride; - uint32_t pixel = Fetch4 (pict, bits, offset); + uint32_t pixel = FETCH_4 (pict, bits, offset); a = ((pixel & 0x8) * 0xff) << 21; r = ((pixel & 0x4) * 0xff) << 14; @@ -1801,7 +1801,7 @@ fetch_pixels_a1b1g1r1 (bits_image_t *pict, uint32_t *buffer, int n_pixels) { uint32_t a,r,g,b; uint32_t *bits = pict->bits + line*pict->rowstride; - uint32_t pixel = Fetch4 (pict, bits, offset); + uint32_t pixel = FETCH_4 (pict, bits, offset); a = ((pixel & 0x8) * 0xff) << 21; r = ((pixel & 0x4) * 0xff) >> 3; @@ -1829,7 +1829,7 @@ fetch_pixels_c4 (bits_image_t *pict, uint32_t *buffer, int n_pixels) else { uint32_t *bits = pict->bits + line*pict->rowstride; - uint32_t pixel = Fetch4 (pict, bits, offset); + uint32_t pixel = FETCH_4 (pict, bits, offset); const pixman_indexed_t * indexed = pict->indexed; buffer[i] = indexed->rgba[pixel]; @@ -1981,8 +1981,8 @@ fetch_pixels_yv12 (bits_image_t *pict, uint32_t *buffer, int n_pixels) /*********************************** Store ************************************/ -#define Splita(v) uint32_t a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff -#define Split(v) uint32_t r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff +#define SPLIT_A(v) uint32_t a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff +#define SPLIT(v) uint32_t r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff static void store_scanline_a2r10g10b10 (bits_image_t *image, int x, int y, int width, const uint32_t *v) @@ -2207,7 +2207,7 @@ store_scanline_b5g6r5 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((b << 8) & 0xf800) | ((g << 3) & 0x07e0) | ((r >> 3) )); @@ -2224,7 +2224,7 @@ store_scanline_a1r5g5b5 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Splita(values[i]); + SPLIT_A(values[i]); WRITE(image, pixel++, ((a << 8) & 0x8000) | ((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | @@ -2242,7 +2242,7 @@ store_scanline_x1r5g5b5 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((r << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((b >> 3) )); @@ -2259,7 +2259,7 @@ store_scanline_a1b5g5r5 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Splita(values[i]); + SPLIT_A(values[i]); WRITE(image, pixel++, ((a << 8) & 0x8000) | ((b << 7) & 0x7c00) | ((g << 2) & 0x03e0) | @@ -2277,7 +2277,7 @@ store_scanline_x1b5g5r5 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((b << 7) & 0x7c00) | ((g << 2) & 0x03e0) | ((r >> 3) )); @@ -2294,7 +2294,7 @@ store_scanline_a4r4g4b4 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Splita(values[i]); + SPLIT_A(values[i]); WRITE(image, pixel++, ((a << 8) & 0xf000) | ((r << 4) & 0x0f00) | ((g ) & 0x00f0) | @@ -2312,7 +2312,7 @@ store_scanline_x4r4g4b4 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((r << 4) & 0x0f00) | ((g ) & 0x00f0) | ((b >> 4) )); @@ -2329,7 +2329,7 @@ store_scanline_a4b4g4r4 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Splita(values[i]); + SPLIT_A(values[i]); WRITE(image, pixel++, ((a << 8) & 0xf000) | ((b << 4) & 0x0f00) | ((g ) & 0x00f0) | @@ -2347,7 +2347,7 @@ store_scanline_x4b4g4r4 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((b << 4) & 0x0f00) | ((g ) & 0x00f0) | ((r >> 4) )); @@ -2378,7 +2378,7 @@ store_scanline_r3g3b2 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((r ) & 0xe0) | ((g >> 3) & 0x1c) | @@ -2396,7 +2396,7 @@ store_scanline_b2g3r3 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Split(values[i]); + SPLIT(values[i]); WRITE(image, pixel++, ((b ) & 0xc0) | ((g >> 2) & 0x38) | @@ -2414,7 +2414,7 @@ store_scanline_a2r2g2b2 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Splita(values[i]); + SPLIT_A(values[i]); WRITE(image, pixel++, ((a ) & 0xc0) | ((r >> 2) & 0x30) | ((g >> 4) & 0x0c) | @@ -2432,7 +2432,7 @@ store_scanline_a2b2g2r2 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Splita(values[i]); + SPLIT_A(values[i]); *(pixel++) = ((a ) & 0xc0) | ((b >> 2) & 0x30) | ((g >> 4) & 0x0c) | @@ -2451,7 +2451,7 @@ store_scanline_c8 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - WRITE(image, pixel++, miIndexToEnt24(indexed,values[i])); + WRITE(image, pixel++, RGB24_TO_ENTRY(indexed,values[i])); } } @@ -2469,15 +2469,15 @@ store_scanline_x4a4 (bits_image_t *image, } } -#define Store8(img,l,o,v) (WRITE(img, (uint8_t *)(l) + ((o) >> 3), (v))) +#define STORE_8(img,l,o,v) (WRITE(img, (uint8_t *)(l) + ((o) >> 3), (v))) #ifdef WORDS_BIGENDIAN -#define Store4(img,l,o,v) Store8(img,l,o,((o) & 4 ? \ - (Fetch8(img,l,o) & 0xf0) | (v) : \ - (Fetch8(img,l,o) & 0x0f) | ((v) << 4))) +#define STORE_4(img,l,o,v) STORE_8(img,l,o,((o) & 4 ? \ + (FETCH_8(img,l,o) & 0xf0) | (v) : \ + (FETCH_8(img,l,o) & 0x0f) | ((v) << 4))) #else -#define Store4(img,l,o,v) Store8(img,l,o,((o) & 4 ? \ - (Fetch8(img,l,o) & 0x0f) | ((v) << 4) : \ - (Fetch8(img,l,o) & 0xf0) | (v))) +#define STORE_4(img,l,o,v) STORE_8(img,l,o,((o) & 4 ? \ + (FETCH_8(img,l,o) & 0x0f) | ((v) << 4) : \ + (FETCH_8(img,l,o) & 0xf0) | (v))) #endif static void @@ -2489,7 +2489,7 @@ store_scanline_a4 (bits_image_t *image, int i; for (i = 0; i < width; ++i) { - Store4(image, bits, i + x, values[i]>>28); + STORE_4(image, bits, i + x, values[i]>>28); } } @@ -2504,11 +2504,11 @@ store_scanline_r1g2b1 (bits_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; - Split(values[i]); + SPLIT(values[i]); pixel = (((r >> 4) & 0x8) | ((g >> 5) & 0x6) | ((b >> 7) )); - Store4(image, bits, i + x, pixel); + STORE_4(image, bits, i + x, pixel); } } @@ -2523,11 +2523,11 @@ store_scanline_b1g2r1 (bits_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; - Split(values[i]); + SPLIT(values[i]); pixel = (((b >> 4) & 0x8) | ((g >> 5) & 0x6) | ((r >> 7) )); - Store4(image, bits, i + x, pixel); + STORE_4(image, bits, i + x, pixel); } } @@ -2541,12 +2541,12 @@ store_scanline_a1r1g1b1 (bits_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; - Splita(values[i]); + SPLIT_A(values[i]); pixel = (((a >> 4) & 0x8) | ((r >> 5) & 0x4) | ((g >> 6) & 0x2) | ((b >> 7) )); - Store4(image, bits, i + x, pixel); + STORE_4(image, bits, i + x, pixel); } } @@ -2560,12 +2560,12 @@ store_scanline_a1b1g1r1 (bits_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; - Splita(values[i]); + SPLIT_A(values[i]); pixel = (((a >> 4) & 0x8) | ((b >> 5) & 0x4) | ((g >> 6) & 0x2) | ((r >> 7) )); - Store4(image, bits, i + x, pixel); + STORE_4(image, bits, i + x, pixel); } } @@ -2581,8 +2581,8 @@ store_scanline_c4 (bits_image_t *image, for (i = 0; i < width; ++i) { uint32_t pixel; - pixel = miIndexToEnt24(indexed, values[i]); - Store4(image, bits, i + x, pixel); + pixel = RGB24_TO_ENTRY(indexed, values[i]); + STORE_4(image, bits, i + x, pixel); } } @@ -2626,7 +2626,7 @@ store_scanline_g1 (bits_image_t *image, #else mask = 1 << ((i + x) & 0x1f); #endif - v = miIndexToEntY24 (indexed, values[i]) ? mask : 0; + v = RGB24_TO_ENTRY_Y (indexed, values[i]) ? mask : 0; WRITE(image, pixel, (READ(image, pixel) & ~mask) | v); } } @@ -2636,7 +2636,7 @@ store_scanline_g1 (bits_image_t *image, * store proc. Despite the type, this function expects a uint64_t buffer. */ static void -store_scanline64_generic (bits_image_t *image, int x, int y, int width, const uint32_t *values) +store_scanline_generic_64 (bits_image_t *image, int x, int y, int width, const uint32_t *values) { uint32_t *argb8Pixels; @@ -2658,7 +2658,7 @@ store_scanline64_generic (bits_image_t *image, int x, int y, int width, const ui /* Despite the type, this function expects both buffer and mask to be uint64_t */ static void -fetch_scanline64_generic (pixman_image_t *image, int x, int y, int width, uint32_t *buffer, +fetch_scanline_generic_64 (pixman_image_t *image, int x, int y, int width, uint32_t *buffer, const uint32_t *mask, uint32_t mask_bits) { /* Fetch the pixels into the first half of buffer and then expand them in @@ -2671,7 +2671,7 @@ fetch_scanline64_generic (pixman_image_t *image, int x, int y, int width, uint32 /* Despite the type, this function expects a uint64_t *buffer */ static void -fetch_pixels64_generic (bits_image_t *pict, uint32_t *buffer, int n_pixels) +fetch_pixels_generic_64 (bits_image_t *pict, uint32_t *buffer, int n_pixels) { pict->fetch_pixels_raw_32 (pict, buffer, n_pixels); @@ -2685,7 +2685,7 @@ fetch_pixels64_generic (bits_image_t *pict, uint32_t *buffer, int n_pixels) * WARNING: This function loses precision! */ static void -fetch_pixels32_generic_lossy (bits_image_t *pict, uint32_t *buffer, int n_pixels) +fetch_pixels_generic_lossy_32 (bits_image_t *pict, uint32_t *buffer, int n_pixels) { /* Since buffer contains n_pixels coordinate pairs, it also has enough room for * n_pixels 64 bit pixels. @@ -2709,9 +2709,9 @@ typedef struct #define FORMAT_INFO(format) \ { \ PIXMAN_##format, \ - fetch_scanline_##format, fetch_scanline64_generic, \ - fetch_pixels_##format, fetch_pixels64_generic, \ - store_scanline_##format, store_scanline64_generic \ + fetch_scanline_##format, fetch_scanline_generic_64, \ + fetch_pixels_##format, fetch_pixels_generic_64, \ + store_scanline_##format, store_scanline_generic_64 \ } static const format_info_t accessors[] = @@ -2786,33 +2786,33 @@ static const format_info_t accessors[] = { PIXMAN_a2r10g10b10, NULL, fetch_scanline_a2r10g10b10, - fetch_pixels32_generic_lossy, fetch_pixels_a2r10g10b10_64, + fetch_pixels_generic_lossy_32, fetch_pixels_a2r10g10b10_64, NULL, store_scanline_a2r10g10b10 }, { PIXMAN_x2r10g10b10, NULL, fetch_scanline_x2r10g10b10, - fetch_pixels32_generic_lossy, fetch_pixels_x2r10g10b10_64, + fetch_pixels_generic_lossy_32, fetch_pixels_x2r10g10b10_64, NULL, store_scanline_x2r10g10b10 }, { PIXMAN_a2b10g10r10, NULL, fetch_scanline_a2b10g10r10, - fetch_pixels32_generic_lossy, fetch_pixels_a2b10g10r10_64, + fetch_pixels_generic_lossy_32, fetch_pixels_a2b10g10r10_64, NULL, store_scanline_a2b10g10r10 }, { PIXMAN_x2b10g10r10, NULL, fetch_scanline_x2b10g10r10, - fetch_pixels32_generic_lossy, fetch_pixels_x2b10g10r10_64, + fetch_pixels_generic_lossy_32, fetch_pixels_x2b10g10r10_64, NULL, store_scanline_x2b10g10r10 }, /* YUV formats */ { PIXMAN_yuy2, - fetch_scanline_yuy2, fetch_scanline64_generic, - fetch_pixels_yuy2, fetch_pixels64_generic, + fetch_scanline_yuy2, fetch_scanline_generic_64, + fetch_pixels_yuy2, fetch_pixels_generic_64, NULL, NULL }, { PIXMAN_yv12, - fetch_scanline_yv12, fetch_scanline64_generic, - fetch_pixels_yv12, fetch_pixels64_generic, + fetch_scanline_yv12, fetch_scanline_generic_64, + fetch_pixels_yv12, fetch_pixels_generic_64, NULL, NULL }, { PIXMAN_null }, diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index 3b65a01..3a54a52 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -741,7 +741,7 @@ bits_image_property_changed (pixman_image_t *image) if (bits->common.alpha_map) { image->common.get_scanline_64 = - _pixman_image_get_scanline_64_generic; + _pixman_image_get_scanline_generic_64; image->common.get_scanline_32 = bits_image_fetch_transformed; } @@ -763,7 +763,7 @@ bits_image_property_changed (pixman_image_t *image) else { image->common.get_scanline_64 = - _pixman_image_get_scanline_64_generic; + _pixman_image_get_scanline_generic_64; image->common.get_scanline_32 = bits_image_fetch_transformed; } diff --git a/pixman/pixman-combine.c.template b/pixman/pixman-combine.c.template index 72b4a67..1b43610 100644 --- a/pixman/pixman-combine.c.template +++ b/pixman/pixman-combine.c.template @@ -352,8 +352,8 @@ fbCombineSaturateU (pixman_implementation_t *imp, pixman_op_t op, * no released draft exists that shows this, as the formulas have not been * updated yet after the release of ISO 32000. * - * The default implementation here uses the PdfSeparableBlendMode and - * PdfNonSeparableBlendMode macros, which take the blend function as an + * The default implementation here uses the PDF_SEPARABLE_BLEND_MODE and + * PDF_NON_SEPARABLE_BLEND_MODE macros, which take the blend function as an * argument. Note that this implementation operates on premultiplied colors, * while the PDF specification does not. Therefore the code uses the formula * ar.Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as) @@ -405,7 +405,7 @@ fbCombineMultiplyC (pixman_implementation_t *imp, pixman_op_t op, } } -#define PdfSeparableBlendMode(name) \ +#define PDF_SEPARABLE_BLEND_MODE(name) \ static void \ fbCombine ## name ## U (pixman_implementation_t *imp, pixman_op_t op, \ comp4_t *dest, const comp4_t *src, const comp4_t *mask, int width) \ @@ -425,9 +425,9 @@ fbCombine ## name ## U (pixman_implementation_t *imp, pixman_op_t op, \ \ *(dest + i) = result + \ (DivOne (sa * da) << A_SHIFT) + \ - (Blend ## name (Red (d), da, Red (s), sa) << R_SHIFT) + \ - (Blend ## name (Green (d), da, Green (s), sa) << G_SHIFT) + \ - (Blend ## name (Blue (d), da, Blue (s), sa)); \ + (blend_ ## name (Red (d), da, Red (s), sa) << R_SHIFT) + \ + (blend_ ## name (Green (d), da, Green (s), sa) << G_SHIFT) + \ + (blend_ ## name (Blue (d), da, Blue (s), sa)); \ } \ } \ \ @@ -451,9 +451,9 @@ fbCombine ## name ## C (pixman_implementation_t *imp, pixman_op_t op, \ \ result += \ (DivOne (Alpha (m) * da) << A_SHIFT) + \ - (Blend ## name (Red (d), da, Red (s), Red (m)) << R_SHIFT) + \ - (Blend ## name (Green (d), da, Green (s), Green (m)) << G_SHIFT) + \ - (Blend ## name (Blue (d), da, Blue (s), Blue (m))); \ + (blend_ ## name (Red (d), da, Red (s), Red (m)) << R_SHIFT) + \ + (blend_ ## name (Green (d), da, Green (s), Green (m)) << G_SHIFT) + \ + (blend_ ## name (Blue (d), da, Blue (s), Blue (m))); \ \ *(dest + i) = result; \ } \ @@ -465,12 +465,12 @@ fbCombine ## name ## C (pixman_implementation_t *imp, pixman_op_t op, \ */ static inline comp4_t -BlendScreen (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_Screen (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { return DivOne (sca * da + dca * sa - sca * dca); } -PdfSeparableBlendMode (Screen) +PDF_SEPARABLE_BLEND_MODE (Screen) /* * Overlay @@ -482,7 +482,7 @@ PdfSeparableBlendMode (Screen) */ static inline comp4_t -BlendOverlay (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_Overlay (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { comp4_t rca; @@ -493,7 +493,7 @@ BlendOverlay (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) return DivOne (rca); } -PdfSeparableBlendMode (Overlay) +PDF_SEPARABLE_BLEND_MODE (Overlay) /* * Darken @@ -501,7 +501,7 @@ PdfSeparableBlendMode (Overlay) */ static inline comp4_t -BlendDarken (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_Darken (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { comp4_t s, d; @@ -510,7 +510,7 @@ BlendDarken (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) return DivOne (s > d ? d : s); } -PdfSeparableBlendMode (Darken) +PDF_SEPARABLE_BLEND_MODE (Darken) /* * Lighten @@ -518,7 +518,7 @@ PdfSeparableBlendMode (Darken) */ static inline comp4_t -BlendLighten (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_Lighten (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { comp4_t s, d; @@ -527,7 +527,7 @@ BlendLighten (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) return DivOne (s > d ? s : d); } -PdfSeparableBlendMode (Lighten) +PDF_SEPARABLE_BLEND_MODE (Lighten) /* * Color dodge @@ -539,7 +539,7 @@ PdfSeparableBlendMode (Lighten) */ static inline comp4_t -BlendColorDodge (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_ColorDodge (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { if (sca >= sa) { return DivOne (sa * da); @@ -549,7 +549,7 @@ BlendColorDodge (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) } } -PdfSeparableBlendMode (ColorDodge) +PDF_SEPARABLE_BLEND_MODE (ColorDodge) /* * Color burn @@ -561,7 +561,7 @@ PdfSeparableBlendMode (ColorDodge) */ static inline comp4_t -BlendColorBurn (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_ColorBurn (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { if (sca == 0) { return 0; @@ -572,7 +572,7 @@ BlendColorBurn (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) } } -PdfSeparableBlendMode (ColorBurn) +PDF_SEPARABLE_BLEND_MODE (ColorBurn) /* * Hard light @@ -583,7 +583,7 @@ PdfSeparableBlendMode (ColorBurn) * Sa.Da - 2.(Da - Dca).(Sa - Sca) */ static inline comp4_t -BlendHardLight (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_HardLight (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { if (2 * sca < sa) return DivOne (2 * sca * dca); @@ -591,7 +591,7 @@ BlendHardLight (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) return DivOne (sa * da - 2 * (da - dca) * (sa - sca)); } -PdfSeparableBlendMode (HardLight) +PDF_SEPARABLE_BLEND_MODE (HardLight) /* * Soft light @@ -605,7 +605,7 @@ PdfSeparableBlendMode (HardLight) */ static inline comp4_t -BlendSoftLight (comp4_t dca_org, comp4_t da_org, comp4_t sca_org, comp4_t sa_org) +blend_SoftLight (comp4_t dca_org, comp4_t da_org, comp4_t sca_org, comp4_t sa_org) { double dca = dca_org * (1.0 / MASK); double da = da_org * (1.0 / MASK); @@ -628,7 +628,7 @@ BlendSoftLight (comp4_t dca_org, comp4_t da_org, comp4_t sca_org, comp4_t sa_org return rca * MASK + 0.5; } -PdfSeparableBlendMode (SoftLight) +PDF_SEPARABLE_BLEND_MODE (SoftLight) /* * Difference @@ -636,7 +636,7 @@ PdfSeparableBlendMode (SoftLight) */ static inline comp4_t -BlendDifference (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_Difference (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { comp4_t dcasa = dca * sa; comp4_t scada = sca * da; @@ -647,7 +647,7 @@ BlendDifference (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) return DivOne (scada - dcasa); } -PdfSeparableBlendMode (Difference) +PDF_SEPARABLE_BLEND_MODE (Difference) /* * Exclusion @@ -655,21 +655,21 @@ PdfSeparableBlendMode (Difference) */ /* This can be made faster by writing it directly and not using - * PdfSeparableBlendMode, but that's a performance optimization */ + * PDF_SEPARABLE_BLEND_MODE, but that's a performance optimization */ static inline comp4_t -BlendExclusion (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) +blend_Exclusion (comp4_t dca, comp4_t da, comp4_t sca, comp4_t sa) { return DivOne (sca * da + dca * sa - 2 * dca * sca); } -PdfSeparableBlendMode (Exclusion) +PDF_SEPARABLE_BLEND_MODE (Exclusion) -#undef PdfSeparableBlendMode +#undef PDF_SEPARABLE_BLEND_MODE /* * PDF nonseperable blend modes are implemented using the following functions - * to operate in HSL space, with Cmax, Cmid, Cmin referring to the max, mid + * to operate in Hsl space, with Cmax, Cmid, Cmin referring to the max, mid * and min value of the red, green and blue components. * * Lum (C) = 0.3 × Cred + 0.59 × Cgreen + 0.11 × Cblue @@ -779,7 +779,7 @@ PdfSeparableBlendMode (Exclusion) #define Lum(c) ((c[0] * 30 + c[1] * 59 + c[2] * 11) / 100) #define Sat(c) (Max (c) - Min (c)) -#define PdfNonSeparableBlendMode(name) \ +#define PDF_NON_SEPARABLE_BLEND_MODE(name) \ static void \ fbCombine ## name ## U (pixman_implementation_t *imp, pixman_op_t op, \ comp4_t *dest, const comp4_t *src, const comp4_t *mask, int width) \ @@ -803,7 +803,7 @@ fbCombine ## name ## U (pixman_implementation_t *imp, pixman_op_t op, \ sc[1] = Green (s); \ dc[2] = Blue (d); \ sc[2] = Blue (s); \ - Blend ## name (c, dc, da, sc, sa); \ + blend_ ## name (c, dc, da, sc, sa); \ \ *(dest + i) = result + \ (DivOne (sa * da) << A_SHIFT) + \ @@ -902,7 +902,7 @@ SetSat (comp4_t dest[3], comp4_t src[3], comp4_t sat) * B(Cb, Cs) = SetLum (SetSat (Cs, Sat (Cb)), Lum (Cb)) */ static inline void -BlendHSLHue (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) +blend_HslHue (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) { c[0] = sc[0] * da; c[1] = sc[1] * da; @@ -911,14 +911,14 @@ BlendHSLHue (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) SetLum (c, c, sa * da, Lum (dc) * sa); } -PdfNonSeparableBlendMode (HSLHue) +PDF_NON_SEPARABLE_BLEND_MODE (HslHue) /* * Saturation: * B(Cb, Cs) = SetLum (SetSat (Cb, Sat (Cs)), Lum (Cb)) */ static inline void -BlendHSLSaturation (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) +blend_HslSaturation (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) { c[0] = dc[0] * sa; c[1] = dc[1] * sa; @@ -927,14 +927,14 @@ BlendHSLSaturation (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp SetLum (c, c, sa * da, Lum (dc) * sa); } -PdfNonSeparableBlendMode (HSLSaturation) +PDF_NON_SEPARABLE_BLEND_MODE (HslSaturation) /* * Color: * B(Cb, Cs) = SetLum (Cs, Lum (Cb)) */ static inline void -BlendHSLColor (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) +blend_HslColor (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) { c[0] = sc[0] * da; c[1] = sc[1] * da; @@ -942,14 +942,14 @@ BlendHSLColor (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t s SetLum (c, c, sa * da, Lum (dc) * sa); } -PdfNonSeparableBlendMode (HSLColor) +PDF_NON_SEPARABLE_BLEND_MODE (HslColor) /* * Luminosity: * B(Cb, Cs) = SetLum (Cb, Lum (Cs)) */ static inline void -BlendHSLLuminosity (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) +blend_HslLuminosity (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp4_t sa) { c[0] = dc[0] * sa; c[1] = dc[1] * sa; @@ -957,13 +957,13 @@ BlendHSLLuminosity (comp4_t c[3], comp4_t dc[3], comp4_t da, comp4_t sc[3], comp SetLum (c, c, sa * da, Lum (sc) * da); } -PdfNonSeparableBlendMode (HSLLuminosity) +PDF_NON_SEPARABLE_BLEND_MODE (HslLuminosity) #undef Sat #undef Lum #undef Max #undef Min -#undef PdfNonSeparableBlendMode +#undef PDF_NON_SEPARABLE_BLEND_MODE /* Overlay * @@ -1951,10 +1951,10 @@ _pixman_setup_combiner_functions_width (pixman_implementation_t *imp) imp->combine_width[PIXMAN_OP_SOFT_LIGHT] = fbCombineSoftLightU; imp->combine_width[PIXMAN_OP_DIFFERENCE] = fbCombineDifferenceU; imp->combine_width[PIXMAN_OP_EXCLUSION] = fbCombineExclusionU; - imp->combine_width[PIXMAN_OP_HSL_HUE] = fbCombineHSLHueU; - imp->combine_width[PIXMAN_OP_HSL_SATURATION] = fbCombineHSLSaturationU; - imp->combine_width[PIXMAN_OP_HSL_COLOR] = fbCombineHSLColorU; - imp->combine_width[PIXMAN_OP_HSL_LUMINOSITY] = fbCombineHSLLuminosityU; + imp->combine_width[PIXMAN_OP_HSL_HUE] = fbCombineHslHueU; + imp->combine_width[PIXMAN_OP_HSL_SATURATION] = fbCombineHslSaturationU; + imp->combine_width[PIXMAN_OP_HSL_COLOR] = fbCombineHslColorU; + imp->combine_width[PIXMAN_OP_HSL_LUMINOSITY] = fbCombineHslLuminosityU; /* Component alpha combiners */ imp->combine_width_ca[PIXMAN_OP_CLEAR] = fbCombineClearC; diff --git a/pixman/pixman-conical-gradient.c b/pixman/pixman-conical-gradient.c index c73be56..cff58d4 100644 --- a/pixman/pixman-conical-gradient.c +++ b/pixman/pixman-conical-gradient.c @@ -123,7 +123,7 @@ static void conical_gradient_property_changed (pixman_image_t *image) { image->common.get_scanline_32 = conical_gradient_get_scanline_32; - image->common.get_scanline_64 = _pixman_image_get_scanline_64_generic; + image->common.get_scanline_64 = _pixman_image_get_scanline_generic_64; } PIXMAN_EXPORT pixman_image_t * diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c index c569f0b..a61dd91 100644 --- a/pixman/pixman-cpu.c +++ b/pixman/pixman-cpu.c @@ -292,7 +292,7 @@ pixman_have_arm_neon (void) enum CPUFeatures { NoFeatures = 0, MMX = 0x1, - MMX_Extensions = 0x2, + MMX_EXTENSIONS = 0x2, SSE = 0x6, SSE2 = 0x8, CMOV = 0x10 @@ -309,7 +309,7 @@ static unsigned int detectCPUFeatures(void) { if (result & AV_386_MMX) features |= MMX; if (result & AV_386_AMD_MMX) - features |= MMX_Extensions; + features |= MMX_EXTENSIONS; if (result & AV_386_SSE) features |= SSE; if (result & AV_386_SSE2) @@ -453,7 +453,7 @@ static unsigned int detectCPUFeatures(void) { } #endif if (result & (1<<22)) - features |= MMX_Extensions; + features |= MMX_EXTENSIONS; } } #endif /* HAVE_GETISAX */ @@ -470,7 +470,7 @@ pixman_have_mmx (void) if (!initialized) { unsigned int features = detectCPUFeatures(); - mmx_present = (features & (MMX|MMX_Extensions)) == (MMX|MMX_Extensions); + mmx_present = (features & (MMX|MMX_EXTENSIONS)) == (MMX|MMX_EXTENSIONS); initialized = TRUE; } @@ -487,7 +487,7 @@ pixman_have_sse2 (void) if (!initialized) { unsigned int features = detectCPUFeatures(); - sse2_present = (features & (MMX|MMX_Extensions|SSE|SSE2)) == (MMX|MMX_Extensions|SSE|SSE2); + sse2_present = (features & (MMX|MMX_EXTENSIONS|SSE|SSE2)) == (MMX|MMX_EXTENSIONS|SSE|SSE2); initialized = TRUE; } diff --git a/pixman/pixman-edge-imp.h b/pixman/pixman-edge-imp.h index 79826f2..1687c0b 100644 --- a/pixman/pixman-edge-imp.h +++ b/pixman/pixman-edge-imp.h @@ -80,24 +80,24 @@ rasterizeEdges (pixman_image_t *image, { #ifdef WORDS_BIGENDIAN -# define FbScrLeft(x,n) ((x) << (n)) +# define SCREEN_SHIFT_LEFT(x,n) ((x) << (n)) # define FbScrRight(x,n) ((x) >> (n)) #else -# define FbScrLeft(x,n) ((x) >> (n)) +# define SCREEN_SHIFT_LEFT(x,n) ((x) >> (n)) # define FbScrRight(x,n) ((x) << (n)) #endif -#define FbLeftMask(x) \ +#define LEFT_MASK(x) \ (((x) & 0x1f) ? \ FbScrRight (0xffffffff, (x) & 0x1f) : 0) -#define FbRightMask(x) \ +#define RIGHT_MASK(x) \ (((32 - (x)) & 0x1f) ? \ - FbScrLeft (0xffffffff, (32 - (x)) & 0x1f) : 0) + SCREEN_SHIFT_LEFT (0xffffffff, (32 - (x)) & 0x1f) : 0) #define FbMaskBits(x,w,l,n,r) { \ n = (w); \ - r = FbRightMask ((x) + n); \ - l = FbLeftMask (x); \ + r = RIGHT_MASK ((x) + n); \ + l = LEFT_MASK (x); \ if (l) { \ n -= 32 - ((x) & 0x1f); \ if (n < 0) { \ diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index a956c24..ea2d1b2 100644 --- a/pixman/pixman-fast-path.c +++ b/pixman/pixman-fast-path.c @@ -29,7 +29,7 @@ #include "pixman-combine32.h" static force_inline uint32_t -Fetch24 (uint8_t *a) +fetch_24 (uint8_t *a) { if (((unsigned long)a) & 1) { @@ -50,7 +50,7 @@ Fetch24 (uint8_t *a) } static force_inline void -Store24 (uint8_t *a, uint32_t v) +store_24 (uint8_t *a, uint32_t v) { if (((unsigned long)a) & 1) { @@ -459,15 +459,15 @@ fast_CompositeOver_n_8_0888 (pixman_implementation_t *imp, d = src; else { - d = Fetch24(dst); + d = fetch_24(dst); d = fbOver (src, d); } - Store24(dst, d); + store_24(dst, d); } else if (m) { - d = fbOver (fbIn(src,m), Fetch24(dst)); - Store24(dst, d); + d = fbOver (fbIn(src,m), fetch_24(dst)); + store_24(dst, d); } dst += 3; } @@ -523,15 +523,15 @@ fast_CompositeOver_n_8_0565 (pixman_implementation_t *imp, else { d = *dst; - d = fbOver (src, cvt0565to0888(d)); + d = fbOver (src, CONVERT_0565_TO_0888(d)); } - *dst = cvt8888to0565(d); + *dst = CONVERT_8888_TO_0565(d); } else if (m) { d = *dst; - d = fbOver (fbIn(src,m), cvt0565to0888(d)); - *dst = cvt8888to0565(d); + d = fbOver (fbIn(src,m), CONVERT_0565_TO_0888(d)); + *dst = CONVERT_8888_TO_0565(d); } dst++; } @@ -567,7 +567,7 @@ fast_CompositeOver_n_8888_0565_ca (pixman_implementation_t *imp, if (src == 0) return; - src16 = cvt8888to0565(src); + src16 = CONVERT_8888_TO_0565(src); fbComposeGetStart (dst_image, xDst, yDst, uint16_t, dstStride, dstLine, 1); fbComposeGetStart (mask_image, xMask, yMask, uint32_t, maskStride, maskLine, 1); @@ -592,21 +592,21 @@ fast_CompositeOver_n_8888_0565_ca (pixman_implementation_t *imp, else { d = *dst; - d = fbOver (src, cvt0565to0888(d)); - *dst = cvt8888to0565(d); + d = fbOver (src, CONVERT_0565_TO_0888(d)); + *dst = CONVERT_8888_TO_0565(d); } } else if (ma) { d = *dst; - d = cvt0565to0888(d); + d = CONVERT_0565_TO_0888(d); FbByteMulC (src, ma); FbByteMul (ma, srca); ma = ~ma; FbByteMulAddC (d, ma, src); - *dst = cvt8888to0565(d); + *dst = CONVERT_8888_TO_0565(d); } dst++; } @@ -700,9 +700,9 @@ fast_CompositeSrc_8888_0888 (pixman_implementation_t *imp, if (a == 0xff) d = s; else - d = fbOver (s, Fetch24(dst)); + d = fbOver (s, fetch_24(dst)); - Store24(dst, d); + store_24(dst, d); } dst += 3; } @@ -753,9 +753,9 @@ fast_composite_over_8888_0565 (pixman_implementation_t *imp, else { d = *dst; - d = fbOver (s, cvt0565to0888(d)); + d = fbOver (s, CONVERT_0565_TO_0888(d)); } - *dst = cvt8888to0565(d); + *dst = CONVERT_8888_TO_0565(d); } dst++; } @@ -796,7 +796,7 @@ fast_CompositeSrc_x888_0565 (pixman_implementation_t *imp, while (w--) { s = *src++; - *dst = cvt8888to0565(s); + *dst = CONVERT_8888_TO_0565(s); dst++; } } @@ -983,7 +983,7 @@ fast_CompositeSolidFill (pixman_implementation_t *imp, src = src >> 24; else if (dst_image->bits.format == PIXMAN_r5g6b5 || dst_image->bits.format == PIXMAN_b5g6r5) - src = cvt8888to0565 (src); + src = CONVERT_8888_TO_0565 (src); pixman_fill (dst_image->bits.bits, dst_image->bits.rowstride, PIXMAN_FORMAT_BPP (dst_image->bits.format), diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index 32b83d3..bc1bbc7 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -63,7 +63,7 @@ _pixman_init_gradient (gradient_t *gradient, * depth, but that's a project for the future. */ void -_pixman_image_get_scanline_64_generic (pixman_image_t * pict, int x, int y, +_pixman_image_get_scanline_generic_64 (pixman_image_t * pict, int x, int y, int width, uint32_t *buffer, const uint32_t *mask, uint32_t maskBits) { diff --git a/pixman/pixman-linear-gradient.c b/pixman/pixman-linear-gradient.c index f01c62c..f5c9a5a 100644 --- a/pixman/pixman-linear-gradient.c +++ b/pixman/pixman-linear-gradient.c @@ -220,7 +220,7 @@ static void linear_gradient_property_changed (pixman_image_t *image) { image->common.get_scanline_32 = linear_gradient_get_scanline_32; - image->common.get_scanline_64 = _pixman_image_get_scanline_64_generic; + image->common.get_scanline_64 = _pixman_image_get_scanline_generic_64; } PIXMAN_EXPORT pixman_image_t * diff --git a/pixman/pixman-matrix.c b/pixman/pixman-matrix.c index 79dae8d..dda6214 100644 --- a/pixman/pixman-matrix.c +++ b/pixman/pixman-matrix.c @@ -301,58 +301,58 @@ within_epsilon(pixman_fixed_t a, pixman_fixed_t b, pixman_fixed_t epsilon) #define epsilon (pixman_fixed_t) (2) -#define is_same(a,b) (within_epsilon(a, b, epsilon)) -#define is_zero(a) (within_epsilon(a, 0, epsilon)) -#define is_one(a) (within_epsilon(a, F(1), epsilon)) -#define is_unit(a) (within_epsilon(a, F( 1), epsilon) || \ +#define IS_SAME(a,b) (within_epsilon(a, b, epsilon)) +#define IS_ZERO(a) (within_epsilon(a, 0, epsilon)) +#define IS_ONE(a) (within_epsilon(a, F(1), epsilon)) +#define IS_UNIT(a) (within_epsilon(a, F( 1), epsilon) || \ within_epsilon(a, F(-1), epsilon) || \ - is_zero(a)) -#define is_int(a) (is_zero(pixman_fixed_frac(a))) + IS_ZERO(a)) +#define IS_INT(a) (IS_ZERO(pixman_fixed_frac(a))) PIXMAN_EXPORT pixman_bool_t pixman_transform_is_identity(const struct pixman_transform *t) { - return ( is_same(t->matrix[0][0], t->matrix[1][1]) && - is_same(t->matrix[0][0], t->matrix[2][2]) && - !is_zero(t->matrix[0][0]) && - is_zero(t->matrix[0][1]) && - is_zero(t->matrix[0][2]) && - is_zero(t->matrix[1][0]) && - is_zero(t->matrix[1][2]) && - is_zero(t->matrix[2][0]) && - is_zero(t->matrix[2][1])); + return ( IS_SAME(t->matrix[0][0], t->matrix[1][1]) && + IS_SAME(t->matrix[0][0], t->matrix[2][2]) && + !IS_ZERO(t->matrix[0][0]) && + IS_ZERO(t->matrix[0][1]) && + IS_ZERO(t->matrix[0][2]) && + IS_ZERO(t->matrix[1][0]) && + IS_ZERO(t->matrix[1][2]) && + IS_ZERO(t->matrix[2][0]) && + IS_ZERO(t->matrix[2][1])); } PIXMAN_EXPORT pixman_bool_t pixman_transform_is_scale(const struct pixman_transform *t) { - return (!is_zero(t->matrix[0][0]) && - is_zero(t->matrix[0][1]) && - is_zero(t->matrix[0][2]) && + return (!IS_ZERO(t->matrix[0][0]) && + IS_ZERO(t->matrix[0][1]) && + IS_ZERO(t->matrix[0][2]) && - is_zero(t->matrix[1][0]) && - !is_zero(t->matrix[1][1]) && - is_zero(t->matrix[1][2]) && + IS_ZERO(t->matrix[1][0]) && + !IS_ZERO(t->matrix[1][1]) && + IS_ZERO(t->matrix[1][2]) && - is_zero(t->matrix[2][0]) && - is_zero(t->matrix[2][1]) && - !is_zero(t->matrix[2][2])); + IS_ZERO(t->matrix[2][0]) && + IS_ZERO(t->matrix[2][1]) && + !IS_ZERO(t->matrix[2][2])); } PIXMAN_EXPORT pixman_bool_t pixman_transform_is_int_translate(const struct pixman_transform *t) { - return (is_one (t->matrix[0][0]) && - is_zero(t->matrix[0][1]) && - is_int (t->matrix[0][2]) && + return (IS_ONE (t->matrix[0][0]) && + IS_ZERO(t->matrix[0][1]) && + IS_INT (t->matrix[0][2]) && - is_zero(t->matrix[1][0]) && - is_one (t->matrix[1][1]) && - is_int (t->matrix[1][2]) && + IS_ZERO(t->matrix[1][0]) && + IS_ONE (t->matrix[1][1]) && + IS_INT (t->matrix[1][2]) && - is_zero(t->matrix[2][0]) && - is_zero(t->matrix[2][1]) && - is_one (t->matrix[2][2])); + IS_ZERO(t->matrix[2][0]) && + IS_ZERO(t->matrix[2][1]) && + IS_ONE (t->matrix[2][2])); } PIXMAN_EXPORT pixman_bool_t diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index f051552..5339881 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -196,7 +196,7 @@ void _pixman_bits_image_setup_raw_accessors (bits_image_t *image); void -_pixman_image_get_scanline_64_generic (pixman_image_t *pict, +_pixman_image_get_scanline_generic_64 (pixman_image_t *pict, int x, int y, int width, @@ -621,10 +621,10 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst, /* Conversion between 8888 and 0565 */ -#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \ +#define CONVERT_8888_TO_0565(s) ((((s) >> 3) & 0x001f) | \ (((s) >> 5) & 0x07e0) | \ (((s) >> 8) & 0xf800)) -#define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \ +#define CONVERT_0565_TO_0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \ ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \ ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000))) diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c index 00fdae0..ced8213 100644 --- a/pixman/pixman-radial-gradient.c +++ b/pixman/pixman-radial-gradient.c @@ -273,7 +273,7 @@ static void radial_gradient_property_changed (pixman_image_t *image) { image->common.get_scanline_32 = radial_gradient_get_scanline_32; - image->common.get_scanline_64 = _pixman_image_get_scanline_64_generic; + image->common.get_scanline_64 = _pixman_image_get_scanline_generic_64; } PIXMAN_EXPORT pixman_image_t * diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c index 0801267..1359fcd 100644 --- a/pixman/pixman-solid-fill.c +++ b/pixman/pixman-solid-fill.c @@ -51,7 +51,7 @@ static void solid_fill_property_changed (pixman_image_t *image) { image->common.get_scanline_32 = solid_fill_get_scanline_32; - image->common.get_scanline_64 = _pixman_image_get_scanline_64_generic; + image->common.get_scanline_64 = _pixman_image_get_scanline_generic_64; } static uint32_t diff --git a/pixman/pixman.c b/pixman/pixman.c index 0c984f7..0bd5e0b 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -223,7 +223,7 @@ color_to_pixel (pixman_color_t *color, c = c >> 24; else if (format == PIXMAN_r5g6b5 || format == PIXMAN_b5g6r5) - c = cvt8888to0565 (c); + c = CONVERT_8888_TO_0565 (c); #if 0 printf ("color: %x %x %x %x\n", color->alpha, color->red, color->green, color->blue); -- 2.7.4