OSDN Git Service

modetest: alpha buffers
authorRob Clark <robclark@freedesktop.org>
Sat, 12 Oct 2013 16:21:49 +0000 (12:21 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 25 Nov 2014 00:53:41 +0000 (19:53 -0500)
Make upper-left corner for RGB32 buffers translucent, for testing
blending of AR24 vs XR24.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
tests/modetest/buffers.c

index 29b520d..e725c32 100644 (file)
@@ -854,10 +854,11 @@ fill_tiles_rgb32(const struct format_info *info, unsigned char *mem,
                        div_t d = div(x+y, width);
                        uint32_t rgb32 = 0x00130502 * (d.quot >> 6)
                                       + 0x000a1120 * (d.rem >> 6);
+                       uint32_t alpha = ((y < height/2) && (x < width/2)) ? 127 : 255;
                        uint32_t color =
                                MAKE_RGBA(rgb, (rgb32 >> 16) & 0xff,
                                          (rgb32 >> 8) & 0xff, rgb32 & 0xff,
-                                         255);
+                                         alpha);
 
                        ((uint32_t *)mem)[x] = color;
                }