diff options
author | Andy Nichols <andy.nichols@qt.io> | 2016-04-25 12:09:08 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2016-05-06 19:17:20 +0000 |
commit | 53c5398529f852903fb6774210573a25f5ea144a (patch) | |
tree | 211365b42b91087ba6e8dee80d532fb01ac03889 /src | |
parent | 3fdaa13f7f0a4f0eeff2e7450df2df0df824b72a (diff) |
Fix building with QT_NO_OPENGL defined
Change-Id: Ice6c47f766899e7313b9dde8cfcd6d81eeaf52f5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src')
4 files changed, 14 insertions, 5 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 560c49fb7c..1fbc9c201f 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -364,7 +364,9 @@ QSGContextFactoryInterface::Flags qsg_backend_flags(); QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent) : QQuickItem(parent), +#ifndef QT_NO_OPENGL m_glImpl(nullptr), +#endif m_impl(nullptr) { setFlag(QQuickItem::ItemHasContents); @@ -372,8 +374,9 @@ QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent) #ifndef QT_NO_OPENGL if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode)) m_glImpl = new QQuickOpenGLShaderEffect(this, this); -#endif + if (!m_glImpl) +#endif m_impl = new QQuickGenericShaderEffect(this, this); } diff --git a/src/quick/items/qquickshadereffectmesh.cpp b/src/quick/items/qquickshadereffectmesh.cpp index f6c2bb0dce..d7765cdc69 100644 --- a/src/quick/items/qquickshadereffectmesh.cpp +++ b/src/quick/items/qquickshadereffectmesh.cpp @@ -136,7 +136,7 @@ QSGGeometry *QQuickGridMesh::updateGeometry(QSGGeometry *geometry, int attrCount ? QSGGeometry::defaultAttributes_Point2D() : QSGGeometry::defaultAttributes_TexturedPoint2D(), (vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2), - GL_UNSIGNED_SHORT); + QSGGeometry::TypeUnsignedShort); } else { geometry->allocate((vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2)); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp index 12e1889627..ef0378fe04 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp @@ -163,7 +163,10 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window) Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame); if (data.grabOnly) { +#ifndef QT_NO_OPENGL + // QPlatformBackingStore::toImage() only with OpenGL for some reason grabContent = m_backingStores[window]->handle()->toImage(); +#endif data.grabOnly = false; } diff --git a/src/quick/scenegraph/util/qsgsimplematerial.h b/src/quick/scenegraph/util/qsgsimplematerial.h index 9ebfc1f8d2..d07a68e850 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 m_id_matrix = program()->uniformLocation(uniformMatrixName()); if (m_id_matrix < 0) { qFatal("QSGSimpleMaterialShader does not implement 'uniform highp mat4 %s;' in its vertex shader", @@ -67,7 +67,7 @@ public: } else { m_id_opacity = -1; } - +#endif resolveUniforms(); } @@ -197,11 +197,14 @@ 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 (state.isMatrixDirty()) program()->setUniformValue(m_id_matrix, state.combinedMatrix()); if (state.isOpacityDirty() && m_id_opacity >= 0) program()->setUniformValue(m_id_opacity, state.opacity()); - +#else + Q_UNUSED(state) +#endif State *ns = static_cast<QSGSimpleMaterial<State> *>(newMaterial)->state(); State *old = 0; if (oldMaterial) |