From 4b2f35d04ca3c2e037b4d0edd8b2350051cc572c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 28 Feb 2014 17:03:57 +0100 Subject: Dynamic GL: remove exporting symbols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the opengl proxy for now. Later it will either be moved into a separate library or replaced by a QOpenGLFunctions-based approach. This means that the -opengl dynamic configuration is not usable for the time being. The rest of the enablers remain in place. The convenience function QOpenGLFunctions::isES() is now moved to QOpenGLContext and is changed to check the renderable type. This is extremely useful since besides supporting dynamic GL it solves also the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES path when creating an ES-compatible context with a desktop OpenGL implementation). Task-number: QTBUG-36483 Task-number: QTBUG-37172 Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca Reviewed-by: Friedemann Kleint Reviewed-by: Jørgen Lind --- src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 2 +- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 12 ++++++------ src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/opengl/gl2paintengineex') diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index 394eb99307..56f3f5ad0a 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -163,7 +163,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) code[NonPremultipliedImageSrcFragmentShader] = qglslNonPremultipliedImageSrcFragmentShader; code[CustomImageSrcFragmentShader] = qglslCustomSrcFragmentShader; // Calls "customShader", which must be appended code[SolidBrushSrcFragmentShader] = qglslSolidBrushSrcFragmentShader; - if (!QOpenGLFunctions::isES()) + if (!context->contextHandle()->isES()) code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader_desktop; else code[TextureBrushSrcFragmentShader] = qglslTextureBrushSrcFragmentShader_ES; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index b8c039d0e2..fd64a4a71f 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -539,7 +539,7 @@ void QGL2PaintEngineEx::beginNativePainting() d->funcs.glDisableVertexAttribArray(i); #ifndef QT_OPENGL_ES_2 - if (!QOpenGLFunctions::isES()) { + if (!d->ctx->contextHandle()->isES()) { const QGLContext *ctx = d->ctx; const QGLFormat &fmt = d->device->format(); if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1) @@ -597,7 +597,7 @@ void QGL2PaintEngineExPrivate::resetGLState() ctx->d_func()->setVertexAttribArrayEnabled(QT_VERTEX_COORDS_ATTR, false); ctx->d_func()->setVertexAttribArrayEnabled(QT_OPACITY_ATTR, false); #ifndef QT_OPENGL_ES_2 - if (!QOpenGLFunctions::isES()) { + if (!ctx->contextHandle()->isES()) { // gl_Color, corresponding to vertex attribute 3, may have been changed float color[] = { 1.0f, 1.0f, 1.0f, 1.0f }; funcs.glVertexAttrib4fv(3, color); @@ -1353,10 +1353,11 @@ void QGL2PaintEngineEx::compositionModeChanged() void QGL2PaintEngineEx::renderHintsChanged() { + Q_D(QGL2PaintEngineEx); state()->renderHintsChanged = true; #if !defined(QT_OPENGL_ES_2) - if (!QOpenGLFunctions::isES()) { + if (!d->ctx->contextHandle()->isES()) { if ((state()->renderHints & QPainter::Antialiasing) || (state()->renderHints & QPainter::HighQualityAntialiasing)) glEnable(GL_MULTISAMPLE); @@ -1365,7 +1366,6 @@ void QGL2PaintEngineEx::renderHintsChanged() } #endif - Q_D(QGL2PaintEngineEx); d->lastTextureUsed = GLuint(-1); d->brushTextureDirty = true; // qDebug("QGL2PaintEngineEx::renderHintsChanged() not implemented!"); @@ -2032,14 +2032,14 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) glDisable(GL_SCISSOR_TEST); #if !defined(QT_OPENGL_ES_2) - if (!QOpenGLFunctions::isES()) + if (!d->ctx->contextHandle()->isES()) glDisable(GL_MULTISAMPLE); #endif d->glyphCacheFormat = QFontEngine::Format_A8; #if !defined(QT_OPENGL_ES_2) - if (!QOpenGLFunctions::isES()) { + if (!d->ctx->contextHandle()->isES()) { d->glyphCacheFormat = QFontEngine::Format_A32; d->multisamplingAlwaysEnabled = false; } else { diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index f9f2670375..b1e289254f 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -319,7 +319,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub uchar g = src[x] >> 8; uchar b = src[x]; quint32 avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding. - if (QOpenGLFunctions::isES()) { + if (ctx->contextHandle()->isES()) { // swizzle the bits to accommodate for the GL_RGBA upload. src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16); } else { @@ -333,7 +333,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub if (mask.format() == QImage::Format_RGB32) { GLenum format = GL_RGBA; #if !defined(QT_OPENGL_ES_2) - if (!QOpenGLFunctions::isES()) + if (!ctx->contextHandle()->isES()) format = GL_BGRA; #endif glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, format, GL_UNSIGNED_BYTE, mask.bits()); -- cgit v1.2.3