[mutter] clutter/offscreen-effect: Unscale first, then translate the FBO texture
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/offscreen-effect: Unscale first, then translate the FBO texture
- Date: Tue, 2 Feb 2021 10:03:47 +0000 (UTC)
commit f887b02714f3b0d27409ed05a623790cd0340c32
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Tue Dec 15 16:41:30 2020 +0800
clutter/offscreen-effect: Unscale first, then translate the FBO texture
We had been doing it backwards as far back as e3966882e8 which meant
that we were translating by `fbo_offset / resource_scale` stage units
instead of just `fbo_offset`.
Because `fbo_offset` is in stage units already, it's not scaled and so
needs to be applied after the unscaling from texels to stage units.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1053>
clutter/clutter/clutter-offscreen-effect.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index 42e5238c44..6f599670cb 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -436,19 +436,14 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
{
ClutterOffscreenEffectPrivate *priv = effect->priv;
graphene_matrix_t transform;
- float resource_scale;
-
- graphene_matrix_init_translate (&transform,
- &GRAPHENE_POINT3D_INIT (priv->fbo_offset_x,
- priv->fbo_offset_y,
- 0.0f));
-
- resource_scale = clutter_actor_get_resource_scale (priv->actor);
- if (resource_scale != 1.0f)
- {
- float paint_scale = 1.0f / resource_scale;
- graphene_matrix_scale (&transform, paint_scale, paint_scale, 1.f);
- }
+ float unscale;
+
+ unscale = 1.0 / clutter_actor_get_resource_scale (priv->actor);
+ graphene_matrix_init_scale (&transform, unscale, unscale, 1.0);
+ graphene_matrix_translate (&transform,
+ &GRAPHENE_POINT3D_INIT (priv->fbo_offset_x,
+ priv->fbo_offset_y,
+ 0.0));
if (!graphene_matrix_is_identity (&transform))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]