From 9f8cf5b0bde0a5b24fa84c33f68725409d8bca0c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 25 Oct 2023 21:12:23 +0200 Subject: [PATCH] gl: Fix padding in icon library The previous code would not pad the left side with the left column of pixels but with the top row. Test attached. --- gsk/gl/gskgliconlibrary.c | 2 +- testsuite/gsk/compare/blurred-lines.node | 6 ++++++ testsuite/gsk/compare/blurred-lines.png | Bin 0 -> 91 bytes testsuite/gsk/meson.build | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 testsuite/gsk/compare/blurred-lines.node create mode 100644 testsuite/gsk/compare/blurred-lines.png diff --git a/gsk/gl/gskgliconlibrary.c b/gsk/gl/gskgliconlibrary.c index e57016a1a2..9040d8e1d9 100644 --- a/gsk/gl/gskgliconlibrary.c +++ b/gsk/gl/gskgliconlibrary.c @@ -148,6 +148,7 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self, gl_format, gl_type, pixel_data); /* Padding left */ + glPixelStorei (GL_UNPACK_ROW_LENGTH, width); glTexSubImage2D (GL_TEXTURE_2D, 0, packed_x, packed_y + 1, 1, height, @@ -161,7 +162,6 @@ gsk_gl_icon_library_add (GskGLIconLibrary *self, pixel_data); /* Padding right */ - glPixelStorei (GL_UNPACK_ROW_LENGTH, width); glPixelStorei (GL_UNPACK_SKIP_PIXELS, width - 1); glTexSubImage2D (GL_TEXTURE_2D, 0, packed_x + width + 1, packed_y + 1, diff --git a/testsuite/gsk/compare/blurred-lines.node b/testsuite/gsk/compare/blurred-lines.node new file mode 100644 index 0000000000..e3b85c8266 --- /dev/null +++ b/testsuite/gsk/compare/blurred-lines.node @@ -0,0 +1,6 @@ +texture { + bounds: 0 0 20 20; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAUCAYAAAC07qxWAAAAHElEQVQokWP8z8D6n4EIwESMolGF\ +1FM4CgYrAACekgIXqju67AAAAABJRU5ErkJggg==\ +"); +} diff --git a/testsuite/gsk/compare/blurred-lines.png b/testsuite/gsk/compare/blurred-lines.png new file mode 100644 index 0000000000000000000000000000000000000000..bb5531711b6ecc12950be3200c877185cba381a2 GIT binary patch literal 91 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE;=lBbJfh(&MmpYsQP&2Q{#=$zHo oD`k=OAi=Oeq^Bv+fro)X;xv=^<;&Y5fT|fhUHx3vIVCg!0NdLcqW}N^ literal 0 HcmV?d00001 diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 9d82719882..7c7e3e9769 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -19,6 +19,7 @@ compare_render_tests = [ 'blend-invisible-child', 'blend-in-rotate', 'blend-normal', + 'blurred-lines', 'border-bottom-right', 'border-one-rounded', 'borders-rotated', -- 2.30.2