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.
This commit is contained in:
Benjamin Otte
2023-10-25 21:12:23 +02:00
committed by Matthias Clasen
parent 013a06f596
commit 9f8cf5b0bd
4 changed files with 8 additions and 1 deletions

View File

@@ -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,

View File

@@ -0,0 +1,6 @@
texture {
bounds: 0 0 20 20;
texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAUCAYAAAC07qxWAAAAHElEQVQokWP8z8D6n4EIwESMolGF\
1FM4CgYrAACekgIXqju67AAAAABJRU5ErkJggg==\
");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

View File

@@ -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',