About
Contact
QtCreator
KDevelop
Solarized
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
#include
"qsgsoftwarerenderlistbuilder_p.h"
5
6
#include
"qsgsoftwarerenderablenode_p.h"
7
#include
"qsgabstractsoftwarerenderer_p.h"
8
#include
"qsgsoftwareinternalimagenode_p.h"
9
#include
"qsgsoftwareinternalrectanglenode_p.h"
10
#include
"qsgsoftwareglyphnode_p.h"
11
#include
"qsgsoftwarepublicnodes_p.h"
12
#include
"qsgsoftwarepainternode_p.h"
13
#include
"qsgsoftwarepixmaptexture_p.h"
14
15
#include <QtQuick/qsgsimplerectnode.h>
16
#include <QtQuick/qsgsimpletexturenode.h>
17
#include <QtQuick/qsgrendernode.h>
18
19
QT_BEGIN_NAMESPACE
20
21
QSGSoftwareRenderListBuilder
::
QSGSoftwareRenderListBuilder
(
QSGAbstractSoftwareRenderer
*
renderer
)
22
:
m_renderer
(
renderer
)
23
{
24
25
}
26
27
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGTransformNode
*)
28
{
29
return
true
;
30
}
31
32
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGTransformNode
*)
33
{
34
}
35
36
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGClipNode
*)
37
{
38
return
true
;
39
}
40
41
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGClipNode
*)
42
{
43
}
44
45
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGGeometryNode
*
node
)
46
{
47
return
addRenderableNode
(
node
);
48
}
49
50
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGGeometryNode
*)
51
{
52
}
53
54
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGOpacityNode
*)
55
{
56
return
true
;
57
}
58
59
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGOpacityNode
*)
60
{
61
}
62
63
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGInternalImageNode
*
node
)
64
{
65
return
addRenderableNode
(
node
);
66
}
67
68
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGInternalImageNode
*)
69
{
70
}
71
72
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGPainterNode
*
node
)
73
{
74
return
addRenderableNode
(
node
);
75
}
76
77
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGPainterNode
*)
78
{
79
}
80
81
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGInternalRectangleNode
*
node
)
82
{
83
return
addRenderableNode
(
node
);
84
}
85
86
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGInternalRectangleNode
*)
87
{
88
}
89
90
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGGlyphNode
*
node
)
91
{
92
return
addRenderableNode
(
node
);
93
}
94
95
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGGlyphNode
*)
96
{
97
}
98
99
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGRootNode
*)
100
{
101
return
true
;
102
}
103
104
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGRootNode
*)
105
{
106
}
107
108
#
if
QT_CONFIG
(quick_sprite)
109
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGSpriteNode
*
node
)
110
{
111
return
addRenderableNode
(
node
);
112
}
113
114
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGSpriteNode
*)
115
{
116
117
}
118
#
endif
119
120
bool
QSGSoftwareRenderListBuilder
::
visit
(
QSGRenderNode
*
node
)
121
{
122
return
addRenderableNode
(
node
);
123
}
124
125
void
QSGSoftwareRenderListBuilder
::
endVisit
(
QSGRenderNode
*)
126
{
127
}
128
129
bool
QSGSoftwareRenderListBuilder
::
addRenderableNode
(
QSGNode
*
node
)
130
{
131
auto
renderableNode
=
m_renderer
->
renderableNode
(
node
);
132
if
(
renderableNode
==
nullptr
) {
133
// Not a node we can render
134
return
false
;
135
}
136
m_renderer
->
appendRenderableNode
(
node:
renderableNode
);
137
return
true
;
138
}
139
140
QT_END_NAMESPACE
141