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
qsgabstractsoftwarerenderer_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 QSGABSTRACTSOFTWARERENDERER_H
6#define QSGABSTRACTSOFTWARERENDERER_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 <private/qsgrenderer_p.h>
20
21#include <QtCore/QHash>
22
23QT_BEGIN_NAMESPACE
24
25class QSGSimpleRectNode;
26
27class QSGSoftwareRenderableNode;
29
30class Q_QUICK_EXPORT QSGAbstractSoftwareRenderer : public QSGRenderer
31{
32public:
33 QSGAbstractSoftwareRenderer(QSGRenderContext *context);
34 virtual ~QSGAbstractSoftwareRenderer();
35
36 QSGSoftwareRenderableNode *renderableNode(QSGNode *node) const;
37 void addNodeMapping(QSGNode *node, QSGSoftwareRenderableNode *renderableNode);
38 void appendRenderableNode(QSGSoftwareRenderableNode *node);
39
40 void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override;
41
42 void markDirty();
43
44 void setClearColorEnabled(bool enable);
45 bool clearColorEnabled() const;
46
47protected:
48 QRegion renderNodes(QPainter *painter);
49 void buildRenderList();
50 QRegion optimizeRenderList();
51
52 void setBackgroundColor(const QColor &color);
53 void setBackgroundRect(const QRect &rect, qreal devicePixelRatio);
54 QColor backgroundColor();
55 QRect backgroundRect();
56 // only known after calling optimizeRenderList()
57 bool isOpaque() const { return m_isOpaque; }
58 const QList<QSGSoftwareRenderableNode*> &renderableNodes() const;
59
60private:
61 void nodeAdded(QSGNode *node);
62 void nodeRemoved(QSGNode *node);
63 void nodeGeometryUpdated(QSGNode *node);
64 void nodeMaterialUpdated(QSGNode *node);
65 void nodeMatrixUpdated(QSGNode *node);
66 void nodeOpacityUpdated(QSGNode *node);
67
68 QHash<QSGNode*, QSGSoftwareRenderableNode*> m_nodes;
69 QList<QSGSoftwareRenderableNode*> m_renderableNodes;
70
71 QSGSimpleRectNode *m_background;
72
73 QRegion m_dirtyRegion;
74 QRegion m_obscuredRegion;
75 qreal m_devicePixelRatio = 1;
76 bool m_isOpaque = false;
77 bool m_clearColorEnabled = true;
78
79 QSGSoftwareRenderableNodeUpdater *m_nodeUpdater;
80};
81
82QT_END_NAMESPACE
83
84#endif // QSGABSTRACTSOFTWARERENDERER_H
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)