pixman: Branch '0.16' - 5 commits
Søren Sandmann Pedersen
sandmann at kemper.freedesktop.org
Mon Sep 28 06:01:32 PDT 2009
pixman/pixman-access.c | 30 +++++++++++++++---------------
pixman/pixman-image.c | 6 ++++--
test/blitters-test.c | 5 ++++-
test/fetch-test.c | 18 +++++++++++++++++-
4 files changed, 40 insertions(+), 19 deletions(-)
New commits:
commit b765dcb554e4328c8502433474a28af30c0bb7f3
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Mon Sep 28 08:59:11 2009 -0400
Update CRC in blitters-test for the changes in 10bpc alpha handling
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 6e1c5de..ba9900a 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -640,7 +640,7 @@ main (int argc, char *argv[])
/* Predefined value for running with all the fastpath functions
disabled. It needs to be updated every time when changes are
introduced to this program or behavior of pixman changes! */
- if (crc == 0xFE1244BF)
+ if (crc == 0x06D8EDB6)
{
printf ("blitters test passed\n");
}
commit 66f7581ccf8157777c9bfc0116858adb140ee4ca
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Sat Sep 26 13:12:14 2009 -0400
Fix fetch-test for big-endian systems.
Data narrower than 32bpp should be stored in the correct
endian. Reported by Andrea Canciani.
diff --git a/test/fetch-test.c b/test/fetch-test.c
index c41f1a6..6306a4c 100644
--- a/test/fetch-test.c
+++ b/test/fetch-test.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "pixman.h"
+#include <config.h>
#define SIZE 1024
@@ -34,8 +35,13 @@ testcase_t testcases[] = {
.format = PIXMAN_g1,
.width = 8, .height = 2,
.stride = 4,
+#ifdef WORDS_BIGENDIAN
+ .src = { 0xaa000000,
+ 0x55000000 },
+#else
.src = { 0x00000055,
0x000000aa },
+#endif
.dst = { 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000,
0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff, 0x00000000, 0x00ffffff },
.indexed = &mono_pallete,
@@ -51,14 +57,24 @@ testcase_t testcases[] = {
0x00898989, 0x00ababab, 0x00cdcdcd, 0x00efefef, },
},
#endif
+ /* FIXME: make this work on big endian */
{
.format = PIXMAN_yv12,
.width = 8, .height = 2,
.stride = 8,
+#ifdef WORDS_BIGENDIAN
+ .src = { 0x00ff00ff, 0x00ff00ff,
+ 0xff00ff00, 0xff00ff00,
+ 0x80ff8000,
+ 0x800080ff
+ },
+#else
.src = { 0xff00ff00, 0xff00ff00,
0x00ff00ff, 0x00ff00ff,
0x0080ff80,
- 0xff800080},
+ 0xff800080
+ },
+#endif
.dst = {
0xff000000, 0xffffffff, 0xffb80000, 0xffffe113,
0xff000000, 0xffffffff, 0xff0023ee, 0xff4affff,
commit 485c1f54b4abb2e1677627b713e086b45ca63eea
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Fri Sep 18 08:16:56 2009 -0400
Fix bug in blitters-test with BGRA formats.
When masking out the x bits, blitter-test would make the incorrect
assumption that the they were always in the topmost position. This is
not correct for formats of type PIXMAN_TYPE_BGRA.
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 23de6c2..6e1c5de 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -314,6 +314,9 @@ free_random_image (uint32_t initcrc,
uint32_t *data = pixman_image_get_data (img);
uint32_t mask = (1 << PIXMAN_FORMAT_DEPTH (fmt)) - 1;
+ if (PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_BGRA)
+ mask <<= (PIXMAN_FORMAT_BPP (fmt) - PIXMAN_FORMAT_DEPTH (fmt));
+
for (i = 0; i < 32; i++)
mask |= mask << (i * PIXMAN_FORMAT_BPP (fmt));
commit 8f5cca82aca953ee4d87a7d576ff67ddcab85b6a
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Fri Sep 18 09:11:04 2009 -0400
Fix alpha handling for 10 bpc formats.
These generally extracted the 2 bits of alpha, then shifted them 62
bits and replicated across 16 bits. Then they were shifted another 48
bits, making the resulting alpha channel 0.
diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index 532aa2e..d9fd38c 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -230,7 +230,7 @@ fetch_scanline_a2r10g10b10 (pixman_image_t *image,
const uint32_t *pixel = bits + x;
const uint32_t *end = pixel + width;
uint64_t *buffer = (uint64_t *)b;
-
+
while (pixel < end)
{
uint32_t p = READ (image, pixel++);
@@ -238,16 +238,16 @@ fetch_scanline_a2r10g10b10 (pixman_image_t *image,
uint64_t r = (p >> 20) & 0x3ff;
uint64_t g = (p >> 10) & 0x3ff;
uint64_t b = p & 0x3ff;
-
+
r = r << 6 | r >> 4;
g = g << 6 | g >> 4;
b = b << 6 | b >> 4;
-
- a <<= 62;
+
+ a <<= 14;
a |= a >> 2;
a |= a >> 4;
a |= a >> 8;
-
+
*buffer++ = a << 48 | r << 32 | g << 16 | b;
}
}
@@ -309,11 +309,11 @@ fetch_scanline_a2b10g10r10 (pixman_image_t *image,
g = g << 6 | g >> 4;
b = b << 6 | b >> 4;
- a <<= 62;
+ a <<= 14;
a |= a >> 2;
a |= a >> 4;
a |= a >> 8;
-
+
*buffer++ = a << 48 | r << 32 | g << 16 | b;
}
}
@@ -1115,18 +1115,18 @@ fetch_scanline_yv12 (pixman_image_t *image,
{
int16_t y, u, v;
int32_t r, g, b;
-
+
y = y_line[x + i] - 16;
u = u_line[(x + i) >> 1] - 128;
v = v_line[(x + i) >> 1] - 128;
-
+
/* R = 1.164(Y - 16) + 1.596(V - 128) */
r = 0x012b27 * y + 0x019a2e * v;
/* G = 1.164(Y - 16) - 0.813(V - 128) - 0.391(U - 128) */
g = 0x012b27 * y - 0x00d0f2 * v - 0x00647e * u;
/* B = 1.164(Y - 16) + 2.018(U - 128) */
b = 0x012b27 * y + 0x0206a2 * u;
-
+
*buffer++ = 0xff000000 |
(r >= 0 ? r < 0x1000000 ? r & 0xff0000 : 0xff0000 : 0) |
(g >= 0 ? g < 0x1000000 ? (g >> 8) & 0x00ff00 : 0x00ff00 : 0) |
@@ -1148,16 +1148,16 @@ fetch_pixel_a2r10g10b10 (bits_image_t *image,
uint64_t r = (p >> 20) & 0x3ff;
uint64_t g = (p >> 10) & 0x3ff;
uint64_t b = p & 0x3ff;
-
+
r = r << 6 | r >> 4;
g = g << 6 | g >> 4;
b = b << 6 | b >> 4;
-
- a <<= 62;
+
+ a <<= 14;
a |= a >> 2;
a |= a >> 4;
a |= a >> 8;
-
+
return a << 48 | r << 32 | g << 16 | b;
}
@@ -1197,7 +1197,7 @@ fetch_pixel_a2b10g10r10 (bits_image_t *image,
g = g << 6 | g >> 4;
b = b << 6 | b >> 4;
- a <<= 62;
+ a <<= 14;
a |= a >> 2;
a |= a >> 4;
a |= a >> 8;
commit 09a71a0dc0937264f456c246dc98830f942a6479
Author: Søren Sandmann Pedersen <sandmann at redhat.com>
Date: Thu Sep 24 05:22:33 2009 -0400
Return result from pixman_image_set_transform().
Previously it would always return TRUE, even when malloc() had failed.
diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 5831953..bba5fd6 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -312,7 +312,7 @@ pixman_image_set_transform (pixman_image_t * image,
{
{ { pixman_fixed_1, 0, 0 },
{ 0, pixman_fixed_1, 0 },
- { 0, 0, pixman_fixed_1 }}
+ { 0, 0, pixman_fixed_1 } }
};
image_common_t *common = (image_common_t *)image;
@@ -342,10 +342,12 @@ pixman_image_set_transform (pixman_image_t * image,
memcpy (common->transform, transform, sizeof(pixman_transform_t));
+ result = TRUE;
+
out:
image_property_changed (image);
- return TRUE;
+ return result;
}
PIXMAN_EXPORT void
More information about the xorg-commit
mailing list