pixman: Branch 'master' - 3 commits
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Mon Jun 22 13:23:19 PDT 2009
pixman/pixman-access.c | 30 +++-
pixman/pixman-arm-neon.c | 10 -
pixman/pixman-arm-simd.c | 4
pixman/pixman-bits-image.c | 39 +++--
pixman/pixman-edge.c | 3
pixman/pixman-fast-path.c | 79 +++++++++--
pixman/pixman-image.c | 6
pixman/pixman-mmx.c | 22 +--
pixman/pixman-private.h | 305 ++++++++++++++++++++++-----------------------
pixman/pixman-sse2.c | 22 +--
pixman/pixman-trap.c | 1
pixman/pixman-utils.c | 4
pixman/pixman-vmx.c | 4
pixman/pixman.c | 4
14 files changed, 305 insertions(+), 228 deletions(-)
New commits:
commit ca4750be0a5ea0a6910ad9f4eed6a9989c91c230
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Mon Jun 22 08:09:11 2009 -0400
Eliminate Fetch/Store24 macros.
Replace them with inline functions in pixman-bits-image.c.
diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index a20aec4..737d492 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -209,8 +209,16 @@ fbFetch_r8g8b8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer)
const uint8_t *pixel = (const uint8_t *)bits + 3*x;
const uint8_t *end = pixel + 3*width;
while (pixel < end) {
- uint32_t b = Fetch24(pict, pixel) | 0xff000000;
- pixel += 3;
+ uint32_t b = 0xff000000;
+#ifdef WORDS_BIGENDIAN
+ b |= (READ(pict, pixel++) << 16);
+ b |= (READ(pict, pixel++) << 8);
+ b |= (READ(pict, pixel++));
+#else
+ b |= (READ(pict, pixel++));
+ b |= (READ(pict, pixel++) << 8);
+ b |= (READ(pict, pixel++) << 16);
+#endif
*buffer++ = b;
}
}
@@ -1900,9 +1908,18 @@ fbStore_r8g8b8 (pixman_image_t *image,
{
int i;
uint8_t *pixel = ((uint8_t *) bits) + 3*x;
- for (i = 0; i < width; ++i) {
- Store24(image, pixel, values[i]);
- pixel += 3;
+ for (i = 0; i < width; ++i)
+ {
+ uint32_t val = values[i];
+#ifdef WORDS_BIGENDIAN
+ WRITE(image, pixel++, (val & 0x00ff0000) >> 16);
+ WRITE(image, pixel++, (val & 0x0000ff00) >> 8);
+ WRITE(image, pixel++, (val & 0x000000ff) >> 0);
+#else
+ WRITE(image, pixel++, (val & 0x000000ff) >> 0);
+ WRITE(image, pixel++, (val & 0x0000ff00) >> 8);
+ WRITE(image, pixel++, (val & 0x00ff0000) >> 16);
+#endif
}
}
@@ -1912,7 +1929,8 @@ fbStore_b8g8r8 (pixman_image_t *image,
{
int i;
uint8_t *pixel = ((uint8_t *) bits) + 3*x;
- for (i = 0; i < width; ++i) {
+ for (i = 0; i < width; ++i)
+ {
uint32_t val = values[i];
#ifdef WORDS_BIGENDIAN
WRITE(image, pixel++, (val & 0x000000ff) >> 0);
diff --git a/pixman/pixman-fast-path.c b/pixman/pixman-fast-path.c
index 49c1d4c..4c04d60 100644
--- a/pixman/pixman-fast-path.c
+++ b/pixman/pixman-fast-path.c
@@ -29,10 +29,56 @@
#include "pixman-combine32.h"
static force_inline uint32_t
+Fetch24 (uint8_t *a)
+{
+ if (((unsigned long)a) & 1)
+ {
+#ifdef WORDS_BIGENDIAN
+ return (*a << 16) | (*(uint16_t *)(a + 1));
+#else
+ return *a | (*(uint16_t *)(a + 1) << 8);
+#endif
+ }
+ else
+ {
+#ifdef WORDS_BIGENDIAN
+ return (*(uint16_t *)a << 8) | *(a + 2);
+#else
+ return *(uint16_t *)a | (*(a + 2) << 16);
+#endif
+ }
+}
+
+static force_inline void
+Store24 (uint8_t *a, uint32_t v)
+{
+ if (((unsigned long)a) & 1)
+ {
+#ifdef WORDS_BIGENDIAN
+ *a = (uint8_t) (v >> 16);
+ *(uint16_t *)(a + 1) = (uint16_t) (v);
+#else
+ *a = (uint8_t) (v);
+ *(uint16_t *)(a + 1) = (uint16_t) (v >> 8);
+#endif
+ }
+ else
+ {
+#ifdef WORDS_BIGENDIAN
+ *(uint16_t *)a = (uint16_t)(v >> 8)
+ *(a + 2) = (uint8_t)v;
+#else
+ *(uint16_t *)a = (uint16_t)v;
+ *(a + 2) = (uint8_t)(v >> 16);
+#endif
+ }
+}
+
+static force_inline uint32_t
fbOver (uint32_t src, uint32_t dest)
{
- // dest = (dest * (255 - alpha)) / 255 + src
- uint32_t a = ~src >> 24; // 255 - alpha == 255 + (~alpha + 1) == ~alpha
+ uint32_t a = ~src >> 24;
+
FbByteMulAdd(dest, a, src);
return dest;
@@ -439,15 +485,15 @@ fbCompositeSolidMask_nx8x0888 (pixman_implementation_t *imp,
d = src;
else
{
- d = Fetch24(pDst, dst);
+ d = Fetch24(dst);
d = fbOver24 (src, d);
}
- Store24(pDst, dst,d);
+ Store24(dst, d);
}
else if (m)
{
- d = fbOver24 (fbIn(src,m), Fetch24(pDst, dst));
- Store24(pDst, dst, d);
+ d = fbOver24 (fbIn(src,m), Fetch24(dst));
+ Store24(dst, d);
}
dst += 3;
}
@@ -679,8 +725,9 @@ fbCompositeSrc_8888x0888 (pixman_implementation_t *imp,
if (a == 0xff)
d = s;
else
- d = fbOver24 (s, Fetch24(pDst, dst));
- Store24(pDst, dst, d);
+ d = fbOver24 (s, Fetch24(dst));
+
+ Store24(dst, d);
}
dst += 3;
}
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index beb9292..34775d4 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -307,28 +307,6 @@ uint32_t
_pixman_gradient_walker_pixel (pixman_gradient_walker_t *walker,
pixman_fixed_32_32_t x);
-
-
-#ifdef WORDS_BIGENDIAN
-#define Fetch24(img, a) ((unsigned long) (a) & 1 ? \
- ((READ(img, a) << 16) | READ(img, (uint16_t *) ((a)+1))) : \
- ((READ(img, (uint16_t *) (a)) << 8) | READ(img, (a)+2)))
-#define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
- (WRITE(img, a, (uint8_t) ((v) >> 16)), \
- WRITE(img, (uint16_t *) ((a)+1), (uint16_t) (v))) : \
- (WRITE(img, (uint16_t *) (a), (uint16_t) ((v) >> 8)), \
- WRITE(img, (a)+2, (uint8_t) (v))))
-#else
-#define Fetch24(img,a) ((unsigned long) (a) & 1 ? \
- (READ(img, a) | (READ(img, (uint16_t *) ((a)+1)) << 8)) : \
- (READ(img, (uint16_t *) (a)) | (READ(img, (a)+2) << 16)))
-#define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
- (WRITE(img, a, (uint8_t) (v)), \
- WRITE(img, (uint16_t *) ((a)+1), (uint16_t) ((v) >> 8))) : \
- (WRITE(img, (uint16_t *) (a), (uint16_t) (v)), \
- WRITE(img, (a)+2, (uint8_t) ((v) >> 16))))
-#endif
-
#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
#define FbIntDiv(a,b) (((uint16_t) (a) * 255) / (b))
commit e68f8bc1187785309ed3befcda1e1a211fe624e6
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Mon Jun 22 07:05:24 2009 -0400
Remove unused ACCESS macros in pixman-bits-image.c
diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c
index 911f05d..97acb0c 100644
--- a/pixman/pixman-bits-image.c
+++ b/pixman/pixman-bits-image.c
@@ -35,9 +35,6 @@
#define Green(x) (((x) >> 8) & 0xff)
#define Blue(x) ((x) & 0xff)
-#define READ_ACCESS(f) ((image->common.read_func)? f##_accessors : f)
-#define WRITE_ACCESS(f) ((image->common.write_func)? f##_accessors : f)
-
/* Store functions */
static void
@@ -167,7 +164,8 @@ bits_image_fetch_alpha_pixels (bits_image_t *image, uint32_t *buffer, int n_pixe
coords += 2;
}
- bits_image_fetch_raw_pixels (image->common.alpha_map, alpha_pixels, tmp_n_pixels);
+ bits_image_fetch_raw_pixels (image->common.alpha_map, alpha_pixels,
+ tmp_n_pixels);
bits_image_fetch_raw_pixels (image, buffer + 2 * i, tmp_n_pixels);
for (j = 0; j < tmp_n_pixels; ++j)
@@ -729,9 +727,15 @@ bits_image_fetch_untransformed_64 (bits_image_t * image,
uint64_t *buffer, void *unused, uint32_t unused2)
{
if (image->common.repeat == PIXMAN_REPEAT_NONE)
- bits_image_fetch_untransformed_repeat_none (image, FALSE, x, y, width, (uint32_t *)buffer);
+ {
+ bits_image_fetch_untransformed_repeat_none (image, FALSE, x, y,
+ width, (uint32_t *)buffer);
+ }
else
- bits_image_fetch_untransformed_repeat_normal (image, FALSE, x, y, width, (uint32_t *)buffer);
+ {
+ bits_image_fetch_untransformed_repeat_normal (image, FALSE, x, y,
+ width, (uint32_t *)buffer);
+ }
}
static void
@@ -760,8 +764,10 @@ bits_image_property_changed (pixman_image_t *image)
(bits->common.repeat == PIXMAN_REPEAT_NONE ||
bits->common.repeat == PIXMAN_REPEAT_NORMAL))
{
- image->common.get_scanline_64 = (scanFetchProc)bits_image_fetch_untransformed_64;
- image->common.get_scanline_32 = (scanFetchProc)bits_image_fetch_untransformed_32;
+ image->common.get_scanline_64 =
+ (scanFetchProc)bits_image_fetch_untransformed_64;
+ image->common.get_scanline_32 =
+ (scanFetchProc)bits_image_fetch_untransformed_32;
}
else
{
@@ -850,10 +856,10 @@ pixman_image_create_bits (pixman_format_code_t format,
image->bits.height = height;
image->bits.bits = bits;
image->bits.free_me = free_me;
+
+ /* The rowstride is stored in number of uint32_t */
+ image->bits.rowstride = rowstride_bytes / (int) sizeof (uint32_t);
- image->bits.rowstride = rowstride_bytes / (int) sizeof (uint32_t); /* we store it in number
- * of uint32_t's
- */
image->bits.indexed = NULL;
image->common.property_changed = bits_image_property_changed;
commit 233d8907ed02d6624f458dd40c9db46055fc7630
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Mon Jun 22 06:51:04 2009 -0400
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
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 <stdio.h>
#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;
More information about the xorg-commit
mailing list