Implement fbStore_a2g2b2r2
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Sun, 21 Jun 2009 23:38:57 +0000 (19:38 -0400)
committerSøren Sandmann Pedersen <sandmann@redhat.com>
Mon, 22 Jun 2009 02:36:14 +0000 (22:36 -0400)
pixman/pixman-access.c

index ab615f8..b5ce6a2 100644 (file)
@@ -2121,6 +2121,21 @@ fbStore_a2r2g2b2 (pixman_image_t *image,
 }
 
 static void
+fbStore_a2b2g2r2 (pixman_image_t *image,
+                 uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed)
+{
+    int i;
+    uint8_t   *pixel = ((uint8_t *) bits) + x;
+    for (i = 0; i < width; ++i) {
+       Splita(values[i]);
+       *(pixel++) =  ((a     ) & 0xc0) |
+           ((b >> 2) & 0x30) |
+           ((g >> 4) & 0x0c) |
+           ((r >> 6)       );
+    }
+}
+
+static void
 fbStore_c8 (pixman_image_t *image,
            uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed)
 {
@@ -2268,7 +2283,6 @@ fbStore_g1 (pixman_image_t *image,
     {
        uint32_t  *pixel = ((uint32_t *) bits) + ((i+x) >> 5);
        uint32_t  mask, v;
-
 #ifdef WORDS_BIGENDIAN
        mask = 1 << (0x1f - ((i+x) & 0x1f));
 #else
@@ -2392,10 +2406,7 @@ static const format_info_t accessors[] =
     FORMAT_INFO (r3g3b2),
     FORMAT_INFO (b2g3r3),
     FORMAT_INFO (a2r2g2b2),
-#if 0
-    /* FIXME */
     FORMAT_INFO (a2b2g2r2),
-#endif
     
     FORMAT_INFO (c8),