[mutter/wip/carlosg/performance-improvements: 13/13] clutter: Avoid rounding compensation when invalidating 2D actors



commit d2cbd2f488274790a10755174383f52d9d7eb72b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri May 5 14:15:30 2017 +0200

    clutter: Avoid rounding compensation when invalidating 2D actors
    
    This allows the redraw clip to be more constrained, so MetaCullable doesn't
    end up rendering portions of window shadows, frame and background when a
    window invalidates (part of) its contents.

 clutter/clutter/clutter-paint-volume.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c
index b48f7f9..d6d603d 100644
--- a/clutter/clutter/clutter-paint-volume.c
+++ b/clutter/clutter/clutter-paint-volume.c
@@ -1166,6 +1166,17 @@ _clutter_paint_volume_get_stage_paint_box (ClutterPaintVolume *pv,
 
   _clutter_paint_volume_get_bounding_box (&projected_pv, box);
 
+  if (pv->is_2d && pv->actor &&
+      clutter_actor_get_z_position (pv->actor) == 0)
+    {
+      /* If the volume/actor are perfectly 2D, take the bounding box as
+       * good. We won't need to add any extra room for sub-pixel positioning
+       * in this case.
+       */
+      clutter_paint_volume_free (&projected_pv);
+      return;
+    }
+
   /* The aim here is that for a given rectangle defined with floating point
    * coordinates we want to determine a stable quantized size in pixels
    * that doesn't vary due to the original box's sub-pixel position.


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