[mutter/gnome-3-28] compositor: Do not optimize obscured areas away in paint volumes



commit 03dfcbab6787423850d90fe48a1ef62baf606c7d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Apr 28 18:10:49 2018 +0200

    compositor: Do not optimize obscured areas away in paint volumes
    
    This optimization was presumably added before Clutter was able to
    invalidate selected regions of an actor. Paint volumes are supposed
    to be invariable as long as the actor conditions don't change.
    Stacking of other actors shouldn't affect the paint volume, so it's
    actually wrong to optimize those areas away here.
    
    (cherry picked from commit ec8138773a417976a260619099a1649306a0a495)

 src/compositor/meta-shaped-texture.c | 37 +-----------------------------------
 1 file changed, 1 insertion(+), 36 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 98346c6ae..bc9c7a6df 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -632,46 +632,11 @@ effective_unobscured_region (MetaShapedTexture *self)
   return priv->unobscured_region;
 }
 
-static gboolean
-get_unobscured_bounds (MetaShapedTexture     *self,
-                       cairo_rectangle_int_t *unobscured_bounds)
-{
-  cairo_region_t *unobscured_region = effective_unobscured_region (self);
-
-  if (unobscured_region)
-    {
-      cairo_region_get_extents (unobscured_region, unobscured_bounds);
-      return TRUE;
-    }
-  else
-    return FALSE;
-}
-
 static gboolean
 meta_shaped_texture_get_paint_volume (ClutterActor *actor,
                                       ClutterPaintVolume *volume)
 {
-  MetaShapedTexture *self = META_SHAPED_TEXTURE (actor);
-  ClutterActorBox box;
-  cairo_rectangle_int_t unobscured_bounds;
-
-  if (!clutter_actor_has_allocation (actor))
-    return FALSE;
-
-  clutter_actor_get_allocation_box (actor, &box);
-
-  if (get_unobscured_bounds (self, &unobscured_bounds))
-    {
-      box.x1 = MAX (unobscured_bounds.x, box.x1);
-      box.x2 = MIN (unobscured_bounds.x + unobscured_bounds.width, box.x2);
-      box.y1 = MAX (unobscured_bounds.y, box.y1);
-      box.y2 = MIN (unobscured_bounds.y + unobscured_bounds.height, box.y2);
-    }
-  box.x2 = MAX (box.x2, box.x1);
-  box.y2 = MAX (box.y2, box.y1);
-
-  clutter_paint_volume_union_box (volume, &box);
-  return TRUE;
+  return clutter_paint_volume_set_from_allocation (volume, actor);
 }
 
 void


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