From 96a7afec18542396f8e9a0b0f75d219a08725b3f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 11 Apr 2016 16:06:39 +0200 Subject: 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 --- src/quick/items/qquickshadereffect_p.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/quick/items/qquickshadereffect_p.h') 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 -- cgit v1.2.3