diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-11-16 14:22:36 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-11-29 10:10:27 +0000 |
commit | e579076bb36e6594003b2ade7f3d062944ef6f47 (patch) | |
tree | 1c00c8a02c638582d342504f3bebd45dbcd46be1 /src/quick/scenegraph/util | |
parent | 4e1463c20aa6ec52f23e1e5f6426b68edb2255f0 (diff) |
Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few
mis-spelled macros and invalid usages.
Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/scenegraph/util')
-rw-r--r-- | src/quick/scenegraph/util/qsgdistancefieldutil.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgengine.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgflatcolormaterial.cpp | 10 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimplematerial.h | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture.cpp | 18 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexture_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgtexturematerial.cpp | 18 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgvertexcolormaterial.cpp | 10 |
8 files changed, 35 insertions, 35 deletions
diff --git a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp index 79e43e3820..9ca9cdb107 100644 --- a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp +++ b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp @@ -40,7 +40,7 @@ #include "qsgdistancefieldutil_p.h" #include <private/qsgadaptationlayer_p.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <QtGui/private/qopenglengineshadersource_p.h> #endif #include <QtQuick/private/qsgcontext_p.h> diff --git a/src/quick/scenegraph/util/qsgengine.cpp b/src/quick/scenegraph/util/qsgengine.cpp index ad1fcfa470..09e4cdf5a7 100644 --- a/src/quick/scenegraph/util/qsgengine.cpp +++ b/src/quick/scenegraph/util/qsgengine.cpp @@ -44,7 +44,7 @@ #include <private/qsgrenderer_p.h> #include <private/qsgtexture_p.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <QtGui/QOpenGLContext> # include <private/qsgdefaultrendercontext_p.h> #endif @@ -116,7 +116,7 @@ QSGEngine::~QSGEngine() void QSGEngine::initialize(QOpenGLContext *context) { Q_D(QSGEngine); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (context && QOpenGLContext::currentContext() != context) { qWarning("WARNING: The context must be current before calling QSGEngine::initialize."); return; @@ -125,7 +125,7 @@ void QSGEngine::initialize(QOpenGLContext *context) if (d->sgRenderContext && !d->sgRenderContext->isValid()) { d->sgRenderContext->setAttachToGraphicsContext(false); d->sgRenderContext->initialize(context); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (context) connect(context, &QOpenGLContext::aboutToBeDestroyed, this, &QSGEngine::invalidate); #endif diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp index 2ce27275cd..8ab7669891 100644 --- a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp @@ -39,7 +39,7 @@ #include "qsgflatcolormaterial.h" #include <private/qsgmaterialshader_p.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <qopenglshaderprogram.h> #endif @@ -57,7 +57,7 @@ public: private: virtual void initialize(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) int m_matrix_id; int m_color_id; #endif @@ -68,7 +68,7 @@ QSGMaterialType FlatColorMaterialShader::type; FlatColorMaterialShader::FlatColorMaterialShader() : QSGMaterialShader(*new QSGMaterialShaderPrivate) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/flatcolor.vert")); setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/flatcolor.frag")); #endif @@ -76,7 +76,7 @@ FlatColorMaterialShader::FlatColorMaterialShader() void FlatColorMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) Q_ASSERT(oldEffect == 0 || newEffect->type() == oldEffect->type()); QSGFlatColorMaterial *oldMaterial = static_cast<QSGFlatColorMaterial *>(oldEffect); QSGFlatColorMaterial *newMaterial = static_cast<QSGFlatColorMaterial *>(newEffect); @@ -109,7 +109,7 @@ char const *const *FlatColorMaterialShader::attributeNames() const void FlatColorMaterialShader::initialize() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) m_matrix_id = program()->uniformLocation("matrix"); m_color_id = program()->uniformLocation("color"); #endif diff --git a/src/quick/scenegraph/util/qsgsimplematerial.h b/src/quick/scenegraph/util/qsgsimplematerial.h index d07a68e850..8f42599832 100644 --- a/src/quick/scenegraph/util/qsgsimplematerial.h +++ b/src/quick/scenegraph/util/qsgsimplematerial.h @@ -50,7 +50,7 @@ class QSGSimpleMaterialShader : public QSGMaterialShader public: void initialize() { QSGMaterialShader::initialize(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) m_id_matrix = program()->uniformLocation(uniformMatrixName()); if (m_id_matrix < 0) { qFatal("QSGSimpleMaterialShader does not implement 'uniform highp mat4 %s;' in its vertex shader", @@ -197,7 +197,7 @@ QSGMaterialType QSGSimpleMaterial<State>::m_type; template <typename State> Q_INLINE_TEMPLATE void QSGSimpleMaterialShader<State>::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (state.isMatrixDirty()) program()->setUniformValue(m_id_matrix, state.combinedMatrix()); if (state.isOpacityDirty() && m_id_opacity >= 0) diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp index 436f97b1ff..47248f2f37 100644 --- a/src/quick/scenegraph/util/qsgtexture.cpp +++ b/src/quick/scenegraph/util/qsgtexture.cpp @@ -45,7 +45,7 @@ #include <private/qqmlglobal_p.h> #include <QtGui/qguiapplication.h> #include <QtGui/qpa/qplatformnativeinterface.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <qopenglfunctions.h> # include <QtGui/qopenglcontext.h> # include <QtGui/qopenglfunctions.h> @@ -70,7 +70,7 @@ #include <QHash> #endif -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) static QElapsedTimer qsg_renderer_timer; #endif @@ -86,7 +86,7 @@ static const bool qsg_leak_check = !qEnvironmentVariableIsEmpty("QML_LEAK_CHECK" QT_BEGIN_NAMESPACE -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) inline static bool isPowerOfTwo(int x) { // Assumption: x >= 1 @@ -284,7 +284,7 @@ Q_GLOBAL_STATIC(QMutex, qsg_valid_texture_mutex) bool qsg_safeguard_texture(QSGTexture *texture) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QMutexLocker locker(qsg_valid_texture_mutex()); if (!qsg_valid_texture_set()->contains(texture)) { qWarning() << "Invalid texture accessed:" << (void *) texture; @@ -527,7 +527,7 @@ QSGTexture::WrapMode QSGTexture::verticalWrapMode() const */ void QSGTexture::updateBindOptions(bool force) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) Q_D(QSGTexture); QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); force |= isAtlasTexture(); @@ -582,7 +582,7 @@ QSGPlainTexture::QSGPlainTexture() QSGPlainTexture::~QSGPlainTexture() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (m_texture_id && m_owns_texture && QOpenGLContext::currentContext()) QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_texture_id); #endif @@ -617,7 +617,7 @@ int QSGPlainTexture::textureId() const // or ~QSGPlainTexture so just keep it minimal here. return 0; } else if (m_texture_id == 0){ -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) // Generate a texture id for use later and return it. QOpenGLContext::currentContext()->functions()->glGenTextures(1, &const_cast<QSGPlainTexture *>(this)->m_texture_id); #endif @@ -629,7 +629,7 @@ int QSGPlainTexture::textureId() const void QSGPlainTexture::setTextureId(int id) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (m_texture_id && m_owns_texture) QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_texture_id); #endif @@ -643,7 +643,7 @@ void QSGPlainTexture::setTextureId(int id) void QSGPlainTexture::bind() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QOpenGLContext *context = QOpenGLContext::currentContext(); QOpenGLFunctions *funcs = context->functions(); if (!m_dirty_texture) { diff --git a/src/quick/scenegraph/util/qsgtexture_p.h b/src/quick/scenegraph/util/qsgtexture_p.h index a0d7eb41e3..13c862eb88 100644 --- a/src/quick/scenegraph/util/qsgtexture_p.h +++ b/src/quick/scenegraph/util/qsgtexture_p.h @@ -53,7 +53,7 @@ #include <QtQuick/qtquickglobal.h> #include <private/qobject_p.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <QtGui/qopengl.h> #endif #include "qsgtexture.h" diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp index 119828bc81..9326ea640d 100644 --- a/src/quick/scenegraph/util/qsgtexturematerial.cpp +++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp @@ -39,14 +39,14 @@ #include "qsgtexturematerial_p.h" #include "qsgtexture_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <QtGui/qopenglshaderprogram.h> # include <QtGui/qopenglfunctions.h> #endif QT_BEGIN_NAMESPACE -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) inline static bool isPowerOfTwo(int x) { // Assumption: x >= 1 @@ -59,7 +59,7 @@ QSGMaterialType QSGOpaqueTextureMaterialShader::type; QSGOpaqueTextureMaterialShader::QSGOpaqueTextureMaterialShader() : QSGMaterialShader() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/opaquetexture.vert")); setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/opaquetexture.frag")); #endif @@ -73,7 +73,7 @@ char const *const *QSGOpaqueTextureMaterialShader::attributeNames() const void QSGOpaqueTextureMaterialShader::initialize() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) m_matrix_id = program()->uniformLocation("qt_Matrix"); #endif } @@ -95,7 +95,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa t->setHorizontalWrapMode(tx->horizontalWrapMode()); t->setVerticalWrapMode(tx->verticalWrapMode()); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) bool npotSupported = const_cast<QOpenGLContext *>(state.context()) ->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat); if (!npotSupported) { @@ -115,7 +115,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa t->bind(); else t->updateBindOptions(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (state.isMatrixDirty()) program()->setUniformValue(m_matrix_id, state.combinedMatrix()); #endif @@ -379,7 +379,7 @@ QSGMaterialShader *QSGTextureMaterial::createShader() const QSGTextureMaterialShader::QSGTextureMaterialShader() : QSGOpaqueTextureMaterialShader() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/texture.frag")); #endif } @@ -387,7 +387,7 @@ QSGTextureMaterialShader::QSGTextureMaterialShader() void QSGTextureMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) { Q_ASSERT(oldEffect == 0 || newEffect->type() == oldEffect->type()); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (state.isOpacityDirty()) program()->setUniformValue(m_opacity_id, state.opacity()); #endif @@ -397,7 +397,7 @@ void QSGTextureMaterialShader::updateState(const RenderState &state, QSGMaterial void QSGTextureMaterialShader::initialize() { QSGOpaqueTextureMaterialShader::initialize(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) m_opacity_id = program()->uniformLocation("opacity"); #endif } diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp index 847ec289d8..8c305d7fd4 100644 --- a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp +++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp @@ -38,7 +38,7 @@ ****************************************************************************/ #include "qsgvertexcolormaterial.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <qopenglshaderprogram.h> #endif QT_BEGIN_NAMESPACE @@ -55,7 +55,7 @@ public: private: virtual void initialize(); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) int m_matrix_id; int m_opacity_id; #endif @@ -66,7 +66,7 @@ QSGMaterialType QSGVertexColorMaterialShader::type; QSGVertexColorMaterialShader::QSGVertexColorMaterialShader() : QSGMaterialShader() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/vertexcolor.vert")); setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/vertexcolor.frag")); #endif @@ -74,7 +74,7 @@ QSGVertexColorMaterialShader::QSGVertexColorMaterialShader() void QSGVertexColorMaterialShader::updateState(const RenderState &state, QSGMaterial * /*newEffect*/, QSGMaterial *) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (state.isOpacityDirty()) program()->setUniformValue(m_opacity_id, state.opacity()); @@ -93,7 +93,7 @@ char const *const *QSGVertexColorMaterialShader::attributeNames() const void QSGVertexColorMaterialShader::initialize() { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) m_matrix_id = program()->uniformLocation("matrix"); m_opacity_id = program()->uniformLocation("opacity"); #endif |