From: Benjamin Otte Date: Wed, 25 Oct 2023 19:12:23 +0000 (+0200) Subject: gl: Fix padding in icon library X-Git-Tag: archive/raspbian/4.12.4+ds-3+rpi1^2~21^2^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9f8cf5b0bde0a5b24fa84c33f68725409d8bca0c;p=gtk4.git 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. --- 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 0000000000..bb5531711b Binary files /dev/null and b/testsuite/gsk/compare/blurred-lines.png differ 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',