diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase-5.1.0/0019-Fix-FBO-restoring-in-QOpenGLTextureGlyphCache.patch')
-rw-r--r-- | recipes-qt/qt5/qtbase-5.1.0/0019-Fix-FBO-restoring-in-QOpenGLTextureGlyphCache.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase-5.1.0/0019-Fix-FBO-restoring-in-QOpenGLTextureGlyphCache.patch b/recipes-qt/qt5/qtbase-5.1.0/0019-Fix-FBO-restoring-in-QOpenGLTextureGlyphCache.patch new file mode 100644 index 00000000..c3a9dd54 --- /dev/null +++ b/recipes-qt/qt5/qtbase-5.1.0/0019-Fix-FBO-restoring-in-QOpenGLTextureGlyphCache.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 7c4453b5203e908f0c851c2a34231d81eb2f73c2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Valery Volgutov <valery.volgutov@lge.com> | ||
3 | Date: Tue, 21 May 2013 12:02:19 -0700 | ||
4 | Subject: [PATCH 19/23] Fix FBO restoring in QOpenGLTextureGlyphCache | ||
5 | |||
6 | QOpenGLTextureGlyphCache::restoreTextureData restores FBO which | ||
7 | was binded before restoreTextureData call. More specifically, | ||
8 | it restores QOpenGLContextPrivate's current_fbo member. This works | ||
9 | if FBO was binded by QOpenGLFramebufferObject but not if FBO was | ||
10 | binded using glBindFramebufferObject and rendering done via | ||
11 | QOpenGLPaintDevice. | ||
12 | |||
13 | This patch fixes it by querying current FBO using | ||
14 | GL_FRAMEBUFFER_BINDING query and restoring it. | ||
15 | |||
16 | Upstream-Status: Backport | ||
17 | https://codereview.qt-project.org/#change,56608 | ||
18 | |||
19 | Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> | ||
20 | --- | ||
21 | src/gui/opengl/qopengltextureglyphcache.cpp | 5 ++++- | ||
22 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp | ||
25 | index ec29900..9bda1db 100644 | ||
26 | --- a/src/gui/opengl/qopengltextureglyphcache.cpp | ||
27 | +++ b/src/gui/opengl/qopengltextureglyphcache.cpp | ||
28 | @@ -147,6 +147,9 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) | ||
29 | return; | ||
30 | } | ||
31 | |||
32 | + GLuint saveFbo; | ||
33 | + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &saveFbo); | ||
34 | + | ||
35 | int oldWidth = m_textureResource->m_width; | ||
36 | int oldHeight = m_textureResource->m_height; | ||
37 | |||
38 | @@ -265,7 +268,7 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) | ||
39 | glDeleteTextures(1, &tmp_texture); | ||
40 | glDeleteTextures(1, &oldTexture); | ||
41 | |||
42 | - funcs.glBindFramebuffer(GL_FRAMEBUFFER, ctx->d_func()->current_fbo); | ||
43 | + funcs.glBindFramebuffer(GL_FRAMEBUFFER, saveFbo); | ||
44 | |||
45 | if (pex != 0) { | ||
46 | glViewport(pex->x, pex->y, pex->width, pex->height); | ||
47 | -- | ||
48 | 1.8.3.2 | ||
49 | |||