[mutter] surface-actor: Scale unobscured and clip region by geometry scale
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] surface-actor: Scale unobscured and clip region by geometry scale
- Date: Sun, 9 Feb 2020 12:49:07 +0000 (UTC)
commit d8b7905662bb508f1fb384ad55fd1f9e7850e788
Author: Robert Mader <robert mader posteo de>
Date: Wed Feb 5 00:14:43 2020 +0100
surface-actor: Scale unobscured and clip region by geometry scale
The local copy of the clip- and unobscured region are used to optimize
painting. To get correct results when the actor is scaled, thus "grows",
the corresponding regions have to "shrink", i.e. get scaled down.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/1036
src/compositor/meta-surface-actor.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 0871c5d4c..b7fda124f 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -77,6 +77,21 @@ effective_unobscured_region (MetaSurfaceActor *surface_actor)
return priv->unobscured_region;
}
+static cairo_region_t*
+get_scaled_region (MetaSurfaceActor *surface_actor,
+ cairo_region_t *region)
+{
+ MetaWindowActor *window_actor;
+ int geometry_scale;
+
+ window_actor = meta_window_actor_from_actor (CLUTTER_ACTOR (surface_actor));
+ geometry_scale = meta_window_actor_get_geometry_scale (window_actor);
+
+ return meta_region_scale_double (region,
+ 1.0 / geometry_scale,
+ META_ROUNDING_STRATEGY_GROW);
+}
+
static void
set_unobscured_region (MetaSurfaceActor *surface_actor,
cairo_region_t *unobscured_region)
@@ -98,7 +113,9 @@ set_unobscured_region (MetaSurfaceActor *surface_actor,
.height = height,
};
- priv->unobscured_region = cairo_region_copy (unobscured_region);
+ priv->unobscured_region =
+ get_scaled_region (surface_actor, unobscured_region);
+
cairo_region_intersect_rectangle (priv->unobscured_region, &bounds);
}
}
@@ -112,7 +129,7 @@ set_clip_region (MetaSurfaceActor *surface_actor,
g_clear_pointer (&priv->clip_region, cairo_region_destroy);
if (clip_region)
- priv->clip_region = cairo_region_copy (clip_region);
+ priv->clip_region = get_scaled_region (surface_actor, clip_region);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]