diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-05-30 18:26:28 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2010-06-18 20:33:02 -0400 |
commit | 66365b5ef1bb85863669227ae6e31134d8d57013 (patch) | |
tree | 297508ae08b7eaccecafbccebdf5cf035a259675 | |
parent | 4e1d4847c9199f96b73376bef061c6728742e621 (diff) |
Make separate gray scanline storers.
For gray formats the palettes are indexed by luminance, not RGB, so we
can't use the color storers for gray too.
-rw-r--r-- | pixman/pixman-access.c | 40 | ||||
-rw-r--r-- | test/blitters-test.c | 2 |
2 files changed, 38 insertions, 4 deletions
diff --git a/pixman/pixman-access.c b/pixman/pixman-access.c index 9f2af26..9708b10 100644 --- a/pixman/pixman-access.c +++ b/pixman/pixman-access.c @@ -2385,6 +2385,22 @@ store_scanline_c8 (bits_image_t * image, } static void +store_scanline_g8 (bits_image_t * image, + int x, + int y, + int width, + const uint32_t *values) +{ + uint32_t *bits = image->bits + image->rowstride * y; + uint8_t *pixel = ((uint8_t *) bits) + x; + const pixman_indexed_t *indexed = image->indexed; + int i; + + for (i = 0; i < width; ++i) + WRITE (image, pixel++, RGB24_TO_ENTRY_Y (indexed,values[i])); +} + +static void store_scanline_x4a4 (bits_image_t * image, int x, int y, @@ -2555,6 +2571,26 @@ store_scanline_c4 (bits_image_t * image, } static void +store_scanline_g4 (bits_image_t * image, + int x, + int y, + int width, + const uint32_t *values) +{ + uint32_t *bits = image->bits + image->rowstride * y; + const pixman_indexed_t *indexed = image->indexed; + int i; + + for (i = 0; i < width; ++i) + { + uint32_t pixel; + + pixel = RGB24_TO_ENTRY_Y (indexed, values[i]); + STORE_4 (image, bits, i + x, pixel); + } +} + +static void store_scanline_a1 (bits_image_t * image, int x, int y, @@ -2746,7 +2782,6 @@ static const format_info_t accessors[] = #define fetch_scanline_g8 fetch_scanline_c8 #define fetch_pixel_g8 fetch_pixel_c8 -#define store_scanline_g8 store_scanline_c8 FORMAT_INFO (g8), #define fetch_scanline_x4c4 fetch_scanline_c8 @@ -2756,7 +2791,7 @@ static const format_info_t accessors[] = #define fetch_scanline_x4g4 fetch_scanline_c8 #define fetch_pixel_x4g4 fetch_pixel_c8 -#define store_scanline_x4g4 store_scanline_c8 +#define store_scanline_x4g4 store_scanline_g8 FORMAT_INFO (x4g4), FORMAT_INFO (x4a4), @@ -2772,7 +2807,6 @@ static const format_info_t accessors[] = #define fetch_scanline_g4 fetch_scanline_c4 #define fetch_pixel_g4 fetch_pixel_c4 -#define store_scanline_g4 store_scanline_c4 FORMAT_INFO (g4), /* 1bpp formats */ diff --git a/test/blitters-test.c b/test/blitters-test.c index 29c2515..2673968 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, 0xF3A16994, + return fuzzer_test_main("blitters", 2000000, 0xD09B1C03, test_composite, argc, argv); } |