summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-01-17 09:05:38 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-17 10:30:17 +0100
commit82340ea5cd148253eb07877468bf3c8873f90e56 (patch)
tree01062cd0f4cc763a2073137fc4dd426ef9583841 /src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
parent147bbda0675b7cc7afaea6bc617d6a0f249978f0 (diff)
Fixed crash in GL 2 paint engine on Intel Atom.
The GPU in question supports GL 2 but not framebuffer objects. Since we anyway have a font rendering path that doesn't use FBOs we might as well not require framebuffer objects in order to use the GL 2 engine. Task-number: QTBUG-22483 Change-Id: I2a80343fedda276e73e603ffe54edff58801af5b Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com> (cherry picked from commit f13d0078d9f829cde2cd5b8b9eac40635a883ec6)
Diffstat (limited to 'src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index ca5832ca4a..4314aa9841 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -56,6 +56,7 @@
#include <private/qtextureglyphcache_p.h>
#include <private/qgl_p.h>
#include <qglshaderprogram.h>
+#include <qglframebufferobject.h>
// #define QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
@@ -67,10 +68,11 @@ struct QGLGlyphTexture : public QOpenGLSharedResource
{
QGLGlyphTexture(const QGLContext *ctx)
: QOpenGLSharedResource(ctx->contextHandle()->shareGroup())
+ , m_fbo(0)
, m_width(0)
, m_height(0)
{
- if (ctx && !ctx->d_ptr->workaround_brokenFBOReadBack)
+ if (ctx && QGLFramebufferObject::hasOpenGLFramebufferObjects() && !ctx->d_ptr->workaround_brokenFBOReadBack)
glGenFramebuffers(1, &m_fbo);
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
@@ -84,7 +86,7 @@ struct QGLGlyphTexture : public QOpenGLSharedResource
#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
qDebug("~QGLGlyphTexture() %p for context %p.", this, ctx);
#endif
- if (!ctx->d_ptr->workaround_brokenFBOReadBack)
+ if (m_fbo)
glDeleteFramebuffers(1, &m_fbo);
if (m_width || m_height)
glDeleteTextures(1, &m_texture);