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/coreapi | |
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/coreapi')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsggeometry.cpp | 4 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.cpp | 10 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.h | 12 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterialshader_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer.cpp | 12 | ||||
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer_p.h | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp index b43a2bc2ba..a278c6079b 100644 --- a/src/quick/scenegraph/coreapi/qsggeometry.cpp +++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp @@ -39,7 +39,7 @@ #include "qsggeometry.h" #include "qsggeometry_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <qopenglcontext.h> # include <qopenglfunctions.h> # include <private/qopenglextensions_p.h> @@ -441,7 +441,7 @@ QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes, Q_UNUSED(m_reserved_bits); Q_ASSERT(m_attributes.count > 0); Q_ASSERT(m_attributes.stride > 0); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) Q_ASSERT_X(indexType != GL_UNSIGNED_INT || static_cast<QOpenGLExtensions *>(QOpenGLContext::currentContext()->functions()) ->hasOpenGLExtension(QOpenGLExtensions::ElementIndexUint), diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp index 13598bbe1d..d2d27cd9aa 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp @@ -40,7 +40,7 @@ #include "qsgmaterial.h" #include "qsgrenderer_p.h" #include "qsgmaterialshader_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <private/qsgshadersourcebuilder_p.h> # include <private/qsgdefaultcontext_p.h> # include <private/qsgdefaultrendercontext_p.h> @@ -64,7 +64,7 @@ void qsg_set_material_failure() qsg_material_failure = true; } #endif -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) const char *QSGMaterialShaderPrivate::loadShaderSource(QOpenGLShader::ShaderType type) const { const QStringList files = m_sourceFiles[type]; @@ -227,7 +227,7 @@ QSGMaterialShader::~QSGMaterialShader() defines the attribute register position in the vertex shader. */ -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) /*! \fn const char *QSGMaterialShader::vertexShader() const @@ -320,7 +320,7 @@ void QSGMaterialShader::updateState(const RenderState & /* state */, QSGMaterial { } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) /*! Sets the GLSL source file for the shader stage \a type to \a sourceFile. The default implementation of the vertexShader() and fragmentShader() functions @@ -550,7 +550,7 @@ QRect QSGMaterialShader::RenderState::deviceRect() const return static_cast<const QSGRenderer *>(m_data)->deviceRect(); } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) /*! Returns the QOpenGLContext that is being used for rendering diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h index 114651653f..c002cd5d5e 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.h +++ b/src/quick/scenegraph/coreapi/qsgmaterial.h @@ -41,7 +41,7 @@ #define QSGMATERIAL_H #include <QtQuick/qtquickglobal.h> -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <QtGui/qopenglshaderprogram.h> #endif #include <QtGui/QMatrix4x4> @@ -84,7 +84,7 @@ public: QRect deviceRect() const; float determinant() const; float devicePixelRatio() const; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QOpenGLContext *context() const; #endif private: @@ -101,7 +101,7 @@ public: // First time a material is used, oldMaterial is null. virtual void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial); virtual char const *const *attributeNames() const = 0; // Array must end with null. -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) inline QOpenGLShaderProgram *program() { return &m_program; } #endif protected: @@ -110,19 +110,19 @@ protected: friend class QSGDefaultRenderContext; friend class QSGBatchRenderer::ShaderManager; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) void setShaderSourceFile(QOpenGLShader::ShaderType type, const QString &sourceFile); void setShaderSourceFiles(QOpenGLShader::ShaderType type, const QStringList &sourceFiles); virtual void compile(); #endif virtual void initialize() { } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) virtual const char *vertexShader() const; virtual const char *fragmentShader() const; #endif private: -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QOpenGLShaderProgram m_program; #endif QScopedPointer<QSGMaterialShaderPrivate> d_ptr; diff --git a/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h b/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h index 0dbce010db..47f5e5de09 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h +++ b/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE class Q_QUICK_PRIVATE_EXPORT QSGMaterialShaderPrivate { public: -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) const char *loadShaderSource(QOpenGLShader::ShaderType type) const; QHash<QOpenGLShader::ShaderType, QStringList> m_sourceFiles; diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index 34cdfc0a6d..e5d464930c 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -39,7 +39,7 @@ #include "qsgrenderer_p.h" #include "qsgnodeupdater_p.h" -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) # include <QtGui/QOpenGLFramebufferObject> # include <QtGui/QOpenGLContext> # include <QtGui/QOpenGLFunctions> @@ -67,7 +67,7 @@ int qt_sg_envInt(const char *name, int defaultValue) void QSGBindable::clear(QSGAbstractRenderer::ClearMode mode) const { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) GLuint bits = 0; if (mode & QSGAbstractRenderer::ClearColorBuffer) bits |= GL_COLOR_BUFFER_BIT; if (mode & QSGAbstractRenderer::ClearDepthBuffer) bits |= GL_DEPTH_BUFFER_BIT; @@ -81,11 +81,11 @@ void QSGBindable::clear(QSGAbstractRenderer::ClearMode mode) const // Reactivate the color buffer after switching to the stencil. void QSGBindable::reactivate() const { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QOpenGLContext::currentContext()->functions()->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); #endif } -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) QSGBindableFboId::QSGBindableFboId(GLuint id) : m_id(id) { @@ -181,7 +181,7 @@ bool QSGRenderer::isMirrored() const void QSGRenderer::renderScene(uint fboId) { -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) if (fboId) { QSGBindableFboId bindable(fboId); renderScene(bindable); @@ -223,7 +223,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame, QQuickProfiler::SceneGraphRendererBinding); -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) // Sanity check that attribute registers are disabled if (qsg_sanity_check) { GLint count = 0; diff --git a/src/quick/scenegraph/coreapi/qsgrenderer_p.h b/src/quick/scenegraph/coreapi/qsgrenderer_p.h index 94b78a85b4..26e29d414d 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgrenderer_p.h @@ -133,7 +133,7 @@ public: virtual void clear(QSGAbstractRenderer::ClearMode mode) const; virtual void reactivate() const; }; -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) class QSGBindableFboId : public QSGBindable { public: |