| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | // |
| 5 | // W A R N I N G |
| 6 | // ------------- |
| 7 | // |
| 8 | // This file is not part of the QtDataVisualization API. It exists purely as an |
| 9 | // implementation detail. This header file may change from version to |
| 10 | // version without notice, or even be removed. |
| 11 | // |
| 12 | // We mean it. |
| 13 | |
| 14 | #ifndef DECLARATIVERENDERNODE_P_H |
| 15 | #define DECLARATIVERENDERNODE_P_H |
| 16 | |
| 17 | #include <private/datavisualizationglobal_p.h> |
| 18 | |
| 19 | #include <QtQuick/QSGGeometryNode> |
| 20 | #include <QtQuick/QSGTextureMaterial> |
| 21 | #include <QtQuick/QQuickWindow> |
| 22 | #include <QtCore/QMutex> |
| 23 | #include <QtCore/QSharedPointer> |
| 24 | #include <QtCore/QObject> |
| 25 | |
| 26 | QT_BEGIN_NAMESPACE |
| 27 | |
| 28 | class Abstract3DController; |
| 29 | class AbstractDeclarative; |
| 30 | |
| 31 | class DeclarativeRenderNode : public QObject, public QSGGeometryNode |
| 32 | { |
| 33 | Q_OBJECT |
| 34 | public: |
| 35 | DeclarativeRenderNode(AbstractDeclarative *declarative, |
| 36 | const QSharedPointer<QMutex> &nodeMutex); |
| 37 | ~DeclarativeRenderNode(); |
| 38 | |
| 39 | void setSize(const QSize &size); |
| 40 | QSize size() const { return m_size; } |
| 41 | |
| 42 | void update(); |
| 43 | void updateFBO(); |
| 44 | |
| 45 | void setController(Abstract3DController *controller); |
| 46 | void setQuickWindow(QQuickWindow *window); |
| 47 | void setSamples(int samples); |
| 48 | |
| 49 | void preprocess() override; |
| 50 | |
| 51 | public Q_SLOTS: |
| 52 | void handleControllerDestroyed(); |
| 53 | |
| 54 | private: |
| 55 | QSGTextureMaterial m_material; |
| 56 | QSGOpaqueTextureMaterial m_materialO; |
| 57 | QSGGeometry m_geometry; |
| 58 | QSGTexture *m_texture; |
| 59 | QSize m_size; |
| 60 | |
| 61 | AbstractDeclarative *m_declarative; |
| 62 | Abstract3DController *m_controller; |
| 63 | QOpenGLFramebufferObject *m_fbo; |
| 64 | QOpenGLFramebufferObject *m_multisampledFBO; |
| 65 | QQuickWindow *m_window; |
| 66 | int m_samples; |
| 67 | |
| 68 | bool m_dirtyFBO; |
| 69 | |
| 70 | QSharedPointer<QMutex> m_nodeMutex; |
| 71 | |
| 72 | }; |
| 73 | |
| 74 | QT_END_NAMESPACE |
| 75 | |
| 76 | #endif |
| 77 |
