Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QSGABSTRACTSOFTWARERENDERER_H
5#define QSGABSTRACTSOFTWARERENDERER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qsgrenderer_p.h>
19
20#include <QtCore/QHash>
21
23
25
28
29class Q_QUICK_EXPORT QSGAbstractSoftwareRenderer : public QSGRenderer
30{
31public:
34
35 QSGSoftwareRenderableNode *renderableNode(QSGNode *node) const;
36 void addNodeMapping(QSGNode *node, QSGSoftwareRenderableNode *renderableNode);
37 void appendRenderableNode(QSGSoftwareRenderableNode *node);
38
39 void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override;
40
41 void markDirty();
42
43protected:
44 QRegion renderNodes(QPainter *painter);
45 void buildRenderList();
46 QRegion optimizeRenderList();
47
48 void setBackgroundColor(const QColor &color);
49 void setBackgroundRect(const QRect &rect, qreal devicePixelRatio);
50 QColor backgroundColor();
51 QRect backgroundRect();
52 // only known after calling optimizeRenderList()
53 bool isOpaque() const { return m_isOpaque; }
54 const QVector<QSGSoftwareRenderableNode*> &renderableNodes() const;
55
56private:
57 void nodeAdded(QSGNode *node);
58 void nodeRemoved(QSGNode *node);
59 void nodeGeometryUpdated(QSGNode *node);
60 void nodeMaterialUpdated(QSGNode *node);
61 void nodeMatrixUpdated(QSGNode *node);
62 void nodeOpacityUpdated(QSGNode *node);
63
64 QHash<QSGNode*, QSGSoftwareRenderableNode*> m_nodes;
65 QVector<QSGSoftwareRenderableNode*> m_renderableNodes;
66
67 QSGSimpleRectNode *m_background;
68
69 QRegion m_dirtyRegion;
70 QRegion m_obscuredRegion;
71 qreal m_devicePixelRatio = 1;
72 bool m_isOpaque = false;
73
75};
76
78
79#endif // QSGABSTRACTSOFTWARERENDERER_H
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
The renderer class is the abstract baseclass used for rendering the QML scene graph.
The QSGSimpleRectNode class is a convenience class for drawing solid filled rectangles using scenegra...
rect
[4]
else opt state
[0]
Combined button and popup list for selecting options.
static void * context
GLuint color
[2]
double qreal
Definition qtypes.h:187
QPainter painter(this)
[7]