[mutter/wayland] background: Rename visible_region to clip_region



commit daba05f6a7d63da4b7e3d9f4c65ef03931a8f772
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Tue Aug 27 16:30:39 2013 +0200

    background: Rename visible_region to clip_region
    
    This does better reflect what this region is used for.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=703332

 src/compositor/meta-background-actor-private.h |    6 ++--
 src/compositor/meta-background-actor.c         |   32 ++++++++++++------------
 src/compositor/meta-background-group-private.h |    4 +-
 src/compositor/meta-background-group.c         |   12 ++++----
 src/compositor/meta-background.c               |   10 +++---
 src/compositor/meta-window-group.c             |    3 +-
 6 files changed, 33 insertions(+), 34 deletions(-)
---
diff --git a/src/compositor/meta-background-actor-private.h b/src/compositor/meta-background-actor-private.h
index aeaf77f..9ab074e 100644
--- a/src/compositor/meta-background-actor-private.h
+++ b/src/compositor/meta-background-actor-private.h
@@ -6,9 +6,9 @@
 #include <meta/screen.h>
 #include <meta/meta-background-actor.h>
 
-void meta_background_actor_set_visible_region  (MetaBackgroundActor *self,
-                                                cairo_region_t      *visible_region);
+void meta_background_actor_set_clip_region  (MetaBackgroundActor *self,
+                                             cairo_region_t      *clip_region);
 
-cairo_region_t *meta_background_actor_get_visible_region (MetaBackgroundActor *self);
+cairo_region_t *meta_background_actor_get_clip_region (MetaBackgroundActor *self);
 
 #endif /* META_BACKGROUND_ACTOR_PRIVATE_H */
diff --git a/src/compositor/meta-background-actor.c b/src/compositor/meta-background-actor.c
index 11a044a..32b6007 100644
--- a/src/compositor/meta-background-actor.c
+++ b/src/compositor/meta-background-actor.c
@@ -44,7 +44,7 @@
 
 struct _MetaBackgroundActorPrivate
 {
-  cairo_region_t *visible_region;
+  cairo_region_t *clip_region;
 };
 
 G_DEFINE_TYPE (MetaBackgroundActor, meta_background_actor, CLUTTER_TYPE_ACTOR);
@@ -54,7 +54,7 @@ meta_background_actor_dispose (GObject *object)
 {
   MetaBackgroundActor *self = META_BACKGROUND_ACTOR (object);
 
-  meta_background_actor_set_visible_region (self, NULL);
+  meta_background_actor_set_clip_region (self, NULL);
 
   G_OBJECT_CLASS (meta_background_actor_parent_class)->dispose (object);
 }
@@ -167,17 +167,17 @@ meta_background_actor_new (void)
 }
 
 /**
- * meta_background_actor_set_visible_region:
+ * meta_background_actor_set_clip_region:
  * @self: a #MetaBackgroundActor
- * @visible_region: (allow-none): the area of the actor (in allocate-relative
+ * @clip_region: (allow-none): the area of the actor (in allocate-relative
  *   coordinates) that is visible.
  *
  * Sets the area of the background that is unobscured by overlapping windows.
  * This is used to optimize and only paint the visible portions.
  */
 void
