gsk/vulkan/glyphcache: Ceil glyph surface size
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 1 Apr 2023 19:09:06 +0000 (16:09 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 3 Apr 2023 13:59:45 +0000 (10:59 -0300)
This is what GL does, and for a reason: it can lead to width or
height for very small glyphs. Also, switch to dividing by a float
(1024.0) instead of an integer (1024).

gsk/vulkan/gskvulkanglyphcache.c

index 15db38d9aa3c63614d84fd69214722828a6d6ee5..ab623b94455ec2a3799aeacb3657efe06f3f8683 100644 (file)
@@ -261,8 +261,8 @@ render_glyph (Atlas          *atlas,
   PangoGlyphInfo gi;
 
   surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
-                                        value->draw_width * key->scale / 1024,
-                                        value->draw_height * key->scale / 1024);
+                                        ceil (value->draw_width * key->scale / 1024.0),
+                                        ceil (value->draw_height * key->scale / 1024.0));
   cairo_surface_set_device_scale (surface, key->scale / 1024.0, key->scale / 1024.0);
 
   cr = cairo_create (surface);