summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index ca5832ca4a..8992c535ba 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the QtOpenGL module of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -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);