Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickshadereffect.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | class QQuickShaderEffectPrivate : public QQuickItemPrivate | - | ||||||
6 | { | - | ||||||
7 | inline QQuickShaderEffect* q_func() { return static_cast<QQuickShaderEffect *>(q_ptr); } inline const QQuickShaderEffect* q_func() const { return static_cast<const QQuickShaderEffect *>(q_ptr); } friend class QQuickShaderEffect; | - | ||||||
8 | - | |||||||
9 | public: | - | ||||||
10 | void updatePolish() override; | - | ||||||
11 | }; | - | ||||||
12 | - | |||||||
13 | QSGContextFactoryInterface::Flags qsg_backend_flags(); | - | ||||||
14 | - | |||||||
15 | QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent) | - | ||||||
16 | : QQuickItem(*new QQuickShaderEffectPrivate, parent), | - | ||||||
17 | - | |||||||
18 | m_glImpl(nullptr), | - | ||||||
19 | - | |||||||
20 | m_impl(nullptr) | - | ||||||
21 | { | - | ||||||
22 | setFlag(QQuickItem::ItemHasContents); | - | ||||||
23 | - | |||||||
24 | - | |||||||
25 | if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode)
| 0-108 | ||||||
26 | m_glImpl = new QQuickOpenGLShaderEffect(this, this); executed 108 times by 5 tests: m_glImpl = new QQuickOpenGLShaderEffect(this, this); Executed by:
| 108 | ||||||
27 | - | |||||||
28 | if (!m_glImpl
| 0-108 | ||||||
29 | - | |||||||
30 | m_impl = new QQuickGenericShaderEffect(this, this); never executed: m_impl = new QQuickGenericShaderEffect(this, this); | 0 | ||||||
31 | } executed 108 times by 5 tests: end of block Executed by:
| 108 | ||||||
32 | QByteArray QQuickShaderEffect::fragmentShader() const | - | ||||||
33 | { | - | ||||||
34 | - | |||||||
35 | if (m_glImpl
| 0 | ||||||
36 | return never executed: m_glImpl->fragmentShader();return m_glImpl->fragmentShader(); never executed: return m_glImpl->fragmentShader(); | 0 | ||||||
37 | - | |||||||
38 | return never executed: m_impl->fragmentShader();return m_impl->fragmentShader(); never executed: return m_impl->fragmentShader(); | 0 | ||||||
39 | } | - | ||||||
40 | - | |||||||
41 | void QQuickShaderEffect::setFragmentShader(const QByteArray &code) | - | ||||||
42 | { | - | ||||||
43 | - | |||||||
44 | if (m_glImpl
| 0-100 | ||||||
45 | m_glImpl->setFragmentShader(code); | - | ||||||
46 | return; executed 100 times by 4 tests: return; Executed by:
| 100 | ||||||
47 | } | - | ||||||
48 | - | |||||||
49 | m_impl->setFragmentShader(code); | - | ||||||
50 | } never executed: end of block | 0 | ||||||
51 | QByteArray QQuickShaderEffect::vertexShader() const | - | ||||||
52 | { | - | ||||||
53 | - | |||||||
54 | if (m_glImpl
| 0 | ||||||
55 | return never executed: m_glImpl->vertexShader();return m_glImpl->vertexShader(); never executed: return m_glImpl->vertexShader(); | 0 | ||||||
56 | - | |||||||
57 | return never executed: m_impl->vertexShader();return m_impl->vertexShader(); never executed: return m_impl->vertexShader(); | 0 | ||||||
58 | } | - | ||||||
59 | - | |||||||
60 | void QQuickShaderEffect::setVertexShader(const QByteArray &code) | - | ||||||
61 | { | - | ||||||
62 | - | |||||||
63 | if (m_glImpl
| 0-36 | ||||||
64 | m_glImpl->setVertexShader(code); | - | ||||||
65 | return; executed 36 times by 1 test: return; Executed by:
| 36 | ||||||
66 | } | - | ||||||
67 | - | |||||||
68 | m_impl->setVertexShader(code); | - | ||||||
69 | } never executed: end of block | 0 | ||||||
70 | bool QQuickShaderEffect::blending() const | - | ||||||
71 | { | - | ||||||
72 | - | |||||||
73 | if (m_glImpl
| 0 | ||||||
74 | return never executed: m_glImpl->blending();return m_glImpl->blending(); never executed: return m_glImpl->blending(); | 0 | ||||||
75 | - | |||||||
76 | return never executed: m_impl->blending();return m_impl->blending(); never executed: return m_impl->blending(); | 0 | ||||||
77 | } | - | ||||||
78 | - | |||||||
79 | void QQuickShaderEffect::setBlending(bool enable) | - | ||||||
80 | { | - | ||||||
81 | - | |||||||
82 | if (m_glImpl
| 0 | ||||||
83 | m_glImpl->setBlending(enable); | - | ||||||
84 | return; never executed: return; | 0 | ||||||
85 | } | - | ||||||
86 | - | |||||||
87 | m_impl->setBlending(enable); | - | ||||||
88 | } never executed: end of block | 0 | ||||||
89 | QVariant QQuickShaderEffect::mesh() const | - | ||||||
90 | { | - | ||||||
91 | - | |||||||
92 | if (m_glImpl
| 0 | ||||||
93 | return never executed: m_glImpl->mesh();return m_glImpl->mesh(); never executed: return m_glImpl->mesh(); | 0 | ||||||
94 | - | |||||||
95 | return never executed: m_impl->mesh();return m_impl->mesh(); never executed: return m_impl->mesh(); | 0 | ||||||
96 | } | - | ||||||
97 | - | |||||||
98 | void QQuickShaderEffect::setMesh(const QVariant &mesh) | - | ||||||
99 | { | - | ||||||
100 | - | |||||||
101 | if (m_glImpl
| 0-2 | ||||||
102 | m_glImpl->setMesh(mesh); | - | ||||||
103 | return; executed 2 times by 1 test: return; Executed by:
| 2 | ||||||
104 | } | - | ||||||
105 | - | |||||||
106 | m_impl->setMesh(mesh); | - | ||||||
107 | } never executed: end of block | 0 | ||||||
108 | QQuickShaderEffect::CullMode QQuickShaderEffect::cullMode() const | - | ||||||
109 | { | - | ||||||
110 | - | |||||||
111 | if (m_glImpl
| 0 | ||||||
112 | return never executed: m_glImpl->cullMode();return m_glImpl->cullMode(); never executed: return m_glImpl->cullMode(); | 0 | ||||||
113 | - | |||||||
114 | return never executed: m_impl->cullMode();return m_impl->cullMode(); never executed: return m_impl->cullMode(); | 0 | ||||||
115 | } | - | ||||||
116 | - | |||||||
117 | void QQuickShaderEffect::setCullMode(CullMode face) | - | ||||||
118 | { | - | ||||||
119 | - | |||||||
120 | if (m_glImpl
| 0 | ||||||
121 | m_glImpl->setCullMode(face); | - | ||||||
122 | return; never executed: return; | 0 | ||||||
123 | } | - | ||||||
124 | - | |||||||
125 | return never executed: m_impl->setCullMode(face);return m_impl->setCullMode(face); never executed: return m_impl->setCullMode(face); | 0 | ||||||
126 | } | - | ||||||
127 | bool QQuickShaderEffect::supportsAtlasTextures() const | - | ||||||
128 | { | - | ||||||
129 | - | |||||||
130 | if (m_glImpl
| 0 | ||||||
131 | return never executed: m_glImpl->supportsAtlasTextures();return m_glImpl->supportsAtlasTextures(); never executed: return m_glImpl->supportsAtlasTextures(); | 0 | ||||||
132 | - | |||||||
133 | return never executed: m_impl->supportsAtlasTextures();return m_impl->supportsAtlasTextures(); never executed: return m_impl->supportsAtlasTextures(); | 0 | ||||||
134 | } | - | ||||||
135 | - | |||||||
136 | void QQuickShaderEffect::setSupportsAtlasTextures(bool supports) | - | ||||||
137 | { | - | ||||||
138 | - | |||||||
139 | if (m_glImpl
| 0-4 | ||||||
140 | m_glImpl->setSupportsAtlasTextures(supports); | - | ||||||
141 | return; executed 4 times by 1 test: return; Executed by:
| 4 | ||||||
142 | } | - | ||||||
143 | - | |||||||
144 | m_impl->setSupportsAtlasTextures(supports); | - | ||||||
145 | } never executed: end of block | 0 | ||||||
146 | QString QQuickShaderEffect::log() const | - | ||||||
147 | { | - | ||||||
148 | - | |||||||
149 | if (m_glImpl
| 0 | ||||||
150 | return never executed: m_glImpl->log();return m_glImpl->log(); never executed: return m_glImpl->log(); | 0 | ||||||
151 | - | |||||||
152 | return never executed: m_impl->log();return m_impl->log(); never executed: return m_impl->log(); | 0 | ||||||
153 | } | - | ||||||
154 | - | |||||||
155 | QQuickShaderEffect::Status QQuickShaderEffect::status() const | - | ||||||
156 | { | - | ||||||
157 | - | |||||||
158 | if (m_glImpl
| 0 | ||||||
159 | return never executed: m_glImpl->status();return m_glImpl->status(); never executed: return m_glImpl->status(); | 0 | ||||||
160 | - | |||||||
161 | return never executed: m_impl->status();return m_impl->status(); never executed: return m_impl->status(); | 0 | ||||||
162 | } | - | ||||||
163 | - | |||||||
164 | bool QQuickShaderEffect::event(QEvent *e) | - | ||||||
165 | { | - | ||||||
166 | - | |||||||
167 | if (m_glImpl
| 32-108 | ||||||
168 | m_glImpl->handleEvent(e); | - | ||||||
169 | return executed 32 times by 2 tests: QQuickItem::event(e);return QQuickItem::event(e); Executed by:
executed 32 times by 2 tests: return QQuickItem::event(e); Executed by:
| 32 | ||||||
170 | } | - | ||||||
171 | - | |||||||
172 | m_impl->handleEvent(e); | - | ||||||
173 | return executed 108 times by 5 tests: QQuickItem::event(e);return QQuickItem::event(e); Executed by:
executed 108 times by 5 tests: return QQuickItem::event(e); Executed by:
| 108 | ||||||
174 | } | - | ||||||
175 | - | |||||||
176 | void QQuickShaderEffect::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) | - | ||||||
177 | { | - | ||||||
178 | - | |||||||
179 | if (m_glImpl
| 0-122 | ||||||
180 | m_glImpl->handleGeometryChanged(newGeometry, oldGeometry); | - | ||||||
181 | QQuickItem::geometryChanged(newGeometry, oldGeometry); | - | ||||||
182 | return; executed 122 times by 5 tests: return; Executed by:
| 122 | ||||||
183 | } | - | ||||||
184 | - | |||||||
185 | m_impl->handleGeometryChanged(newGeometry, oldGeometry); | - | ||||||
186 | QQuickItem::geometryChanged(newGeometry, oldGeometry); | - | ||||||
187 | } never executed: end of block | 0 | ||||||
188 | - | |||||||
189 | QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) | - | ||||||
190 | { | - | ||||||
191 | - | |||||||
192 | if (m_glImpl
| 0-72 | ||||||
193 | return executed 72 times by 5 tests: m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData);return m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData); Executed by:
executed 72 times by 5 tests: return m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData); Executed by:
| 72 | ||||||
194 | - | |||||||
195 | return never executed: m_impl->handleUpdatePaintNode(oldNode, updatePaintNodeData);return m_impl->handleUpdatePaintNode(oldNode, updatePaintNodeData); never executed: return m_impl->handleUpdatePaintNode(oldNode, updatePaintNodeData); | 0 | ||||||
196 | } | - | ||||||
197 | - | |||||||
198 | void QQuickShaderEffect::componentComplete() | - | ||||||
199 | { | - | ||||||
200 | - | |||||||
201 | if (m_glImpl
| 0-108 | ||||||
202 | m_glImpl->maybeUpdateShaders(); | - | ||||||
203 | QQuickItem::componentComplete(); | - | ||||||
204 | return; executed 108 times by 5 tests: return; Executed by:
| 108 | ||||||
205 | } | - | ||||||
206 | - | |||||||
207 | m_impl->maybeUpdateShaders(); | - | ||||||
208 | QQuickItem::componentComplete(); | - | ||||||
209 | } never executed: end of block | 0 | ||||||
210 | - | |||||||
211 | void QQuickShaderEffect::itemChange(ItemChange change, const ItemChangeData &value) | - | ||||||
212 | { | - | ||||||
213 | - | |||||||
214 | if (m_glImpl
| 0-292 | ||||||
215 | m_glImpl->handleItemChange(change, value); | - | ||||||
216 | QQuickItem::itemChange(change, value); | - | ||||||
217 | return; executed 292 times by 5 tests: return; Executed by:
| 292 | ||||||
218 | } | - | ||||||
219 | - | |||||||
220 | m_impl->handleItemChange(change, value); | - | ||||||
221 | QQuickItem::itemChange(change, value); | - | ||||||
222 | } never executed: end of block | 0 | ||||||
223 | - | |||||||
224 | bool QQuickShaderEffect::isComponentComplete() const | - | ||||||
225 | { | - | ||||||
226 | return executed 136 times by 4 tests: QQuickItem::isComponentComplete();return QQuickItem::isComponentComplete(); Executed by:
executed 136 times by 4 tests: return QQuickItem::isComponentComplete(); Executed by:
| 136 | ||||||
227 | } | - | ||||||
228 | - | |||||||
229 | QString QQuickShaderEffect::parseLog() | - | ||||||
230 | { | - | ||||||
231 | - | |||||||
232 | if (m_glImpl
| 0-36 | ||||||
233 | return executed 36 times by 1 test: m_glImpl->parseLog();return m_glImpl->parseLog(); Executed by:
executed 36 times by 1 test: return m_glImpl->parseLog(); Executed by:
| 36 | ||||||
234 | - | |||||||
235 | return never executed: m_impl->parseLog();return m_impl->parseLog(); never executed: return m_impl->parseLog(); | 0 | ||||||
236 | } | - | ||||||
237 | - | |||||||
238 | void QQuickShaderEffectPrivate::updatePolish() | - | ||||||
239 | { | - | ||||||
240 | QQuickShaderEffect * const q = q_func(); | - | ||||||
241 | - | |||||||
242 | if (q->m_glImpl
| 0-40 | ||||||
243 | q->m_glImpl->maybeUpdateShaders(); | - | ||||||
244 | return; executed 40 times by 5 tests: return; Executed by:
| 40 | ||||||
245 | } | - | ||||||
246 | - | |||||||
247 | q->m_impl->maybeUpdateShaders(); | - | ||||||
248 | } never executed: end of block | 0 | ||||||
249 | - | |||||||
250 | - | |||||||
251 | bool QQuickShaderEffect::isOpenGLShaderEffect() const | - | ||||||
252 | { | - | ||||||
253 | return executed 4 times by 1 test: m_glImpl != nullptr;return m_glImpl != nullptr; Executed by:
executed 4 times by 1 test: return m_glImpl != nullptr; Executed by:
| 4 | ||||||
254 | } | - | ||||||
255 | - | |||||||
256 | - | |||||||
257 | - | |||||||
258 | - | |||||||
Switch to Source code | Preprocessed file |