[mutter/wip/surface-content: 13/18] surface-actor: Move work out of _new constructor



commit 6f3bc395ecf80747600ba17b5f3ad8c2f9cbb16e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Dec 6 14:19:32 2013 -0500

    surface-actor: Move work out of _new constructor

 src/compositor/meta-surface-actor.c |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 540c7f4..486e94e 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -67,21 +67,8 @@ meta_surface_actor_init (MetaSurfaceActor *self)
                                                    META_TYPE_SURFACE_ACTOR,
                                                    MetaSurfaceActorPrivate);
 
-  priv->texture = NULL;
-}
-
-MetaSurfaceActor *
-meta_surface_actor_new (void)
-{
-  MetaSurfaceActor *self = g_object_new (META_TYPE_SURFACE_ACTOR, NULL);
-  MetaShapedTexture *stex;
-
-  stex = META_SHAPED_TEXTURE (meta_shaped_texture_new ());
-  self->priv->texture = stex;
-
-  clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (stex));
-
-  return self;
+  priv->texture = META_SHAPED_TEXTURE (meta_shaped_texture_new ());
+  clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->texture));
 }
 
 cairo_surface_t *
@@ -183,3 +170,9 @@ meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
 {
   meta_shaped_texture_set_opaque_region (self->priv->texture, region);
 }
+
+MetaSurfaceActor *
+meta_surface_actor_new (void)
+{
+  return g_object_new (META_TYPE_SURFACE_ACTOR, NULL);
+}


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