[mutter] shaped-texture: Invert transform of damage in update_area()



commit d52081bed47f38d0e242eed3a998ceaaf4d26f17
Author: Robert Mader <robert mader posteo de>
Date:   Fri Dec 21 17:13:38 2018 +0100

    shaped-texture: Invert transform of damage in update_area()
    
    Transformed textures need to transform back the damage area, which
    is given in buffer coordinates, with the inverted transform.
    
    Fixes https://gitlab.gnome.org/GNOME/mutter/issues/419
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/366

 src/compositor/meta-shaped-texture.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 38105e766..9d0005aec 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -27,7 +27,9 @@
 
 #include "config.h"
 
+#include "backends/meta-monitor-transform.h"
 #include "compositor/meta-shaped-texture-private.h"
+#include "core/boxes-private.h"
 
 #include <gdk/gdk.h>
 
@@ -886,12 +888,32 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
                                 int                height)
 {
   cairo_region_t *unobscured_region;
-  const cairo_rectangle_int_t clip = { x, y, width, height };
+  cairo_rectangle_int_t clip;
+  MetaMonitorTransform inverted_transform;
 
   if (stex->texture == NULL)
     return FALSE;
 
-  meta_texture_tower_update_area (stex->paint_tower, x, y, width, height);
+  clip = (cairo_rectangle_int_t) {
+    .x = x,
+    .y = y,
+    .width = width,
+    .height = height
+  };
+
+  inverted_transform = meta_monitor_transform_invert (stex->transform);
+  ensure_size_valid (stex);
+  meta_rectangle_transform (&clip,
+                            inverted_transform,
+                            stex->dst_width,
+                            stex->dst_height,
+                            &clip);
+
+  meta_texture_tower_update_area (stex->paint_tower,
+                                  clip.x,
+                                  clip.y,
+                                  clip.width,
+                                  clip.height);
 
   stex->prev_invalidation = stex->last_invalidation;
   stex->last_invalidation = g_get_monotonic_time ();


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