diff options
-rw-r--r-- | examples/quick/quick.pro | 8 | ||||
-rw-r--r-- | examples/quick/scenegraph/customgeometry/beziercurve.cpp | 2 | ||||
-rw-r--r-- | examples/quick/scenegraph/scenegraph.pro | 19 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffect.cpp | 5 | ||||
-rw-r--r-- | src/quick/items/qquickshadereffectmesh.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp | 3 | ||||
-rw-r--r-- | src/quick/scenegraph/util/qsgsimplematerial.h | 9 |
7 files changed, 33 insertions, 15 deletions
diff --git a/examples/quick/quick.pro b/examples/quick/quick.pro index e66e24882e..5fd7731739 100644 --- a/examples/quick/quick.pro +++ b/examples/quick/quick.pro @@ -24,8 +24,12 @@ SUBDIRS = quick-accessibility \ imageresponseprovider \ window \ particles \ - demos \ - rendercontrol + demos + +#OpenGL Support Required +contains(QT_CONFIG, opengl(es1|es2)?) { + SUBDIRS += rendercontrol +} # Widget dependent examples qtHaveModule(widgets) { diff --git a/examples/quick/scenegraph/customgeometry/beziercurve.cpp b/examples/quick/scenegraph/customgeometry/beziercurve.cpp index 14e78f8d21..ca3c6f524b 100644 --- a/examples/quick/scenegraph/customgeometry/beziercurve.cpp +++ b/examples/quick/scenegraph/customgeometry/beziercurve.cpp @@ -135,7 +135,7 @@ QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) //! [4] //! [5] geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), m_segmentCount); geometry->setLineWidth(2); - geometry->setDrawingMode(GL_LINE_STRIP); + geometry->setDrawingMode(QSGGeometry::DrawLineStrip); node->setGeometry(geometry); node->setFlag(QSGNode::OwnsGeometry); //! [5] //! [6] diff --git a/examples/quick/scenegraph/scenegraph.pro b/examples/quick/scenegraph/scenegraph.pro index 1e7e74372d..0162aae45d 100644 --- a/examples/quick/scenegraph/scenegraph.pro +++ b/examples/quick/scenegraph/scenegraph.pro @@ -1,10 +1,15 @@ TEMPLATE = subdirs + +contains(QT_CONFIG, opengl(es1|es2)?) { + SUBDIRS += \ + simplematerial \ + sgengine \ + textureinsgnode \ + openglunderqml \ + textureinthread \ + twotextureproviders +} + SUBDIRS += \ customgeometry \ - openglunderqml \ - sgengine \ - simplematerial \ - textureinsgnode \ - textureinthread \ - threadedanimation \ - twotextureproviders + threadedanimation 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) |