From 9b5aee0d1bc714642c8d05c1eeee8763c5fd33b8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 25 Feb 2024 15:06:28 -0500 Subject: [PATCH 1/2] Cosmetics --- gsk/gpu/gskgpunodeprocessor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 47273be336..9e70da9b6e 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -2055,7 +2055,7 @@ gsk_gpu_node_processor_add_texture_scale_node (GskGpuNodeProcessor *self, guint32 descriptor; gboolean need_mipmap, need_offscreen; - need_offscreen = self->modelview != NULL || + need_offscreen = self->modelview != NULL || !graphene_vec2_equal (&self->scale, graphene_vec2_one ()); if (need_offscreen) { @@ -3054,7 +3054,7 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self, &glyph_offset); gsk_rect_scale (&GRAPHENE_RECT_INIT (-glyph_bounds.origin.x, -glyph_bounds.origin.y, gsk_gpu_image_get_width (image), gsk_gpu_image_get_height (image)), inv_scale, inv_scale, &glyph_tex_rect); - gsk_rect_scale (&GRAPHENE_RECT_INIT(0, 0, glyph_bounds.size.width, glyph_bounds.size.height), inv_scale, inv_scale, &glyph_bounds); + gsk_rect_scale (&GRAPHENE_RECT_INIT (0, 0, glyph_bounds.size.width, glyph_bounds.size.height), inv_scale, inv_scale, &glyph_bounds); glyph_origin = GRAPHENE_POINT_INIT (glyph_origin.x - glyph_offset.x * inv_scale, glyph_origin.y - glyph_offset.y * inv_scale); descriptor = gsk_gpu_node_processor_add_image (self, image, GSK_GPU_SAMPLER_DEFAULT); From 427a52a9ad3862681abfce75885717e565e9bc34 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 25 Feb 2024 20:02:24 -0500 Subject: [PATCH 2/2] Make one of the tests more robust The text-mixed-color-nocairo test was using a 20pt font, which results in 16.6 pixels, which is prone to triggering rounding errors and problems with fractional node bounds. Make it use 20px instead. --- .../gsk/compare/text-mixed-color-nocairo.node | 3 +-- .../gsk/compare/text-mixed-color-nocairo.png | Bin 173 -> 152 bytes 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/testsuite/gsk/compare/text-mixed-color-nocairo.node b/testsuite/gsk/compare/text-mixed-color-nocairo.node index a5a4f00590..72bc385534 100644 --- a/testsuite/gsk/compare/text-mixed-color-nocairo.node +++ b/testsuite/gsk/compare/text-mixed-color-nocairo.node @@ -1,8 +1,7 @@ transform { transform: translate(0, 100); child: text { - font: "text-mixed-color 20" url("data:font/ttf;base64,\ -AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\ + font: "text-mixed-color 15" url("data:font/ttf;base64,AAEAAAAKAIAAAwAgQ09MUgATAEEAAAJ8AAAALENQQUwB/wATAAACqAAAABpjbWFwAHcAPQAAATwA\ AAA0Z2x5Zu8g4kAAAAGEAAAA0mhlYWQmofyJAAAArAAAADZoaGVhDAEEAgAAAOQAAAAkaG10eAQA\ AQAAAAEoAAAAFGxvY2EAyAD5AAABcAAAABRtYXhwAAwACQAAAQgAAAAgbmFtZX7VdrQAAAJYAAAA\ IgABAAAAARmajs74k18PPPUAAggAAAAAAOHCPQAAAAAA4cpY+QAAAAAEAAgAAAAAAQACAAAAAAAA\ diff --git a/testsuite/gsk/compare/text-mixed-color-nocairo.png b/testsuite/gsk/compare/text-mixed-color-nocairo.png index 9416ca2477c593d76421263297e403047e4cae3b..53efe9573ad91147b28b00bfc70a63d392ab6f76 100644 GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^c|a_}!3HFA9&y9~sd!Hp$B>N1w-*m`G8ph2KCtBX z`#0+zq_gZQH`Kf}^JK}kn(`|Br}wsfU%Ds%_WxzKs_)KNXDBn};Q}7^R11y6j*@(* g3If`ijc^FrX;gEneeH3w1zN@6>FVdQ&MBb@0O|KRUjP6A literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^ML;ag!3HE3sNH@Kq)I$p978f1-(K9v%b>`^a!}a! zQoX7>tANF?__qqnPi*kKbnwlc+F$$BWY5&@?>qN+@8qw$u0Lk}s@&FMpwgnK$itcF k!Qt#AA#`Yh0I@FVdQ&MBb@02ksqwg3PC