Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgrendernode.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSGRENDERNODE_H
6#define QSGRENDERNODE_H
7
8#include <QtQuick/qsgnode.h>
9
10QT_BEGIN_NAMESPACE
11
12class QSGRenderNodePrivate;
13class QRhiRenderTarget;
14class QRhiCommandBuffer;
15
16class Q_QUICK_EXPORT QSGRenderNode : public QSGNode
17{
18public:
19 enum StateFlag {
20 DepthState = 0x01,
21 StencilState = 0x02,
22 ScissorState = 0x04,
23 ColorState = 0x08,
24 BlendState = 0x10,
25 CullState = 0x20,
26 ViewportState = 0x40,
27 RenderTargetState = 0x80
28 };
29 Q_DECLARE_FLAGS(StateFlags, StateFlag)
30
31 enum RenderingFlag {
32 BoundedRectRendering = 0x01,
33 DepthAwareRendering = 0x02,
34 OpaqueRendering = 0x04,
35 NoExternalRendering = 0x08
36 };
37 Q_DECLARE_FLAGS(RenderingFlags, RenderingFlag)
38
39 struct Q_QUICK_EXPORT RenderState {
40 virtual ~RenderState();
41 virtual const QMatrix4x4 *projectionMatrix() const = 0;
42 virtual QRect scissorRect() const = 0;
43 virtual bool scissorEnabled() const = 0;
44 virtual int stencilValue() const = 0;
45 virtual bool stencilEnabled() const = 0;
46 virtual const QRegion *clipRegion() const = 0;
47 virtual void *get(const char *state) const;
48 };
49
50 QSGRenderNode();
51 ~QSGRenderNode() override;
52
53 virtual StateFlags changedStates() const;
54 virtual void prepare();
55 virtual void render(const RenderState *state) = 0;
56 virtual void releaseResources();
57 virtual RenderingFlags flags() const;
58 virtual QRectF rect() const;
59
60 const QMatrix4x4 *projectionMatrix() const;
61 const QMatrix4x4 *projectionMatrix(qsizetype index) const;
62 const QMatrix4x4 *matrix() const;
63 const QSGClipNode *clipList() const;
64 qreal inheritedOpacity() const;
65 QRhiRenderTarget *renderTarget() const;
66 QRhiCommandBuffer *commandBuffer() const;
67
68private:
69 QSGRenderNodePrivate *d;
70 friend class QSGRenderNodePrivate;
71};
72
73Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRenderNode::StateFlags)
74Q_DECLARE_OPERATORS_FOR_FLAGS(QSGRenderNode::RenderingFlags)
75
76QT_END_NAMESPACE
77
78#endif
The QSGRenderNode class represents a set of custom rendering commands targeting the graphics API that...
Combined button and popup list for selecting options.