[mutter] surface-actor-wayland: Pass in a CoglTexture, as well



commit dc0437a5b55070dcbca4c254bccf1f2d5932d6f9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Aug 21 16:32:52 2014 -0400

    surface-actor-wayland: Pass in a CoglTexture, as well
    
    This makes it so that MetaSurfaceActorWayland is effectively just a
    wrapper actor around MetaShapedTexture with some extra scaling. I think
    the MetaSurfaceActor subclassing was a bad idea -- we really should have
    these abstractions in much higher levels in the stack than the
    compositor.

 src/compositor/meta-surface-actor-wayland.c |   14 +++-----------
 src/compositor/meta-surface-actor-wayland.h |    4 ++--
 src/wayland/meta-wayland-surface.c          |    2 +-
 3 files changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index f072128..ba4e517 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -183,7 +183,7 @@ meta_surface_actor_wayland_dispose (GObject *object)
 {
   MetaSurfaceActorWayland *self = META_SURFACE_ACTOR_WAYLAND (object);
 
-  meta_surface_actor_wayland_set_buffer (self, NULL);
+  meta_surface_actor_wayland_set_texture (self, NULL);
 
   G_OBJECT_CLASS (meta_surface_actor_wayland_parent_class)->dispose (object);
 }
@@ -230,18 +230,10 @@ meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
 }
 
 void
-meta_surface_actor_wayland_set_buffer (MetaSurfaceActorWayland *self,
-                                       MetaWaylandBuffer       *buffer)
+meta_surface_actor_wayland_set_texture (MetaSurfaceActorWayland *self,
+                                        CoglTexture *texture)
 {
-  MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
   MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
-  CoglTexture *texture;
-
-  if (buffer)
-    texture = buffer->texture;
-  else
-    texture = NULL;
-
   meta_shaped_texture_set_texture (stex, texture);
 }
 
diff --git a/src/compositor/meta-surface-actor-wayland.h b/src/compositor/meta-surface-actor-wayland.h
index efd4a56..ed129d7 100644
--- a/src/compositor/meta-surface-actor-wayland.h
+++ b/src/compositor/meta-surface-actor-wayland.h
@@ -58,8 +58,8 @@ GType meta_surface_actor_wayland_get_type (void);
 MetaSurfaceActor * meta_surface_actor_wayland_new (MetaWaylandSurface *surface);
 MetaWaylandSurface * meta_surface_actor_wayland_get_surface (MetaSurfaceActorWayland *self);
 
-void meta_surface_actor_wayland_set_buffer (MetaSurfaceActorWayland *self,
-                                            MetaWaylandBuffer         *buffer);
+void meta_surface_actor_wayland_set_texture (MetaSurfaceActorWayland *self,
+                                             CoglTexture *texture);
 
 double meta_surface_actor_wayland_get_scale (MetaSurfaceActorWayland *actor);
 
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index eca1c84..a2b603e 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -413,7 +413,7 @@ commit_pending_state (MetaWaylandSurface      *surface,
       if (pending->buffer)
         {
           ensure_buffer_texture (pending->buffer);
-          meta_surface_actor_wayland_set_buffer (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), 
pending->buffer);
+          meta_surface_actor_wayland_set_texture (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), 
pending->buffer->texture);
         }
     }
 


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