[gtk] gl: Handle row stride for glyph cache upload
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl: Handle row stride for glyph cache upload
- Date: Sat, 12 Oct 2019 01:18:33 +0000 (UTC)
commit 646c5f369f6dbaefb37138188959512dd820bb98
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Oct 11 21:16:40 2019 -0400
gl: Handle row stride for glyph cache upload
In theory, we can have data with a stride here,
so set the necessary parameters to tell GL about
it.
gsk/gl/gskglglyphcache.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c
index 0357f9910d..66b84a02be 100644
--- a/gsk/gl/gskglglyphcache.c
+++ b/gsk/gl/gskglglyphcache.c
@@ -189,11 +189,13 @@ upload_glyph (GlyphCacheKey *key,
if (render_glyph (key, value, &r))
{
+ glPixelStorei (GL_UNPACK_ROW_LENGTH, r.stride / 4);
glBindTexture (GL_TEXTURE_2D, value->texture_id);
glTexSubImage2D (GL_TEXTURE_2D, 0,
r.x, r.y, r.width, r.height,
GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
r.data);
+ glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
g_free (r.data);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]