From 04851e4210d2d71542359c14d4b68d0851b36326 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 3 Apr 2012 12:34:24 +0100 Subject: sna/gen3: Convert the clear-color from picture->format to a8r8g8b8 The shaders treat colours as an argb value, however the clear color is stored in the pixmap's native format (a8, r5g6b5, x8r8g8b8 etc). So before using the value of the clear color as a solid we need to convert it into the a8r8g8b8 format. Reported-by: Clemens Eisserer Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48204 Reported-by: Paul Neumann Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47308 Signed-off-by: Chris Wilson --- src/sna/sna_render.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sna/sna_render.h') diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h index 73ef5680..9c49281d 100644 --- a/src/sna/sna_render.h +++ b/src/sna/sna_render.h @@ -485,6 +485,12 @@ sna_render_get_gradient(struct sna *sna, uint32_t sna_rgba_for_color(uint32_t color, int depth); uint32_t sna_rgba_to_color(uint32_t rgba, uint32_t format); +Bool sna_get_rgba_from_pixel(uint32_t pixel, + uint16_t *red, + uint16_t *green, + uint16_t *blue, + uint16_t *alpha, + uint32_t format); Bool sna_picture_is_solid(PicturePtr picture, uint32_t *color); void no_render_init(struct sna *sna); -- cgit v1.2.3