From 82340ea5cd148253eb07877468bf3c8873f90e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 17 Jan 2012 09:05:38 +0100 Subject: 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 (cherry picked from commit f13d0078d9f829cde2cd5b8b9eac40635a883ec6) --- src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h') 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 #include #include +#include // #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); -- cgit v1.2.3