diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index f9512b0343..7f544dc003 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -291,7 +291,10 @@ gdk_gl_context_upload_texture (GdkGLContext *context, */ if (stride == width * bpp) { + 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)))) @@ -302,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 {