From 233d8907ed02d6624f458dd40c9db46055fc7630 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Mon, 22 Jun 2009 06:51:04 -0400 Subject: [PATCH] Various minor changes - Add underscores to the pixman_image_get_solid(), pixman_image_is_solid(), and pixman_is_opaque() names. - A number of formatting fixes - Move debug code to the end of pixman-private.h - Collect all prototypes for image methods in one place --- pixman/pixman-arm-neon.c | 10 +- pixman/pixman-arm-simd.c | 4 +- pixman/pixman-bits-image.c | 11 +- pixman/pixman-edge.c | 3 + pixman/pixman-fast-path.c | 16 +-- pixman/pixman-image.c | 6 +- pixman/pixman-mmx.c | 22 ++-- pixman/pixman-private.h | 283 ++++++++++++++++++++++++--------------------- pixman/pixman-sse2.c | 22 ++-- pixman/pixman-trap.c | 1 - pixman/pixman-utils.c | 4 +- pixman/pixman-vmx.c | 4 +- pixman/pixman.c | 4 +- 13 files changed, 209 insertions(+), 181 deletions(-) diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c index c33a2ef..866c707 100644 --- a/pixman/pixman-arm-neon.c +++ b/pixman/pixman-arm-neon.c @@ -461,7 +461,7 @@ fbCompositeSrc_8888x8x8888neon ( fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - pixman_image_get_solid (pMask, mask, pDst->bits.format); + _pixman_image_get_solid (pMask, mask, pDst->bits.format); mask_alpha = vdup_n_u8((mask) >> 24); if (width>=8) @@ -658,7 +658,7 @@ fbCompositeSolidMask_nx8x8888neon ( uint8x8_t mask_selector=vreinterpret_u8_u64(vcreate_u64(0x0101010100000000ULL)); uint8x8_t alpha_selector=vreinterpret_u8_u64(vcreate_u64(0x0707070703030303ULL)); - pixman_image_get_solid(pSrc, src, pDst->bits.format); + _pixman_image_get_solid(pSrc, src, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -863,7 +863,7 @@ fbCompositeSrcAdd_8888x8x8neon ( fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - pixman_image_get_solid (pSrc, src, pDst->bits.format); + _pixman_image_get_solid (pSrc, src, pDst->bits.format); sa = vdup_n_u8((src) >> 24); if (width>=8) @@ -1734,7 +1734,7 @@ fbCompositeSolidMask_nx8x0565neon ( uint32_t kernelCount, copyCount; uint8_t kernelOffset, copyOffset; - pixman_image_get_solid(pSrc, src, pDst->bits.format); + _pixman_image_get_solid(pSrc, src, pDst->bits.format); // bail out if fully transparent or degenerate srca = src >> 24; @@ -1875,7 +1875,7 @@ fbCompositeSolid_nx0565neon ( uint32_t kernelCount, copyCount; uint8_t kernelOffset, copyOffset; - pixman_image_get_solid(pSrc, src, pDst->bits.format); + _pixman_image_get_solid(pSrc, src, pDst->bits.format); // bail out if fully transparent srca = src >> 24; diff --git a/pixman/pixman-arm-simd.c b/pixman/pixman-arm-simd.c index 2030657..01b017d 100644 --- a/pixman/pixman-arm-simd.c +++ b/pixman/pixman-arm-simd.c @@ -219,7 +219,7 @@ fbCompositeSrc_8888x8x8888arm ( fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - pixman_image_get_solid (pMask, mask, pDst->bits.format); + _pixman_image_get_solid (pMask, mask, pDst->bits.format); mask = (mask) >> 24; while (height--) @@ -323,7 +323,7 @@ fbCompositeSolidMask_nx8x8888arm ( int dstStride, maskStride; uint16_t w; - pixman_image_get_solid(pSrc, src, pDst->bits.format); + _pixman_image_get_solid(pSrc, src, pDst->bits.format); srca = src >> 24; if (src == 0) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index b60b659..911f05d 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -41,7 +41,9 @@ /* Store functions */ static void -bits_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, uint32_t *buffer) +bits_image_store_scanline_32 (bits_image_t *image, + int x, int y, + int width, uint32_t *buffer) { uint32_t *bits; int32_t stride; @@ -62,7 +64,9 @@ bits_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, uint } static void -bits_image_store_scanline_64 (bits_image_t *image, int x, int y, int width, uint32_t *buffer) +bits_image_store_scanline_64 (bits_image_t *image, + int x, int y, + int width, uint32_t *buffer) { uint32_t *bits; int32_t stride; @@ -360,7 +364,8 @@ bits_image_fetch_bilinear_pixels (bits_image_t *image, uint32_t *buffer, int n_p * a list of pixels on output */ static void -bits_image_fetch_convolution_pixels (bits_image_t *image, uint32_t *buffer, int n_pixels) +bits_image_fetch_convolution_pixels (bits_image_t *image, + uint32_t *buffer, int n_pixels) { uint32_t tmp_pixels_stack[N_TMP_PIXELS * 2]; /* Two coordinates per pixel */ uint32_t *tmp_pixels = tmp_pixels_stack; diff --git a/pixman/pixman-edge.c b/pixman/pixman-edge.c index de86ed3..e69a8a1 100644 --- a/pixman/pixman-edge.c +++ b/pixman/pixman-edge.c @@ -28,6 +28,9 @@ #include "pixman-private.h" +/* + * Step across a small sample grid gap + */ #define RenderEdgeStepSmall(edge) { \ edge->x += edge->stepx_small; \ edge->e += edge->dx_small; \ diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c index 35065ce..49c1d4c 100644 --- a/pixman/pixman-fast-path.c +++ b/pixman/pixman-fast-path.c @@ -151,7 +151,7 @@ fbCompositeSolidMaskIn_nx8x8 (pixman_implementation_t *imp, uint16_t w; uint16_t t; - src = pixman_image_get_solid(iSrc, iDst->bits.format); + src = _pixman_image_get_solid(iSrc, iDst->bits.format); srca = src >> 24; @@ -281,7 +281,7 @@ fbCompositeSolidMask_nx8x8888 (pixman_implementation_t *imp, int dstStride, maskStride; uint16_t w; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -340,7 +340,7 @@ fbCompositeSolidMask_nx8888x8888C (pixman_implementation_t *imp, uint16_t w; uint32_t m, n, o, p; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -413,7 +413,7 @@ fbCompositeSolidMask_nx8x0888 (pixman_implementation_t *imp, int dstStride, maskStride; uint16_t w; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -476,7 +476,7 @@ fbCompositeSolidMask_nx8x0565 (pixman_implementation_t *imp, int dstStride, maskStride; uint16_t w; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -542,7 +542,7 @@ fbCompositeSolidMask_nx8888x0565C (pixman_implementation_t *imp, uint16_t w; uint32_t m, n, o; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -913,7 +913,7 @@ fbCompositeSrcAdd_8888x8x8 (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - src = pixman_image_get_solid (pSrc, pDst->bits.format); + src = _pixman_image_get_solid (pSrc, pDst->bits.format); sa = (src >> 24); while (height--) @@ -963,7 +963,7 @@ fbCompositeSolidFill (pixman_implementation_t *imp, { uint32_t src; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (pDst->bits.format == PIXMAN_a8) src = src >> 24; diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c index ad17f47..3a0d0f8 100644 --- a/pixman/pixman-image.c +++ b/pixman/pixman-image.c @@ -508,7 +508,7 @@ pixman_image_get_depth (pixman_image_t *image) } pixman_bool_t -pixman_image_is_solid (pixman_image_t *image) +_pixman_image_is_solid (pixman_image_t *image) { if (image->type == SOLID) return TRUE; @@ -527,7 +527,7 @@ pixman_image_is_solid (pixman_image_t *image) } uint32_t -pixman_image_get_solid (pixman_image_t *image, pixman_format_code_t format) +_pixman_image_get_solid (pixman_image_t *image, pixman_format_code_t format) { uint32_t result; @@ -546,7 +546,7 @@ pixman_image_get_solid (pixman_image_t *image, pixman_format_code_t format) } pixman_bool_t -pixman_image_is_opaque (pixman_image_t *image) +_pixman_image_is_opaque (pixman_image_t *image) { int i; diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 0909124..4ad2f3d 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -940,7 +940,7 @@ fbCompositeSolid_nx8888mmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (src >> 24 == 0) return; @@ -1019,7 +1019,7 @@ fbCompositeSolid_nx0565mmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (src >> 24 == 0) return; @@ -1105,7 +1105,7 @@ fbCompositeSolidMask_nx8888x8888Cmmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (srca == 0) @@ -1214,7 +1214,7 @@ fbCompositeSrc_8888x8x8888mmx (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - mask = pixman_image_get_solid (pMask, pDst->bits.format); + mask = _pixman_image_get_solid (pMask, pDst->bits.format); mask = mask | mask >> 8 | mask >> 16 | mask >> 24; vmask = load8888 (mask); srca = MC(4x00ff); @@ -1298,7 +1298,7 @@ fbCompositeSrc_x888xnx8888mmx (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - mask = pixman_image_get_solid (pMask, pDst->bits.format); + mask = _pixman_image_get_solid (pMask, pDst->bits.format); mask = mask | mask >> 8 | mask >> 16 | mask >> 24; vmask = load8888 (mask); @@ -1586,7 +1586,7 @@ fbCompositeSolidMask_nx8x8888mmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (srca == 0) @@ -1858,7 +1858,7 @@ fbCompositeSolidMaskSrc_nx8x8888mmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (srca == 0) @@ -1990,7 +1990,7 @@ fbCompositeSolidMask_nx8x0565mmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (srca == 0) @@ -2343,7 +2343,7 @@ fbCompositeSolidMask_nx8888x0565Cmmx (pixman_implementation_t *imp, CHECKPOINT(); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (srca == 0) @@ -2454,7 +2454,7 @@ fbCompositeIn_nx8x8mmx (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); sa = src >> 24; if (sa == 0) @@ -2604,7 +2604,7 @@ fbCompositeSrcAdd_8888x8x8mmx (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); sa = src >> 24; if (sa == 0) diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index 4d0c385..beb9292 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -11,54 +11,6 @@ #include "pixman-compiler.h" -#undef DEBUG -#define DEBUG 0 - -#if DEBUG - -#define return_if_fail(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \ - return; \ - } \ - } \ - while (0) - -#define return_val_if_fail(expr, retval) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \ - return (retval); \ - } \ - } \ - while (0) - -#else - -#define return_if_fail(expr) \ - do \ - { \ - if (!(expr)) \ - return; \ - } \ - while (0) - -#define return_val_if_fail(expr, retval) \ - do \ - { \ - if (!(expr)) \ - return (retval); \ - } \ - while (0) - -#endif - - /* * Images */ @@ -74,27 +26,33 @@ typedef struct radial_gradient radial_gradient_t; typedef struct bits_image bits_image_t; typedef struct circle circle_t; -typedef void (*fetchProc32) (bits_image_t *pict, int x, int y, int width, +typedef void (*fetchProc32) (bits_image_t *pict, + int x, int y, int width, uint32_t *buffer); -typedef uint32_t (*fetchPixelProc32) (bits_image_t *pict, int offset, int line); +typedef uint32_t (*fetchPixelProc32) (bits_image_t *pict, + int offset, int line); typedef void (*storeProc32) (pixman_image_t *, uint32_t *bits, - const uint32_t *values, int x, int width); -typedef void (*fetchProc64) (bits_image_t *pict, int x, int y, int width, + const uint32_t *values, + int x, int width); +typedef void (*fetchProc64) (bits_image_t *pict, + int x, int y, int width, uint64_t *buffer); -typedef uint64_t (*fetchPixelProc64) (bits_image_t *pict, int offset, int line); +typedef uint64_t (*fetchPixelProc64) (bits_image_t *pict, + int offset, int line); typedef void (*storeProc64) (pixman_image_t *, uint32_t *bits, - const uint64_t *values, int x, int width); -typedef void (*fetch_pixels_32_t) (bits_image_t *image, uint32_t *buffer, int n_pixels); -typedef void (*fetch_pixels_64_t) (bits_image_t *image, uint64_t *buffer, int n_pixels); -typedef void (*scanStoreProc) (bits_image_t *img, int x, int y, int width, uint32_t *buffer); -typedef void (*scanFetchProc) (pixman_image_t *, int, int, int, uint32_t *, + const uint64_t *values, + int x, int width); +typedef void (*fetch_pixels_32_t) (bits_image_t *image, + uint32_t *buffer, int n_pixels); +typedef void (*fetch_pixels_64_t) (bits_image_t *image, + uint64_t *buffer, int n_pixels); +typedef void (*scanStoreProc) (bits_image_t *img, + int x, int y, int width, + uint32_t *buffer); +typedef void (*scanFetchProc) (pixman_image_t *, + int, int, int, uint32_t *, uint32_t *, uint32_t); -void _pixman_bits_image_setup_raw_accessors (bits_image_t *image); - -void _pixman_image_get_scanline_64_generic (pixman_image_t * pict, int x, int y, int width, - uint64_t *buffer, uint64_t *mask, uint32_t maskBits); - typedef enum { BITS, @@ -111,47 +69,6 @@ typedef enum SOURCE_IMAGE_CLASS_VERTICAL, } source_pict_class_t; -source_pict_class_t -_pixman_image_classify (pixman_image_t *image, - int x, - int y, - int width, - int height); - -void -_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width, - uint32_t *buffer, uint32_t *mask, uint32_t mask_bits); - -/* Even thought the type of buffer is uint32_t *, the function actually expects - * a uint64_t *buffer. - */ -void -_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width, - uint32_t *buffer, uint32_t *unused, uint32_t unused2); - -void -_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, - uint32_t *buffer); -void -_pixman_image_fetch_pixels (bits_image_t *image, uint32_t *buffer, int n_pixels); - -/* Even thought the type of buffer is uint32_t *, the function actually expects - * a uint64_t *buffer. - */ -void -_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width, - uint32_t *buffer); - -pixman_image_t * -_pixman_image_allocate (void); - -pixman_bool_t -_pixman_init_gradient (gradient_t *gradient, - const pixman_gradient_stop_t *stops, - int n_stops); -void -_pixman_image_reset_clip_region (pixman_image_t *image); - typedef source_pict_class_t (* classify_func_t) (pixman_image_t *image, int x, int y, @@ -165,7 +82,8 @@ struct image_common int32_t ref_count; pixman_region32_t clip_region; pixman_bool_t have_clip_region; /* FALSE if there is no clip */ - pixman_bool_t client_clip; /* Whether the source clip was set by a client */ + pixman_bool_t client_clip; /* Whether the source clip was + set by a client */ pixman_bool_t clip_sources; /* Whether the clip applies when * the image is used as a source */ @@ -289,6 +207,73 @@ union pixman_image solid_fill_t solid; }; + +void +_pixman_bits_image_setup_raw_accessors (bits_image_t *image); + +void +_pixman_image_get_scanline_64_generic (pixman_image_t *pict, + int x, + int y, + int width, + uint64_t *buffer, + uint64_t *mask, + uint32_t maskBits); + +source_pict_class_t +_pixman_image_classify (pixman_image_t *image, + int x, + int y, + int width, + int height); + +void +_pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width, + uint32_t *buffer, uint32_t *mask, + uint32_t mask_bits); + +/* Even thought the type of buffer is uint32_t *, the function actually expects + * a uint64_t *buffer. + */ +void +_pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width, + uint32_t *buffer, + uint32_t *unused, uint32_t unused2); + +void +_pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width, + uint32_t *buffer); +void +_pixman_image_fetch_pixels (bits_image_t *image, uint32_t *buffer, + int n_pixels); + +/* Even thought the type of buffer is uint32_t *, the function actually expects + * a uint64_t *buffer. + */ +void +_pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width, + uint32_t *buffer); + +pixman_image_t * +_pixman_image_allocate (void); + +pixman_bool_t +_pixman_init_gradient (gradient_t *gradient, + const pixman_gradient_stop_t *stops, + int n_stops); +void +_pixman_image_reset_clip_region (pixman_image_t *image); + +pixman_bool_t +_pixman_image_is_opaque(pixman_image_t *image); + +pixman_bool_t +_pixman_image_is_solid (pixman_image_t *image); + +uint32_t +_pixman_image_get_solid (pixman_image_t *image, + pixman_format_code_t format); + /* * Gradient walker */ @@ -459,9 +444,6 @@ _pixman_gradient_walker_pixel (pixman_gradient_walker_t *walker, #define RenderSamplesX(x,n) ((n) == 1 ? 0 : (pixman_fixed_frac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n)) -/* - * Step across a small sample grid gap - */ void pixman_rasterize_edges_accessors (pixman_image_t *image, pixman_edge_t *l, @@ -469,16 +451,6 @@ pixman_rasterize_edges_accessors (pixman_image_t *image, pixman_fixed_t t, pixman_fixed_t b); -pixman_bool_t -pixman_image_is_opaque(pixman_image_t *image); - -pixman_bool_t -pixman_image_is_solid (pixman_image_t *image); - -uint32_t -pixman_image_get_solid (pixman_image_t *image, - pixman_format_code_t format); - /* * Implementations */ @@ -742,15 +714,20 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst, pixman_region32_t *src); -/* - * Various useful macros - */ #ifndef FALSE -#define FALSE 0 +# define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +# define TRUE 1 +#endif + +#ifndef MIN +# define MIN(a,b) ((a < b)? a : b) +#endif + +#ifndef MAX +# define MAX(a,b) ((a > b)? a : b) #endif /* Integer division that rounds towards -infinity */ @@ -760,22 +737,66 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst, /* Modulus that produces the remainder wrt. DIV */ #define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b)) -#define CLIP(a,b,c) ((a) < (b) ? (b) : ((a) > (c) ? (c) : (a))) +#define CLIP(v,low,high) ((v) < (low) ? (low) : ((v) > (high) ? (high) : (high))) -#ifndef MIN -# define MIN(a,b) ((a < b)? a : b) -#endif -#ifndef MAX -# define MAX(a,b) ((a > b)? a : b) -#endif +/* + * Various debugging code + */ +#undef DEBUG +#define DEBUG 0 + +#if DEBUG + +#define return_if_fail(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \ + return; \ + } \ + } \ + while (0) + +#define return_val_if_fail(expr, retval) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \ + return (retval); \ + } \ + } \ + while (0) + +#else + +#define return_if_fail(expr) \ + do \ + { \ + if (!(expr)) \ + return; \ + } \ + while (0) + +#define return_val_if_fail(expr, retval) \ + do \ + { \ + if (!(expr)) \ + return (retval); \ + } \ + while (0) + +#endif -#ifdef PIXMAN_TIMERS /* * Timers */ +#ifdef PIXMAN_TIMERS + static inline uint64_t oil_profile_stamp_rdtsc (void) { diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 00a2a26..d39beae 100644 --- a/pixman/pixman-sse2.c +++ b/pixman/pixman-sse2.c @@ -2517,7 +2517,7 @@ fbCompositeSolid_nx8888sse2 (pixman_implementation_t *imp, __m128i xmmSrc, xmmAlpha; __m128i xmmDst, xmmDstLo, xmmDstHi; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (src == 0) return; @@ -2604,7 +2604,7 @@ fbCompositeSolid_nx0565sse2 (pixman_implementation_t *imp, __m128i xmmSrc, xmmAlpha; __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (src == 0) return; @@ -2699,7 +2699,7 @@ fbCompositeSolidMask_nx8888x8888Csse2 (pixman_implementation_t *imp, __m64 mmxSrc, mmxAlpha, mmxMask, mmxDst; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (src == 0) return; @@ -2834,7 +2834,7 @@ fbCompositeSrc_8888x8x8888sse2 (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - mask = pixman_image_get_solid (pMask, pDst->bits.format); + mask = _pixman_image_get_solid (pMask, pDst->bits.format); xmmMask = createMask_16_128 (mask >> 24); @@ -2946,7 +2946,7 @@ fbCompositeSrc_x888xnx8888sse2 (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1); fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1); - mask = pixman_image_get_solid (pMask, pDst->bits.format); + mask = _pixman_image_get_solid (pMask, pDst->bits.format); xmmMask = createMask_16_128 (mask >> 24); xmmAlpha = Mask00ff; @@ -3223,7 +3223,7 @@ fbCompositeSolidMask_nx8x8888sse2 (pixman_implementation_t *imp, __m64 mmxSrc, mmxAlpha, mmxMask, mmxDest; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -3498,7 +3498,7 @@ fbCompositeSolidMaskSrc_nx8x8888sse2 (pixman_implementation_t *imp, __m128i xmmSrc, xmmDef; __m128i xmmMask, xmmMaskLo, xmmMaskHi; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -3636,7 +3636,7 @@ fbCompositeSolidMask_nx8x0565sse2 (pixman_implementation_t *imp, __m128i xmmMask, xmmMaskLo, xmmMaskHi; __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); srca = src >> 24; if (src == 0) @@ -4037,7 +4037,7 @@ fbCompositeSolidMask_nx8888x0565Csse2 (pixman_implementation_t *imp, __m64 mmxSrc, mmxAlpha, mmxMask, mmxDest; - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); if (src == 0) return; @@ -4186,7 +4186,7 @@ fbCompositeIn_nx8x8sse2 (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); sa = src >> 24; if (sa == 0) @@ -4380,7 +4380,7 @@ fbCompositeSrcAdd_8888x8x8sse2 (pixman_implementation_t *imp, fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1); fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1); - src = pixman_image_get_solid(pSrc, pDst->bits.format); + src = _pixman_image_get_solid(pSrc, pDst->bits.format); sa = src >> 24; if (sa == 0) diff --git a/pixman/pixman-trap.c b/pixman/pixman-trap.c index 3e88f8c..f832c8d 100644 --- a/pixman/pixman-trap.c +++ b/pixman/pixman-trap.c @@ -27,7 +27,6 @@ #include #include "pixman-private.h" - /* * Compute the smallest value no less than y which is on a * grid row diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c index ff3d322..89ad346 100644 --- a/pixman/pixman-utils.c +++ b/pixman/pixman-utils.c @@ -524,7 +524,7 @@ get_fast_path (const pixman_fast_path_t *fast_paths, if (info->op != op) continue; - if ((info->src_format == PIXMAN_solid && pixman_image_is_solid (pSrc)) || + if ((info->src_format == PIXMAN_solid && _pixman_image_is_solid (pSrc)) || (pSrc->type == BITS && info->src_format == pSrc->bits.format)) { valid_src = TRUE; @@ -603,7 +603,7 @@ _pixman_run_fast_path (const pixman_fast_path_t *paths, pixman_bool_t mask_repeat = mask && mask->common.repeat == PIXMAN_REPEAT_NORMAL; pixman_bool_t result; - if ((src->type == BITS || pixman_image_is_solid (src)) && + if ((src->type == BITS || _pixman_image_is_solid (src)) && (!mask || mask->type == BITS) && !src->common.transform && !(mask && mask->common.transform) && !(mask && mask->common.alpha_map) && !src->common.alpha_map && !dest->common.alpha_map diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c index 5a0ed50..bc07c75 100644 --- a/pixman/pixman-vmx.c +++ b/pixman/pixman-vmx.c @@ -1499,7 +1499,7 @@ fbCompositeSolid_nx8888vmx (pixman_operator_t op, uint32_t *dstLine, *dst; int dstStride; - pixman_image_get_solid (pSrc, pDst, src); + _pixman_image_get_solid (pSrc, pDst, src); if (src >> 24 == 0) return; @@ -1533,7 +1533,7 @@ fbCompositeSolid_nx0565vmx (pixman_operator_t op, uint16_t w; int dstStride; - pixman_image_get_solid (pSrc, pDst, src); + _pixman_image_get_solid (pSrc, pDst, src); if (src >> 24 == 0) return; diff --git a/pixman/pixman.c b/pixman/pixman.c index ab9c3e1..30310c4 100644 --- a/pixman/pixman.c +++ b/pixman/pixman.c @@ -85,8 +85,8 @@ pixman_optimize_operator(pixman_op_t op, pixman_image_t *pSrc, pixman_image_t *p if(!info || pMask) return op; - is_source_opaque = pixman_image_is_opaque(pSrc); - is_dest_opaque = pixman_image_is_opaque(pDst); + is_source_opaque = _pixman_image_is_opaque(pSrc); + is_dest_opaque = _pixman_image_is_opaque(pDst); if(is_source_opaque == FALSE && is_dest_opaque == FALSE) return op; -- 2.7.4