summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-09-25 16:17:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-09-25 16:17:45 -0400
commit3db217ab7aa683fed8fb2ab3603e021c7136a35a (patch)
treeb18c0cb0b932dee6a831d3f2720580d52c3f80f3 /gdk
parent12f05e80aa40891ce3b7dab9d11089542f75f5d9 (diff)
downloadgtk+-3db217ab7aa683fed8fb2ab3603e021c7136a35a.tar.gz
gl: Reset GL_UNPACK_ALIGNMENTfix-rgb-upload
Reset GL_UNPACK_ALIGNMENT to its initial value of 4 after changing it for a glTexImage2D call.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkglcontext.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 5614b2ce47..7f544dc003 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -294,6 +294,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, gl_format, gl_type, data);
+ glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
}
else if ((!priv->use_es ||
(priv->use_es && (priv->gl_version >= 30 || priv->has_unpack_subimage))))
@@ -304,6 +305,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, gl_format, gl_type, data);
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
+ glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
}
else
{