[mutter] background: Fix gradient color rendering
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] background: Fix gradient color rendering
- Date: Thu, 28 Feb 2013 18:17:43 +0000 (UTC)
commit e623406c994e5ed9a55de525fedcde0c23f5f197
Author: Ray Strode <rstrode redhat com>
Date: Thu Feb 21 22:07:43 2013 -0500
background: Fix gradient color rendering
There is currently code to try to fill gradients in a
hardware native format, using #ifdefs. That optimization is
unimportant since gradients only use 2 byte buffers. It's
also incorrect because it's getting the channel order wrong
at buffer initialization time.
This commit drops the ifdefs for clarity and fixes the
channel order.
https://bugzilla.gnome.org/show_bug.cgi?id=694641
src/compositor/meta-background.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index b24a8be..82164d6 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -33,12 +33,6 @@
#include <meta/meta-background.h>
#include "meta-background-actor-private.h"
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
-#define TEXTURE_FORMAT COGL_PIXEL_FORMAT_BGRA_8888_PRE
-#else
-#define TEXTURE_FORMAT COGL_PIXEL_FORMAT_ARGB_8888_PRE
-#endif
-
#define TEXTURE_LOOKUP_SHADER_DECLARATIONS \
"uniform vec2 pixel_step;\n" \
"vec4 apply_blur(in sampler2D texture, in vec2 coordinates) {\n" \
@@ -932,9 +926,10 @@ meta_background_load_gradient (MetaBackground *self,
pixels[5] = second_color->green;
pixels[6] = second_color->blue;
pixels[7] = second_color->alpha;
+
texture = cogl_texture_new_from_data (width, height,
COGL_TEXTURE_NO_SLICING,
- TEXTURE_FORMAT,
+ COGL_PIXEL_FORMAT_RGBA_8888,
COGL_PIXEL_FORMAT_ANY,
4,
pixels);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]