diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-04-15 13:48:38 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-04-17 07:27:56 +0200 |
commit | ac009a9671ad97e9bc599676c35acd4628e45e7b (patch) | |
tree | 4a6cc8da2f7e0605ca0b3ca4c5644d292f1ff201 /src | |
parent | c3fcbe73189b26e49ad8fa824b2b8e6b7db0a8f4 (diff) |
Get rid of Q_OPENGL_ES* macros
These macros are no longer defined, and we will use QT_CONFIG
instead, since that is more robust (it checks against
misspellings).
This also removes some dead code from the WebKit code in
Qt QML. The condition never resolved to true in our case
since Qt QML does not depend on Qt GUI, so even before
the macro would not be set. This is just a leftover
anyway, as the graphical parts are not used in QML.
Task-number: QTBUG-83467
Change-Id: I2c4b7f928538cc75ce408deb357f8fd92a84d8e4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/wtf/Platform.h | 3 | ||||
-rw-r--r-- | src/particles/qquickimageparticle.cpp | 8 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignersupport.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdefaultinternalimagenode.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp | 14 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgopenglatlastexture.cpp | 6 |
9 files changed, 22 insertions, 25 deletions
diff --git a/src/3rdparty/masm/wtf/Platform.h b/src/3rdparty/masm/wtf/Platform.h index ab1da2198a..29decfadcf 100644 --- a/src/3rdparty/masm/wtf/Platform.h +++ b/src/3rdparty/masm/wtf/Platform.h @@ -1043,9 +1043,6 @@ #if PLATFORM(QT) #include <qglobal.h> -#if defined(QT_OPENGL_ES_2) && !defined(WTF_USE_OPENGL_ES_2) -#define WTF_USE_OPENGL_ES_2 1 -#endif #endif #if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index 4d67691771..ce7e99a3a0 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -606,14 +606,14 @@ public: } void activate() override { -#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) +#if !QT_CONFIG(opengles2) && !defined(Q_OS_WIN) glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif } void deactivate() override { -#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) +#if !QT_CONFIG(opengles2) && !defined(Q_OS_WIN) glDisable(GL_POINT_SPRITE); glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif @@ -754,14 +754,14 @@ public: } void activate() override { -#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) +#if !QT_CONFIG(opengles2) && !defined(Q_OS_WIN) glEnable(GL_POINT_SPRITE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif } void deactivate() override { -#if !defined(QT_OPENGL_ES_2) && !defined(Q_OS_WIN) +#if !QT_CONFIG(opengles2) && !defined(Q_OS_WIN) glDisable(GL_POINT_SPRITE); glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); #endif diff --git a/src/quick/designer/qquickdesignersupport.cpp b/src/quick/designer/qquickdesignersupport.cpp index 48b6b9733b..a2820fbba2 100644 --- a/src/quick/designer/qquickdesignersupport.cpp +++ b/src/quick/designer/qquickdesignersupport.cpp @@ -97,7 +97,7 @@ void QQuickDesignerSupport::refFromEffectItem(QQuickItem *referencedItem, bool h texture->setSize(itemSize.toSize()); texture->setRecursive(true); #if QT_CONFIG(opengl) -#ifndef QT_OPENGL_ES +#if !QT_CONFIG(opengles2) if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) texture->setFormat(GL_RGBA8); else diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index ee96085c69..bc05e8d4f3 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -2963,7 +2963,7 @@ void Renderer::updateLineWidth(QSGGeometry *g) // legacy (GL-only) { if (g->drawingMode() == GL_LINE_STRIP || g->drawingMode() == GL_LINE_LOOP || g->drawingMode() == GL_LINES) glLineWidth(g->lineWidth()); -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) else { QOpenGLContext *ctx = m_context->openglContext(); if (!ctx->isOpenGLES() && g->drawingMode() == GL_POINTS) { diff --git a/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp b/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp index 167d2b01dd..e609bea439 100644 --- a/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp +++ b/src/quick/scenegraph/qsgdefaultinternalimagenode.cpp @@ -254,7 +254,7 @@ bool QSGDefaultInternalImageNode::supportsWrap(const QSize &size) const || (isPowerOfTwo(size.width()) && isPowerOfTwo(size.height())); } else { QOpenGLContext *ctx = QOpenGLContext::currentContext(); -#ifndef QT_OPENGL_ES_2 +#if !QT_CONFIG(opengles2) if (ctx->isOpenGLES()) #endif { diff --git a/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp index 2f9b1e4ce6..d757cdd048 100644 --- a/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp +++ b/src/quick/scenegraph/qsgopengldistancefieldglyphcache.cpp @@ -53,7 +53,7 @@ #include "qsgcontext_p.h" -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) #include <qopenglfunctions_3_2_core.h> #endif @@ -77,7 +77,7 @@ QSGOpenGLDistanceFieldGlyphCache::QSGOpenGLDistanceFieldGlyphCache(QOpenGLContex , m_blitBuffer(QOpenGLBuffer::VertexBuffer) , m_fboGuard(nullptr) , m_funcs(c->functions()) -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) , m_coreFuncs(nullptr) #endif { @@ -222,7 +222,7 @@ void QSGOpenGLDistanceFieldGlyphCache::storeGlyphs(const QList<QDistanceField> & } } -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA; #else const GLenum format = GL_ALPHA; @@ -291,7 +291,7 @@ void QSGOpenGLDistanceFieldGlyphCache::createTexture(TextureInfo *texInfo, m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) if (!QOpenGLContext::currentContext()->isOpenGLES()) m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); const GLint internalFormat = isCoreProfile() ? GL_R8 : GL_ALPHA; @@ -337,7 +337,7 @@ void QSGOpenGLDistanceFieldGlyphCache::resizeTexture(TextureInfo *texInfo, int w updateTexture(oldTexture, texInfo->texture, texInfo->size); -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) if (isCoreProfile() && !useTextureResizeWorkaround()) { // For an OpenGL Core Profile we can use http://www.opengl.org/wiki/Framebuffer#Blitting // to efficiently copy the contents of the old texture to the new texture @@ -388,7 +388,7 @@ void QSGOpenGLDistanceFieldGlyphCache::resizeTexture(TextureInfo *texInfo, int w m_funcs->glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); m_funcs->glPixelStorei(GL_UNPACK_ALIGNMENT, 1); -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) const GLenum format = isCoreProfile() ? GL_RED : GL_ALPHA; #else const GLenum format = GL_ALPHA; @@ -434,7 +434,7 @@ void QSGOpenGLDistanceFieldGlyphCache::resizeTexture(TextureInfo *texInfo, int w m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) if (!ctx->isOpenGLES()) m_funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); #endif diff --git a/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h index 2e7b5baae2..b095fc94a0 100644 --- a/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h +++ b/src/quick/scenegraph/qsgopengldistancefieldglyphcache_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE class QOpenGLSharedResourceGuard; -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) class QOpenGLFunctions_3_2_Core; #endif @@ -154,7 +154,7 @@ private: QOpenGLSharedResourceGuard *m_fboGuard; QOpenGLFunctions *m_funcs; -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) QOpenGLFunctions_3_2_Core *m_coreFuncs; #endif }; diff --git a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp index c6091758bb..907dbdfd0e 100644 --- a/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp +++ b/src/quick/scenegraph/util/qsgdepthstencilbuffer.cpp @@ -112,7 +112,7 @@ QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *conte m_functions.glGenRenderbuffers(1, &m_depthBuffer); m_functions.glBindRenderbuffer(GL_RENDERBUFFER, m_depthBuffer); if (format.samples && m_functions.hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)) { -#if defined(QT_OPENGL_ES_2) +#if QT_CONFIG(opengles2) m_functions.glRenderbufferStorageMultisample(GL_RENDERBUFFER, format.samples, GL_DEPTH24_STENCIL8_OES, width, height); #else @@ -120,7 +120,7 @@ QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *conte GL_DEPTH24_STENCIL8, width, height); #endif } else { -#if defined(QT_OPENGL_ES_2) +#if QT_CONFIG(opengles2) m_functions.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height); #else m_functions.glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); @@ -145,7 +145,7 @@ QSGDefaultDepthStencilBuffer::QSGDefaultDepthStencilBuffer(QOpenGLContext *conte if (!m_stencilBuffer && (format.attachments & StencilAttachment)) { m_functions.glGenRenderbuffers(1, &m_stencilBuffer); m_functions.glBindRenderbuffer(GL_RENDERBUFFER, m_stencilBuffer); -#ifdef QT_OPENGL_ES +#if QT_CONFIG(opengles2) const GLenum internalFormat = GL_STENCIL_INDEX8; #else const GLenum internalFormat = context->isOpenGLES() ? GL_STENCIL_INDEX8 : GL_STENCIL_INDEX; diff --git a/src/quick/scenegraph/util/qsgopenglatlastexture.cpp b/src/quick/scenegraph/util/qsgopenglatlastexture.cpp index 0f29cb3b38..aa5ee3d7b8 100644 --- a/src/quick/scenegraph/util/qsgopenglatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgopenglatlastexture.cpp @@ -222,7 +222,7 @@ void AtlasBase::bind(QSGTexture::Filtering filtering) funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -#if !defined(QT_OPENGL_ES_2) +#if !QT_CONFIG(opengles2) if (!QOpenGLContext::currentContext()->isOpenGLES()) funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); #endif @@ -295,7 +295,7 @@ Atlas::Atlas(const QSize &size) m_internalFormat = GL_RGBA; m_externalFormat = GL_BGRA; -#ifndef QT_OPENGL_ES +#if !QT_CONFIG(opengles2) if (QOpenGLContext::currentContext()->isOpenGLES()) { #endif @@ -332,7 +332,7 @@ Atlas::Atlas(const QSize &size) m_internalFormat = m_externalFormat = GL_RGBA; } -#ifndef QT_OPENGL_ES +#if !QT_CONFIG(opengles2) } #endif |