diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-04-11 16:06:39 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-04-13 09:22:18 +0000 |
commit | 96a7afec18542396f8e9a0b0f75d219a08725b3f (patch) | |
tree | ba2ed094f071214a93afea29dd100e6669641fbb /src/quick/items/qquickshadereffect_p.h | |
parent | e188a3d864a5310bf18c3ad759a12560013deb64 (diff) |
Route ShaderEffect through the old GL impl
Register the common QQuickShaderEffect class as ShaderEffect to QML.
In case of GL this will route to QQuickOpenGLShaderEffect. For others
the default no-op implementation is used (at least for now). Later this
new implementation will route to a backend-specific scenegraph node via
the adaptation layer.
This also means that QQuickOpenGLShaderEffect is no longer a QQuickItem
and QQuickShaderEffect must handle everything item-related and forward.
Change-Id: I1ff4b674253543a04978a69f4a3b67f3a44dd983
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickshadereffect_p.h')
-rw-r--r-- | src/quick/items/qquickshadereffect_p.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h index 9368ecf89c..cabe657c3f 100644 --- a/src/quick/items/qquickshadereffect_p.h +++ b/src/quick/items/qquickshadereffect_p.h @@ -56,6 +56,8 @@ QT_BEGIN_NAMESPACE +class QQuickOpenGLShaderEffect; + class Q_QUICK_PRIVATE_EXPORT QQuickShaderEffect : public QQuickItem { Q_OBJECT @@ -106,6 +108,8 @@ public: QString log() const; Status status() const; + bool isComponentComplete() const; + Q_SIGNALS: void fragmentShaderChanged(); void vertexShaderChanged(); @@ -115,6 +119,22 @@ Q_SIGNALS: void logChanged(); void statusChanged(); void supportsAtlasTexturesChanged(); + +protected: + bool event(QEvent *e) override; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override; + void componentComplete() override; + void itemChange(ItemChange change, const ItemChangeData &value) override; + +private Q_SLOTS: + void sourceDestroyed(QObject *object); + void propertyChanged(int mappedId); + +private: +#ifndef QT_NO_OPENGL + QQuickOpenGLShaderEffect *m_glImpl; +#endif }; QT_END_NAMESPACE |