-meta_background_actor_set_visible_region (MetaBackgroundActor *self,
-                                          cairo_region_t      *visible_region)
+meta_background_actor_set_clip_region (MetaBackgroundActor *self,
+                                       cairo_region_t      *clip_region)
 {
   MetaBackgroundActorPrivate *priv;
 
@@ -185,16 +185,16 @@ meta_background_actor_set_visible_region (MetaBackgroundActor *self,
 
   priv = self->priv;
 
-  g_clear_pointer (&priv->visible_region,
+  g_clear_pointer (&priv->clip_region,
                    (GDestroyNotify)
                    cairo_region_destroy);
 
-  if (visible_region)
-    priv->visible_region = cairo_region_copy (visible_region);
+  if (clip_region)
+    priv->clip_region = cairo_region_copy (clip_region);
 }
 
 /**
- * meta_background_actor_get_visible_region:
+ * meta_background_actor_get_clip_region:
  * @self: a #MetaBackgroundActor
  *
  * Return value (transfer full): a #cairo_region_t that represents the part of
@@ -202,16 +202,16 @@ meta_background_actor_set_visible_region (MetaBackgroundActor *self,
  * #MetaWindowActor objects.
  */
 cairo_region_t *
-meta_background_actor_get_visible_region (MetaBackgroundActor *self)
+meta_background_actor_get_clip_region (MetaBackgroundActor *self)
 {
   MetaBackgroundActorPrivate *priv = self->priv;
   ClutterActorBox content_box;
   cairo_rectangle_int_t content_area = { 0 };
-  cairo_region_t *visible_region;
+  cairo_region_t *clip_region;
 
   g_return_val_if_fail (META_IS_BACKGROUND_ACTOR (self), NULL);
 
-  if (!priv->visible_region)
+  if (!priv->clip_region)
       return NULL;
 
   clutter_actor_get_content_box (CLUTTER_ACTOR (self), &content_box);
@@ -221,8 +221,8 @@ meta_background_actor_get_visible_region (MetaBackgroundActor *self)
   content_area.width = content_box.x2 - content_box.x1;
   content_area.height = content_box.y2 - content_box.y1;
 
-  visible_region = cairo_region_create_rectangle (&content_area);
-  cairo_region_intersect (visible_region, priv->visible_region);
+  clip_region = cairo_region_create_rectangle (&content_area);
+  cairo_region_intersect (clip_region, priv->clip_region);
 
-  return visible_region;
+  return clip_region;
 }
diff --git a/src/compositor/meta-background-group-private.h b/src/compositor/meta-background-group-private.h
index 5eca268..1ee7a67 100644
--- a/src/compositor/meta-background-group-private.h
+++ b/src/compositor/meta-background-group-private.h
@@ -6,6 +6,6 @@
 #include <meta/screen.h>
 #include <meta/meta-background-group.h>
 
-void meta_background_group_set_visible_region  (MetaBackgroundGroup *self,
-                                                cairo_region_t      *visible_region);
+void meta_background_group_set_clip_region  (MetaBackgroundGroup *self,
+                                             cairo_region_t      *visible_region);
 #endif /* META_BACKGROUND_GROUP_PRIVATE_H */
diff --git a/src/compositor/meta-background-group.c b/src/compositor/meta-background-group.c
index 01dd27a..51d1685 100644
--- a/src/compositor/meta-background-group.c
+++ b/src/compositor/meta-background-group.c
@@ -62,16 +62,16 @@ meta_background_group_init (MetaBackgroundGroup *self)
 }
 
 /**
- * meta_background_group_set_visible_region:
+ * meta_background_group_set_clip_region:
  * @self: a #MetaBackgroundGroup
- * @visible_region: (allow-none): the parts of the background to paint
+ * @region: (allow-none): the parts of the background to paint
  *
  * Sets the area of the backgrounds that is unobscured by overlapping windows.
  * This is used to optimize and only paint the visible portions.
  */
 void
-meta_background_group_set_visible_region (MetaBackgroundGroup *self,
-                                          cairo_region_t      *region)
+meta_background_group_set_clip_region (MetaBackgroundGroup *self,
+                                       cairo_region_t      *region)
 {
   GList *children, *l;
 
@@ -82,7 +82,7 @@ meta_background_group_set_visible_region (MetaBackgroundGroup *self,
 
       if (META_IS_BACKGROUND_ACTOR (actor))
         {
-          meta_background_actor_set_visible_region (META_BACKGROUND_ACTOR (actor), region);
+          meta_background_actor_set_clip_region (META_BACKGROUND_ACTOR (actor), region);
         }
       else if (META_IS_BACKGROUND_GROUP (actor))
         {
@@ -92,7 +92,7 @@ meta_background_group_set_visible_region (MetaBackgroundGroup *self,
             continue;
 
           cairo_region_translate (region, -x, -y);
-          meta_background_group_set_visible_region (META_BACKGROUND_GROUP (actor), region);
+          meta_background_group_set_clip_region (META_BACKGROUND_GROUP (actor), region);
           cairo_region_translate (region, x, y);
         }
     }
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 830e1c6..6eee159 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -412,13 +412,13 @@ meta_background_paint_content (ClutterContent   *content,
    */
   if (META_IS_BACKGROUND_ACTOR (actor))
     {
-      cairo_region_t *visible_region;
-      visible_region = meta_background_actor_get_visible_region (META_BACKGROUND_ACTOR (actor));
+      cairo_region_t *clip_region;
+      clip_region = meta_background_actor_get_clip_region (META_BACKGROUND_ACTOR (actor));
 
-      if (visible_region != NULL)
+      if (clip_region != NULL)
         {
-          cairo_region_intersect (paintable_region, visible_region);
-          cairo_region_destroy (visible_region);
+          cairo_region_intersect (paintable_region, clip_region);
+          cairo_region_destroy (clip_region);
         }
     }
 
diff --git a/src/compositor/meta-window-group.c b/src/compositor/meta-window-group.c
index 4acb588..3a280a7 100644
--- a/src/compositor/meta-window-group.c
+++ b/src/compositor/meta-window-group.c
@@ -254,7 +254,6 @@ meta_window_group_paint (ClutterActor *actor)
             meta_background_group_set_clip_region (META_BACKGROUND_GROUP (child), clip_region);
           else
             meta_background_actor_set_clip_region (META_BACKGROUND_ACTOR (child), clip_region);
-
           cairo_region_translate (clip_region, x, y);
         }
     }
@@ -278,7 +277,7 @@ meta_window_group_paint (ClutterActor *actor)
       else if (META_IS_BACKGROUND_ACTOR (child))
         {
           MetaBackgroundActor *background_actor = META_BACKGROUND_ACTOR (child);
-          meta_background_actor_set_visible_region (background_actor, NULL);
+          meta_background_actor_set_clip_region (background_actor, NULL);
         }
     }
 }


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