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
qsgsoftwarerenderablenode_p.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 QSGSOFTWARERENDERABLENODE_H
6#define QSGSOFTWARERENDERABLENODE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick/private/qtquickglobal_p.h>
20
21#include <QtGui/QRegion>
22#include <QtCore/QRect>
23#include <QtGui/QTransform>
24#include <QtQuick/qsgrectanglenode.h>
25#include <QtQuick/qsgimagenode.h>
26#include <QtQuick/qsgninepatchnode.h>
27
29
30class QSGSimpleRectNode;
31class QSGSimpleTextureNode;
32class QSGSoftwareInternalImageNode;
33class QSGSoftwarePainterNode;
35class QSGSoftwareGlyphNode;
36class QSGSoftwareNinePatchNode;
38class QSGRenderNode;
39
40class Q_QUICK_EXPORT QSGSoftwareRenderableNode
41{
42public:
43 enum NodeType {
44 Invalid = -1,
45 SimpleRect,
46 SimpleTexture,
47 Image,
48 Painter,
49 Rectangle,
50 Glyph,
51 NinePatch,
52 SimpleRectangle,
53 SimpleImage,
54#if QT_CONFIG(quick_sprite)
55 SpriteNode,
56#endif
57 RenderNode
58 };
59
60 QSGSoftwareRenderableNode(NodeType type, QSGNode *node);
61 ~QSGSoftwareRenderableNode();
62
63 void update();
64
65 QRegion renderNode(QPainter *painter, bool forceOpaquePainting = false);
66 QRect boundingRectMin() const { return m_boundingRectMin; }
67 QRect boundingRectMax() const { return m_boundingRectMax; }
68 NodeType type() const { return m_nodeType; }
69 bool isOpaque() const { return m_isOpaque; }
70 bool isDirty() const { return m_isDirty; }
71 bool isDirtyRegionEmpty() const;
72 QSGNode *handle() const { return m_handle.node; }
73
74 void setTransform(const QTransform &transform);
75 void setClipRegion(const QRegion &clipRegion, bool hasClipRegion = true);
76 void setOpacity(float opacity);
77 QTransform transform() const { return m_transform; }
78 QRegion clipRegion() const { return m_clipRegion; }
79 float opacity() const { return m_opacity; }
80
81 void markGeometryDirty();
82 void markMaterialDirty();
83
84 void addDirtyRegion(const QRegion &dirtyRegion, bool forceDirty = true);
85 void subtractDirtyRegion(const QRegion &dirtyRegion);
86
87 QRegion previousDirtyRegion(bool wasRemoved = false) const;
88 QRegion dirtyRegion() const;
89
90private:
91 union RenderableNodeHandle {
92 QSGNode *node;
93 QSGSimpleRectNode *simpleRectNode;
94 QSGSimpleTextureNode *simpleTextureNode;
95 QSGSoftwareInternalImageNode *imageNode;
96 QSGSoftwarePainterNode *painterNode;
97 QSGSoftwareInternalRectangleNode *rectangleNode;
98 QSGSoftwareGlyphNode *glpyhNode;
99 QSGSoftwareNinePatchNode *ninePatchNode;
100 QSGRectangleNode *simpleRectangleNode;
101 QSGImageNode *simpleImageNode;
102 QSGSoftwareSpriteNode *spriteNode;
103 QSGRenderNode *renderNode;
104 };
105
106 const NodeType m_nodeType;
107 RenderableNodeHandle m_handle;
108
109 bool m_isOpaque;
110
111 bool m_isDirty;
112 QRegion m_dirtyRegion;
113 QRegion m_previousDirtyRegion;
114
115 QTransform m_transform;
116 QRegion m_clipRegion;
117 bool m_hasClipRegion;
118 float m_opacity;
119
120 QRect m_boundingRectMin;
121 QRect m_boundingRectMax;
122};
123
124QT_END_NAMESPACE
125
126#endif // QSGSOFTWARERENDERABLENODE_H
QSGSoftwareRenderableNodeUpdater(QSGAbstractSoftwareRenderer *renderer)
void updateNodes(QSGNode *node, bool isNodeRemoved=false)
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)