[mutter/wayland] surface-actor-wayland: Fix meta_surface_actor_wayland_is_argb32



commit 1cfaf45389e200334f91f5dbcca39400392386c8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Mar 20 17:59:22 2014 -0400

    surface-actor-wayland: Fix meta_surface_actor_wayland_is_argb32
    
    This prevents us from clipping shadows under windows for all
    apps, and loads of other fun optimizations.

 src/compositor/meta-surface-actor-wayland.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index 875dd1c..00b7666 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -83,8 +83,21 @@ meta_surface_actor_wayland_pre_paint (MetaSurfaceActor *actor)
 static gboolean
 meta_surface_actor_wayland_is_argb32 (MetaSurfaceActor *actor)
 {
-  /* XXX -- look at the SHM buffer format. */
-  return TRUE;
+  MetaShapedTexture *stex = meta_surface_actor_get_texture (actor);
+  CoglTexture *texture = meta_shaped_texture_get_texture (stex);
+
+  switch (cogl_texture_get_components (texture))
+    {
+    case COGL_TEXTURE_COMPONENTS_A:
+    case COGL_TEXTURE_COMPONENTS_RGBA:
+      return TRUE;
+    case COGL_TEXTURE_COMPONENTS_RG:
+    case COGL_TEXTURE_COMPONENTS_RGB:
+    case COGL_TEXTURE_COMPONENTS_DEPTH:
+      return FALSE;
+    default:
+      g_assert_not_reached ();
+    }
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]