diff options
-rw-r--r-- | src/particles/qquickimageparticle.cpp | 10 | ||||
-rw-r--r-- | src/quick/items/qquickframebufferobject.cpp | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp index 07cbee1383..c68153aca8 100644 --- a/src/particles/qquickimageparticle.cpp +++ b/src/particles/qquickimageparticle.cpp @@ -49,6 +49,7 @@ #include <private/qquicksprite_p.h> #include <private/qquickspriteengine_p.h> #include <QOpenGLFunctions> +#include <QSGRendererInterface> #include <QtQuick/private/qsgshadersourcebuilder_p.h> #include <QtQuick/private/qsgtexture_p.h> #include <private/qqmlglobal_p.h> @@ -1469,8 +1470,17 @@ void QQuickImageParticle::finishBuildParticleNodes(QSGNode** node) update(); } +static inline bool isOpenGL(QSGRenderContext *rc) +{ + QSGRendererInterface *rif = rc->sceneGraphContext()->rendererInterface(rc); + return !rif || rif->graphicsApi() == QSGRendererInterface::OpenGL; +} + QSGNode *QQuickImageParticle::updatePaintNode(QSGNode *node, UpdatePaintNodeData *) { + if (!node && !isOpenGL(QQuickItemPrivate::get(this)->sceneGraphRenderContext())) + return 0; + if (m_pleaseReset){ if (node) delete node; diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index d8147a48a5..857cd44b15 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -44,6 +44,7 @@ #include <private/qquickitem_p.h> #include <QSGSimpleTextureNode> +#include <QSGRendererInterface> QT_BEGIN_NAMESPACE @@ -260,6 +261,12 @@ public: int devicePixelRatio; }; +static inline bool isOpenGL(QSGRenderContext *rc) +{ + QSGRendererInterface *rif = rc->sceneGraphContext()->rendererInterface(rc); + return !rif || rif->graphicsApi() == QSGRendererInterface::OpenGL; +} + /*! * \internal */ @@ -278,6 +285,8 @@ QSGNode *QQuickFramebufferObject::updatePaintNode(QSGNode *node, UpdatePaintNode Q_D(QQuickFramebufferObject); if (!n) { + if (!isOpenGL(d->sceneGraphRenderContext())) + return 0; if (!d->node) d->node = new QSGFramebufferObjectNode; n = d->node; @@ -360,6 +369,8 @@ QSGTextureProvider *QQuickFramebufferObject::textureProvider() const qWarning("QQuickFramebufferObject::textureProvider: can only be queried on the rendering thread of an exposed window"); return 0; } + if (!isOpenGL(d->sceneGraphRenderContext())) + return 0; if (!d->node) d->node = new QSGFramebufferObjectNode; return d->node; |