[mutter/gnome-3-38] shaped-texture: Viewport update calculation fixes



commit 1db75bebc941dc6aceeba85cd532c240476d644c
Author: Robert Mader <robert mader posteo de>
Date:   Thu Mar 18 13:37:57 2021 +0100

    shaped-texture: Viewport update calculation fixes
    
    If only a viewport destination size is set, the noop viewport has
    to take the buffer scale into account.
    
    If a viewport source but no viewport destination size is set, the
    destination size is that of the viewport source, not of the whole
    texture.
    
    
    (cherry picked from commit 52547cb9ea6bf5ea3a64780f17a71cb8af1cb458)
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1808>

 src/compositor/meta-shaped-texture.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index a8e8216dbf..c37ebe8f31 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -1027,8 +1027,8 @@ meta_shaped_texture_update_area (MetaShapedTexture     *stex,
           viewport = (graphene_rect_t) {
             .origin.x = 0,
             .origin.y = 0,
-            .size.width = stex->tex_width,
-            .size.height = stex->tex_height,
+            .size.width = stex->tex_width / stex->buffer_scale,
+            .size.height = stex->tex_height / stex->buffer_scale,
           };
         }
 
@@ -1039,8 +1039,8 @@ meta_shaped_texture_update_area (MetaShapedTexture     *stex,
         }
       else
         {
-          dst_width = (float) stex->tex_width;
-          dst_height = (float) stex->tex_height;
+          dst_width = (float) viewport.size.width;
+          dst_height = (float) viewport.size.height;
         }
 
       inverted_viewport = (graphene_rect_t) {


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