summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-05-05 12:15:30 +0000
committerMarco Trevisan <mail@3v1n0.net>2019-01-24 17:16:44 +0000
commit56a4f33da0484778a9254e67e34cc32736585254 (patch)
tree6b5a453259f952f2a020840da036b353eeee3f64
parent0be812161e17b28c6da430b34f850e6323705683 (diff)
downloadmutter-56a4f33da0484778a9254e67e34cc32736585254.tar.gz
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. https://bugzilla.gnome.org/show_bug.cgi?id=782344 (cherry picked from commit a7df459416dc46321204c98197e4fd84724976e0)
-rw-r--r--clutter/clutter/clutter-paint-volume.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c
index b48f7f9d6..f3405138b 100644
--- a/clutter/clutter/clutter-paint-volume.c
+++ b/clutter/clutter/clutter-paint-volume.c
@@ -1166,6 +1166,21 @@ _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);
+ box->x1 = CLUTTER_NEARBYINT (box->x1);
+ box->y1 = CLUTTER_NEARBYINT (box->y1);
+ box->x2 = CLUTTER_NEARBYINT (box->x2);
+ box->y2 = CLUTTER_NEARBYINT (box->y2);
+ 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.