[Pixman] [PATCH] When storing a g1 pixel, store the lowest bit of the palette.

Søren Sandmann Pedersen sandmann at daimi.au.dk
Thu Jun 10 14:58:28 PDT 2010


From: Søren Sandmann Pedersen <ssp at redhat.com>

Previously we would store 1 if the value in the palette was different
from 0, and 0 otherwise. However, other indexed formats ignore the
upper bits and simply mask them out.
---
 pixman/pixman-access.c |    2 +-
 test/blitters-test.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c
index 809cc38..9f2af26 100644
--- a/pixman/pixman-access.c
+++ b/pixman/pixman-access.c
@@ -2601,7 +2601,7 @@ store_scanline_g1 (bits_image_t *  image,
 #else
 	mask = 1 << ((i + x) & 0x1f);
 #endif
-	v = RGB24_TO_ENTRY_Y (indexed, values[i]) ? mask : 0;
+	v = RGB24_TO_ENTRY_Y (indexed, values[i]) & 0x1 ? mask : 0;
 	
 	WRITE (image, pixel, (READ (image, pixel) & ~mask) | v);
     }
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 673e52f..29c2515 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -426,6 +426,6 @@ main (int argc, const char *argv[])
 {
     initialize_palette();
 
-    return fuzzer_test_main("blitters", 2000000, 0x2CFE57ED,
+    return fuzzer_test_main("blitters", 2000000, 0xF3A16994,
 			    test_composite, argc, argv);
 }
-- 
1.6.0.6



More information about the Pixman mailing list