summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp18
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h2
2 files changed, 5 insertions, 15 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 452d37d..cc42c63 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -57,21 +57,13 @@ QGLTextureGlyphCache::QGLTextureGlyphCache(QGLContext *context, QFontEngineGlyph
, ctx(context)
, m_width(0)
, m_height(0)
- , m_broken_fbo_readback(false)
{
// broken FBO readback is a bug in the SGX 1.3 and 1.4 drivers for the N900 where
// copying between FBO's is broken if the texture is either GL_ALPHA or POT. The
// workaround is to use a system-memory copy of the glyph cache for this device.
// Switching to NPOT and GL_RGBA would both cost a lot more graphics memory and
// be slower, so that is not desireable.
-#if defined QT_OPENGL_ES_2 && !defined(QT_NO_EGL)
- if (QByteArray((char*) glGetString(GL_RENDERER)).contains("SGX")) {
- QGLContextPrivate *ctxd = context->d_func();
- m_broken_fbo_readback = QByteArray((char *) eglQueryString(ctxd->eglContext->display(), EGL_VERSION)).contains("1.3");
- }
-#endif
-
- if (!m_broken_fbo_readback)
+ if (!ctx->d_ptr->workaround_brokenFBOReadBack)
glGenFramebuffers(1, &m_fbo);
connect(QGLSignalProxy::instance(), SIGNAL(aboutToDestroyContext(const QGLContext*)),
@@ -83,7 +75,7 @@ QGLTextureGlyphCache::~QGLTextureGlyphCache()
if (ctx) {
QGLShareContextScope scope(ctx);
- if (!m_broken_fbo_readback)
+ if (!ctx->d_ptr->workaround_brokenFBOReadBack)
glDeleteFramebuffers(1, &m_fbo);
if (m_width || m_height)
@@ -96,7 +88,7 @@ void QGLTextureGlyphCache::createTextureData(int width, int height)
// create in QImageTextureGlyphCache baseclass is meant to be called
// only to create the initial image and does not preserve the content,
// so we don't call when this function is called from resize.
- if (m_broken_fbo_readback && image().isNull())
+ if (ctx->d_ptr->workaround_brokenFBOReadBack && image().isNull())
QImageTextureGlyphCache::createTextureData(width, height);
glGenTextures(1, &m_texture);
@@ -126,7 +118,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
GLuint oldTexture = m_texture;
createTextureData(width, height);
- if (m_broken_fbo_readback) {
+ if (ctx->d_ptr->workaround_brokenFBOReadBack) {
QImageTextureGlyphCache::resizeTextureData(width, height);
Q_ASSERT(image().depth() == 8);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, oldWidth, oldHeight, GL_ALPHA, GL_UNSIGNED_BYTE, image().constBits());
@@ -209,7 +201,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
{
- if (m_broken_fbo_readback) {
+ if (ctx->d_ptr->workaround_brokenFBOReadBack) {
QImageTextureGlyphCache::fillTexture(c, glyph);
glBindTexture(GL_TEXTURE_2D, m_texture);
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index efb7435..6bcd655 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -115,8 +115,6 @@ private:
int m_height;
QGLShaderProgram *m_program;
-
- bool m_broken_fbo_readback;
};
QT_END_NAMESPACE