[mutter] wayland-tablet-tool: Downscale the sprite texture in FB mode



commit ceb4fe2151a7dd7aa8232c736cf9248983ceae8e
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Tue Feb 12 03:05:38 2019 +0100

    wayland-tablet-tool: Downscale the sprite texture in FB mode
    
    When using scaled framebuffer we need to downscale the texture size in order
    to get the cursor properly drawn at its real size and in good quality.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765011
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/3

 src/wayland/meta-wayland-tablet-tool.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 222b46633..ffc05a63a 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -398,8 +398,20 @@ tool_cursor_prepare_at (MetaCursorSpriteXcursor *sprite_xcursor,
 
   /* Reload the cursor texture if the scale has changed. */
   if (logical_monitor)
-    meta_cursor_sprite_xcursor_set_theme_scale (sprite_xcursor,
-                                                logical_monitor->scale);
+    {
+      MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_xcursor);
+      float ceiled_scale;
+
+      ceiled_scale = ceilf (logical_monitor->scale);
+      meta_cursor_sprite_xcursor_set_theme_scale (sprite_xcursor,
+                                                  (int) ceiled_scale);
+
+      if (meta_is_stage_views_scaled ())
+        meta_cursor_sprite_set_texture_scale (cursor_sprite,
+                                              1.0 / ceiled_scale);
+      else
+        meta_cursor_sprite_set_texture_scale (cursor_sprite, 1.0);
+    }
 }
 
 MetaWaylandTabletTool *


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