aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/util/qsgtexturematerial.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-16 14:22:36 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-29 10:10:27 +0000
commite579076bb36e6594003b2ade7f3d062944ef6f47 (patch)
tree1c00c8a02c638582d342504f3bebd45dbcd46be1 /src/quick/scenegraph/util/qsgtexturematerial.cpp
parent4e1463c20aa6ec52f23e1e5f6426b68edb2255f0 (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/qsgtexturematerial.cpp')
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.cpp18
1 files changed, 9 insertions, 9 deletions
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
}