qglshaderprogram.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/opengl/qglshaderprogram.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3class QGLShaderPrivate : public QObjectPrivate-
4{-
5 inline QGLShader* q_func() { return static_cast<QGLShader *>(q_ptr); } inline const QGLShader* q_func() const { return static_cast<const QGLShader *>(q_ptr); } friend class QGLShader;-
6public:-
7 QGLShaderPrivate(const QGLContext *ctx, QGLShader::ShaderType type)-
8 : shaderGuard(0)-
9 , shaderType(type)-
10 , compiled(false)-
11 , glfuncs(new QOpenGLFunctions(ctx->contextHandle()))-
12 {-
13 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
6
14 ~QGLShaderPrivate();-
15-
16 QGLSharedResourceGuardBase *shaderGuard;-
17 QGLShader::ShaderType shaderType;-
18 bool compiled;-
19 QString log;-
20-
21 QOpenGLFunctions *glfuncs;-
22-
23 bool create();-
24 bool compile(QGLShader *q);-
25 void deleteShader();-
26};-
27-
28namespace {-
29 void freeShaderFunc(QGLContext *ctx, GLuint id)-
30 {-
31 ((!(ctx)) ? qt_assert("ctx",__FILE__,223) : qt_noop());-
32 ctx->contextHandle()->functions()->glDeleteShader(id);-
33 }
never executed: end of block
0
34}-
35-
36-
37-
38QGLShaderPrivate::~QGLShaderPrivate()-
39{-
40 delete glfuncs;-
41 if (shaderGuard
shaderGuardDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
)
0-6
42 shaderGuard->free();
executed 6 times by 1 test: shaderGuard->free();
Executed by:
  • tst_qmdiarea - unknown status
6
43}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
6
44-
45bool QGLShaderPrivate::create()-
46{-
47 QGLContext *context = const_cast<QGLContext *>(QGLContext::currentContext());-
48 if (!context
!contextDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-6
49 return
never executed: return false;
false;
never executed: return false;
0
50-
51 if (glfuncs->hasOpenGLFeature(QOpenGLFunctions::Shaders)
glfuncs->hasOp...ions::Shaders)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-6
52 GLuint shader;-
53 if (shaderType == QGLShader::Vertex
shaderType == ...Shader::VertexDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
3
54 shader = glfuncs->glCreateShader(0x8B31);
executed 3 times by 1 test: shader = glfuncs->glCreateShader(0x8B31);
Executed by:
  • tst_qmdiarea - unknown status
3
55-
56 else if (shaderType == QGLShader::Geometry
shaderType == ...ader::GeometryDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
0-3
57 && !context->contextHandle()->isOpenGLES()
!context->cont...->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
58 shader = glfuncs->glCreateShader(0x8DD9);
never executed: shader = glfuncs->glCreateShader(0x8DD9);
0
59-
60 else-
61 shader = glfuncs->glCreateShader(0x8B30);
executed 3 times by 1 test: shader = glfuncs->glCreateShader(0x8B30);
Executed by:
  • tst_qmdiarea - unknown status
3
62 if (!shader
!shaderDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-6
63 QMessageLogger(__FILE__, 255, __PRETTY_FUNCTION__).warning("Could not create shader of type %d.", int(shaderType));-
64 return
never executed: return false;
false;
never executed: return false;
0
65 }-
66 shaderGuard = createSharedResourceGuard(context, shader, freeShaderFunc);-
67 return
executed 6 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
6
68 } else {-
69 return
never executed: return false;
false;
never executed: return false;
0
70 }-
71}-
72-
73bool QGLShaderPrivate::compile(QGLShader *q)-
74{-
75 GLuint shader = shaderGuard
shaderGuardDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
? shaderGuard->id() : 0;
0-6
76 if (!shader
!shaderDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-6
77 return
never executed: return false;
false;
never executed: return false;
0
78 glfuncs->glCompileShader(shader);-
79 GLint value = 0;-
80 glfuncs->glGetShaderiv(shader, 0x8B81, &value);-
81 compiled = (value != 0);-
82 value = 0;-
83 glfuncs->glGetShaderiv(shader, 0x8B84, &value);-
84 if (!compiled
!compiledDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
&& value > 1
value > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-6
85 char *logbuf = new char [value];-
86 GLint len;-
87 glfuncs->glGetShaderInfoLog(shader, value, &len, logbuf);-
88 log = QString::fromLatin1(logbuf);-
89 QString name = q->objectName();-
90-
91 const char *types[] = {-
92 "Fragment",-
93 "Vertex",-
94 "Geometry",-
95 ""-
96 };-
97-
98 const char *type = types[3];-
99 if (shaderType == QGLShader::Fragment
shaderType == ...ader::FragmentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
100 type = types[0];
never executed: type = types[0];
0
101 else if (shaderType == QGLShader::Vertex
shaderType == ...Shader::VertexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
102 type = types[1];
never executed: type = types[1];
0
103 else if (shaderType == QGLShader::Geometry
shaderType == ...ader::GeometryDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
104 type = types[2];
never executed: type = types[2];
0
105-
106 if (name.isEmpty()
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
107 QMessageLogger(__FILE__, 299, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s): %s", type, QString(log).toLocal8Bit().constData());
never executed: QMessageLogger(__FILE__, 299, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s): %s", type, QString(log).toLocal8Bit().constData());
0
108 else-
109 QMessageLogger(__FILE__, 301, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s)[%s]: %s", type, QString(name).toLocal8Bit().constData(), QString(log).toLocal8Bit().constData());
never executed: QMessageLogger(__FILE__, 301, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s)[%s]: %s", type, QString(name).toLocal8Bit().constData(), QString(log).toLocal8Bit().constData());
0
110-
111 delete [] logbuf;-
112 }
never executed: end of block
0
113 return
executed 6 times by 1 test: return compiled;
Executed by:
  • tst_qmdiarea - unknown status
compiled;
executed 6 times by 1 test: return compiled;
Executed by:
  • tst_qmdiarea - unknown status
6
114}-
115-
116void QGLShaderPrivate::deleteShader()-
117{-
118 if (shaderGuard
shaderGuardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
119 shaderGuard->free();-
120 shaderGuard = 0;-
121 }
never executed: end of block
0
122}
never executed: end of block
0
123QGLShader::QGLShader(QGLShader::ShaderType type, QObject *parent)-
124 : QObject(*new QGLShaderPrivate(QGLContext::currentContext(), type), parent)-
125{-
126 QGLShaderPrivate * const d = d_func();-
127 d->create();-
128}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
2
129QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent)-
130 : QObject(*new QGLShaderPrivate(context ? context : QGLContext::currentContext(), type), parent)-
131{-
132 QGLShaderPrivate * const d = d_func();-
133-
134 if (context
contextDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& !QGLContext::areSharing(context, QGLContext::currentContext())
!QGLContext::a...rentContext())Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-4
135 QMessageLogger(__FILE__, 353, __PRETTY_FUNCTION__).warning("QGLShader::QGLShader: \'context\' must be the current context or sharing with it.");-
136 return;
never executed: return;
0
137 }-
138-
139 d->create();-
140}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
4
141-
142-
143-
144-
145-
146-
147QGLShader::~QGLShader()-
148{-
149}-
150-
151-
152-
153-
154QGLShader::ShaderType QGLShader::shaderType() const-
155{-
156 const QGLShaderPrivate * const d = d_func();-
157 return
executed 6 times by 1 test: return d->shaderType;
Executed by:
  • tst_qmdiarea - unknown status
d->shaderType;
executed 6 times by 1 test: return d->shaderType;
Executed by:
  • tst_qmdiarea - unknown status
6
158}-
159-
160-
161-
162-
163-
164-
165static const char qualifierDefines[] =-
166 "#define lowp\n"-
167 "#define mediump\n"-
168 "#define highp\n";-
169bool QGLShader::compileSourceCode(const char *source)-
170{-
171 QGLShaderPrivate * const d = d_func();-
172 if (d->shaderGuard
d->shaderGuardDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& d->shaderGuard->id()
d->shaderGuard->id()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-6
173 QVarLengthArray<const char *, 4> src;-
174 QVarLengthArray<GLint, 4> srclen;-
175 int headerLen = 0;-
176 while (source
sourceDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& source[headerLen] == '#'
source[headerLen] == '#'Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-6
177-
178-
179-
180 if (qstrncmp(source + headerLen, "#version", 8) != 0
qstrncmp(sourc...sion", 8) != 0Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
181 qstrncmp(source + headerLen, "#extension", 10) != 0
qstrncmp(sourc...ion", 10) != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
182 break;
never executed: break;
0
183 }-
184 while (source[headerLen] != '\0'
source[headerLen] != '\0'Description
TRUEnever evaluated
FALSEnever evaluated
&& source[headerLen] != '\n'
source[headerLen] != '\n'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
185 ++
never executed: ++headerLen;
headerLen;
never executed: ++headerLen;
0
186 if (source[headerLen] == '\n'
source[headerLen] == '\n'Description
TRUEnever evaluated
FALSEnever evaluated
)
0
187 ++
never executed: ++headerLen;
headerLen;
never executed: ++headerLen;
0
188 }
never executed: end of block
0
189 if (headerLen > 0
headerLen > 0Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-6
190 src.append(source);-
191 srclen.append(GLint(headerLen));-
192 }
never executed: end of block
0
193-
194 if (!QOpenGLContext::currentContext()->isOpenGLES()
!QOpenGLContex...->isOpenGLES()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-6
195 src.append(qualifierDefines);-
196 srclen.append(GLint(sizeof(qualifierDefines) - 1));-
197 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
6
198 src.append(source + headerLen);-
199 srclen.append(GLint(qstrlen(source + headerLen)));-
200 d->glfuncs->glShaderSource(d->shaderGuard->id(), src.size(), src.data(), srclen.data());-
201 return
executed 6 times by 1 test: return d->compile(this);
Executed by:
  • tst_qmdiarea - unknown status
d->compile(this);
executed 6 times by 1 test: return d->compile(this);
Executed by:
  • tst_qmdiarea - unknown status
6
202 } else {-
203 return
never executed: return false;
false;
never executed: return false;
0
204 }-
205}-
206bool QGLShader::compileSourceCode(const QByteArray& source)-
207{-
208 return
executed 6 times by 1 test: return compileSourceCode(source.constData());
Executed by:
  • tst_qmdiarea - unknown status
compileSourceCode(source.constData());
executed 6 times by 1 test: return compileSourceCode(source.constData());
Executed by:
  • tst_qmdiarea - unknown status
6
209}-
210bool QGLShader::compileSourceCode(const QString& source)-
211{-
212 return
never executed: return compileSourceCode(source.toLatin1().constData());
compileSourceCode(source.toLatin1().constData());
never executed: return compileSourceCode(source.toLatin1().constData());
0
213}-
214bool QGLShader::compileSourceFile(const QString& fileName)-
215{-
216 QFile file(fileName);-
217 if (!file.open(QFile::ReadOnly)
!file.open(QFile::ReadOnly)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
218 QMessageLogger(__FILE__, 488, __PRETTY_FUNCTION__).warning() << "QGLShader: Unable to open file" << fileName;-
219 return
never executed: return false;
false;
never executed: return false;
0
220 }-
221-
222 QByteArray contents = file.readAll();-
223 return
never executed: return compileSourceCode(contents.constData());
compileSourceCode(contents.constData());
never executed: return compileSourceCode(contents.constData());
0
224}-
225-
226-
227-
228-
229-
230-
231QByteArray QGLShader::sourceCode() const-
232{-
233 const QGLShaderPrivate * const d = d_func();-
234 GLuint shader = d->shaderGuard
d->shaderGuardDescription
TRUEnever evaluated
FALSEnever evaluated
? d->shaderGuard->id() : 0;
0
235 if (!shader
!shaderDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
236 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
237 GLint size = 0;-
238 d->glfuncs->glGetShaderiv(shader, 0x8B88, &size);-
239 if (size <= 0
size <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
240 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
241 GLint len = 0;-
242 char *source = new char [size];-
243 d->glfuncs->glGetShaderSource(shader, size, &len, source);-
244 QByteArray src(source);-
245 delete [] source;-
246 return
never executed: return src;
src;
never executed: return src;
0
247}-
248-
249-
250-
251-
252-
253-
254bool QGLShader::isCompiled() const-
255{-
256 const QGLShaderPrivate * const d = d_func();-
257 return
never executed: return d->compiled;
d->compiled;
never executed: return d->compiled;
0
258}-
259-
260-
261-
262-
263-
264-
265QString QGLShader::log() const-
266{-
267 const QGLShaderPrivate * const d = d_func();-
268 return
never executed: return d->log;
d->log;
never executed: return d->log;
0
269}-
270-
271-
272-
273-
274-
275-
276GLuint QGLShader::shaderId() const-
277{-
278 const QGLShaderPrivate * const d = d_func();-
279 return
never executed: return d->shaderGuard ? d->shaderGuard->id() : 0;
d->shaderGuard ? d->shaderGuard->id() : 0;
never executed: return d->shaderGuard ? d->shaderGuard->id() : 0;
0
280}-
281-
282-
283-
284class ShaderProgramOpenGLFunctions : public QOpenGLFunctions-
285{-
286public:-
287 ShaderProgramOpenGLFunctions()-
288 : QOpenGLFunctions()-
289 , glProgramParameteri(0)-
290 {-
291 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
292-
293 typedef void ( * type_glProgramParameteri)(GLuint program, GLenum pname, GLint value);-
294-
295 void initializeGeometryShaderFunctions()-
296 {-
297 QOpenGLContext *context = QOpenGLContext::currentContext();-
298 if (!context->isOpenGLES()
!context->isOpenGLES()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-3
299 glProgramParameteri = (type_glProgramParameteri)-
300 context->getProcAddress("glProgramParameteri");-
301-
302 if (!glProgramParameteri
!glProgramParameteriDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
303 glProgramParameteri = (type_glProgramParameteri)-
304 context->getProcAddress("glProgramParameteriEXT");-
305 }
never executed: end of block
0
306 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
307 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
308-
309 type_glProgramParameteri glProgramParameteri;-
310};-
311-
312class QGLShaderProgramPrivate : public QObjectPrivate-
313{-
314 inline QGLShaderProgram* q_func() { return static_cast<QGLShaderProgram *>(q_ptr); } inline const QGLShaderProgram* q_func() const { return static_cast<const QGLShaderProgram *>(q_ptr); } friend class QGLShaderProgram;-
315public:-
316 QGLShaderProgramPrivate(const QGLContext *)-
317 : programGuard(0)-
318 , linked(false)-
319 , inited(false)-
320 , removingShaders(false)-
321 , geometryVertexCount(64)-
322 , geometryInputType(0)-
323 , geometryOutputType(0)-
324 , glfuncs(new ShaderProgramOpenGLFunctions)-
325 {-
326 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
327 ~QGLShaderProgramPrivate();-
328-
329 QGLSharedResourceGuardBase *programGuard;-
330 bool linked;-
331 bool inited;-
332 bool removingShaders;-
333-
334 int geometryVertexCount;-
335 GLenum geometryInputType;-
336 GLenum geometryOutputType;-
337-
338 QString log;-
339 QList<QGLShader *> shaders;-
340 QList<QGLShader *> anonShaders;-
341-
342 ShaderProgramOpenGLFunctions *glfuncs;-
343-
344 bool hasShader(QGLShader::ShaderType type) const;-
345};-
346-
347namespace {-
348 void freeProgramFunc(QGLContext *ctx, GLuint id)-
349 {-
350 ((!(ctx)) ? qt_assert("ctx",__FILE__,620) : qt_noop());-
351 ctx->contextHandle()->functions()->glDeleteProgram(id);-
352 }
never executed: end of block
0
353}-
354-
355-
356QGLShaderProgramPrivate::~QGLShaderProgramPrivate()-
357{-
358 delete glfuncs;-
359 if (programGuard
programGuardDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
)
0-3
360 programGuard->free();
executed 3 times by 1 test: programGuard->free();
Executed by:
  • tst_qmdiarea - unknown status
3
361}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
362-
363bool QGLShaderProgramPrivate::hasShader(QGLShader::ShaderType type) const-
364{-
365 for (QGLShader *shader : shaders) {-
366 if (shader->shaderType() == type
shader->shaderType() == typeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
367 return
never executed: return true;
true;
never executed: return true;
0
368 }
never executed: end of block
0
369 return
never executed: return false;
false;
never executed: return false;
0
370}-
371QGLShaderProgram::QGLShaderProgram(QObject *parent)-
372 : QObject(*new QGLShaderProgramPrivate(QGLContext::currentContext()), parent)-
373{-
374}
executed 1 time by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
1
375QGLShaderProgram::QGLShaderProgram(const QGLContext *context, QObject *parent)-
376 : QObject(*new QGLShaderProgramPrivate(context), parent)-
377{-
378}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
2
379-
380-
381-
382-
383QGLShaderProgram::~QGLShaderProgram()-
384{-
385}-
386-
387bool QGLShaderProgram::init()-
388{-
389 QGLShaderProgramPrivate * const d = d_func();-
390 if ((d->programGuard
d->programGuardDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
&& d->programGuard->id()
d->programGuard->id()Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) || d->inited
d->initedDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-13
391 return
executed 13 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
true;
executed 13 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
13
392 d->inited = true;-
393 QGLContext *context = const_cast<QGLContext *>(QGLContext::currentContext());-
394 if (!context
!contextDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-3
395 return
never executed: return false;
false;
never executed: return false;
0
396 d->glfuncs->initializeOpenGLFunctions();-
397 d->glfuncs->initializeGeometryShaderFunctions();-
398 if (d->glfuncs->hasOpenGLFeature(QOpenGLFunctions::Shaders)
d->glfuncs->ha...ions::Shaders)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-3
399 GLuint program = d->glfuncs->glCreateProgram();-
400 if (!program
!programDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
401 QMessageLogger(__FILE__, 691, __PRETTY_FUNCTION__).warning("QGLShaderProgram: could not create shader program");-
402 return
never executed: return false;
false;
never executed: return false;
0
403 }-
404 if (d->programGuard
d->programGuardDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-3
405 delete d->programGuard;
never executed: delete d->programGuard;
0
406 d->programGuard = createSharedResourceGuard(context, program, freeProgramFunc);-
407 return
executed 3 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
3
408 } else {-
409 QMessageLogger(__FILE__, 699, __PRETTY_FUNCTION__).warning("QGLShaderProgram: shader programs are not supported");-
410 return
never executed: return false;
false;
never executed: return false;
0
411 }-
412}-
413bool QGLShaderProgram::addShader(QGLShader *shader)-
414{-
415 QGLShaderProgramPrivate * const d = d_func();-
416 if (!init()
!init()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-6
417 return
never executed: return false;
false;
never executed: return false;
0
418 if (d->shaders.contains(shader)
d->shaders.contains(shader)Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-6
419 return
never executed: return true;
true;
never executed: return true;
0
420 if (d->programGuard
d->programGuardDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& d->programGuard->id()
d->programGuard->id()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& shader
shaderDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-6
421 if (!shader->d_func()->shaderGuard
!shader->d_func()->shaderGuardDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
|| !shader->d_func()->shaderGuard->id()
!shader->d_fun...derGuard->id()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-6
422 return
never executed: return false;
false;
never executed: return false;
0
423 if (d->programGuard->group() != shader->d_func()->shaderGuard->group()
d->programGuar...Guard->group()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-6
424 QMessageLogger(__FILE__, 727, __PRETTY_FUNCTION__).warning("QGLShaderProgram::addShader: Program and shader are not associated with same context.");-
425 return
never executed: return false;
false;
never executed: return false;
0
426 }-
427 d->glfuncs->glAttachShader(d->programGuard->id(), shader->d_func()->shaderGuard->id());-
428 d->linked = false;-
429 d->shaders.append(shader);-
430 connect(shader, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "733"), this, qFlagLocation("1""shaderDestroyed()" "\0" __FILE__ ":" "733"));-
431 return
executed 6 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
6
432 } else {-
433 return
never executed: return false;
false;
never executed: return false;
0
434 }-
435}-
436bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const char *source)-
437{-
438 QGLShaderProgramPrivate * const d = d_func();-
439 if (!init()
!init()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
440 return
never executed: return false;
false;
never executed: return false;
0
441 QGLShader *shader = new QGLShader(type, this);-
442 if (!shader->compileSourceCode(source)
!shader->compi...ceCode(source)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
443 d->log = shader->log();-
444 delete shader;-
445 return
never executed: return false;
false;
never executed: return false;
0
446 }-
447 d->anonShaders.append(shader);-
448 return
never executed: return addShader(shader);
addShader(shader);
never executed: return addShader(shader);
0
449}-
450bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const QByteArray& source)-
451{-
452 return
never executed: return addShaderFromSourceCode(type, source.constData());
addShaderFromSourceCode(type, source.constData());
never executed: return addShaderFromSourceCode(type, source.constData());
0
453}-
454bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const QString& source)-
455{-
456 return
never executed: return addShaderFromSourceCode(type, source.toLatin1().constData());
addShaderFromSourceCode(type, source.toLatin1().constData());
never executed: return addShaderFromSourceCode(type, source.toLatin1().constData());
0
457}-
458bool QGLShaderProgram::addShaderFromSourceFile-
459 (QGLShader::ShaderType type, const QString& fileName)-
460{-
461 QGLShaderProgramPrivate * const d = d_func();-
462 if (!init()
!init()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
463 return
never executed: return false;
false;
never executed: return false;
0
464 QGLShader *shader = new QGLShader(type, this);-
465 if (!shader->compileSourceFile(fileName)
!shader->compi...File(fileName)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
466 d->log = shader->log();-
467 delete shader;-
468 return
never executed: return false;
false;
never executed: return false;
0
469 }-
470 d->anonShaders.append(shader);-
471 return
never executed: return addShader(shader);
addShader(shader);
never executed: return addShader(shader);
0
472}-
473void QGLShaderProgram::removeShader(QGLShader *shader)-
474{-
475 QGLShaderProgramPrivate * const d = d_func();-
476 if (d->programGuard
d->programGuardDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->programGuard->id()
d->programGuard->id()Description
TRUEnever evaluated
FALSEnever evaluated
0
477 && shader
shaderDescription
TRUEnever evaluated
FALSEnever evaluated
&& shader->d_func()->shaderGuard
shader->d_func()->shaderGuardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
478 {-
479 d->glfuncs->glDetachShader(d->programGuard->id(), shader->d_func()->shaderGuard->id());-
480 }
never executed: end of block
0
481 d->linked = false;-
482 if (shader
shaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
483 d->shaders.removeAll(shader);-
484 d->anonShaders.removeAll(shader);-
485 disconnect(shader, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "855"), this, qFlagLocation("1""shaderDestroyed()" "\0" __FILE__ ":" "855"));-
486 }
never executed: end of block
0
487}
never executed: end of block
0
488-
489-
490-
491-
492-
493-
494-
495QList<QGLShader *> QGLShaderProgram::shaders() const-
496{-
497 const QGLShaderProgramPrivate * const d = d_func();-
498 return
never executed: return d->shaders;
d->shaders;
never executed: return d->shaders;
0
499}-
500void QGLShaderProgram::removeAllShaders()-
501{-
502 QGLShaderProgramPrivate * const d = d_func();-
503 d->removingShaders = true;-
504 if (d->programGuard
d->programGuardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
505 if (const
const auto pro...ramGuard->id()Description
TRUEnever evaluated
FALSEnever evaluated
auto programGuardId = d->programGuard->id()
const auto pro...ramGuard->id()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
506 for (QGLShader *shader : qAsConst(d->shaders)) {-
507 if (shader
shaderDescription
TRUEnever evaluated
FALSEnever evaluated
&& shader->d_func()->shaderGuard
shader->d_func()->shaderGuardDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
508 d->glfuncs->glDetachShader(programGuardId, shader->d_func()->shaderGuard->id());
never executed: d->glfuncs->glDetachShader(programGuardId, shader->d_func()->shaderGuard->id());
0
509 }
never executed: end of block
0
510 }
never executed: end of block
0
511 }
never executed: end of block
0
512-
513 qDeleteAll(d->anonShaders);-
514 d->shaders.clear();-
515 d->anonShaders.clear();-
516 d->linked = false;-
517 d->removingShaders = false;-
518}
never executed: end of block
0
519bool QGLShaderProgram::link()-
520{-
521 QGLShaderProgramPrivate * const d = d_func();-
522 GLuint program = d->programGuard
d->programGuardDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
? d->programGuard->id() : 0;
0-3
523 if (!program
!programDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-3
524 return
never executed: return false;
false;
never executed: return false;
0
525-
526 GLint value;-
527 if (d->shaders.isEmpty()
d->shaders.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
528-
529-
530-
531-
532 value = 0;-
533 d->glfuncs->glGetProgramiv(program, 0x8B82, &value);-
534 d->linked = (value != 0);-
535 if (d->linked
d->linkedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
536 return
never executed: return true;
true;
never executed: return true;
0
537 }
never executed: end of block
0
538-
539-
540-
541 if (!QOpenGLContext::currentContext()->isOpenGLES()
!QOpenGLContex...->isOpenGLES()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
0-3
542 && d->glfuncs->glProgramParameteri
d->glfuncs->gl...gramParameteriDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-3
543 for (QGLShader *shader : qAsConst(d->shaders)) {-
544 if (shader->shaderType() & QGLShader::Geometry
shader->shader...ader::GeometryDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-6
545 d->glfuncs->glProgramParameteri(program, 0x8DDB,-
546 d->geometryInputType);-
547 d->glfuncs->glProgramParameteri(program, 0x8DDC,-
548 d->geometryOutputType);-
549 d->glfuncs->glProgramParameteri(program, 0x8DDA,-
550 d->geometryVertexCount);-
551 break;
never executed: break;
0
552 }-
553 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
6
554 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
555-
556-
557 d->glfuncs->glLinkProgram(program);-
558 value = 0;-
559 d->glfuncs->glGetProgramiv(program, 0x8B82, &value);-
560 d->linked = (value != 0);-
561 value = 0;-
562 d->glfuncs->glGetProgramiv(program, 0x8B84, &value);-
563 d->log = QString();-
564 if (value > 1
value > 1Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
565 char *logbuf = new char [value];-
566 GLint len;-
567 d->glfuncs->glGetProgramInfoLog(program, value, &len, logbuf);-
568 d->log = QString::fromLatin1(logbuf);-
569 QString name = objectName();-
570 if (!d->linked
!d->linkedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
571 if (name.isEmpty()
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
572 QMessageLogger(__FILE__, 966, __PRETTY_FUNCTION__).warning() << "QGLShader::link:" << d->log;
never executed: QMessageLogger(__FILE__, 966, __PRETTY_FUNCTION__).warning() << "QGLShader::link:" << d->log;
0
573 else-
574 QMessageLogger(__FILE__, 968, __PRETTY_FUNCTION__).warning() << "QGLShader::link[" << name << "]:" << d->log;
never executed: QMessageLogger(__FILE__, 968, __PRETTY_FUNCTION__).warning() << "QGLShader::link[" << name << "]:" << d->log;
0
575 }-
576 delete [] logbuf;-
577 }
never executed: end of block
0
578 return
executed 3 times by 1 test: return d->linked;
Executed by:
  • tst_qmdiarea - unknown status
d->linked;
executed 3 times by 1 test: return d->linked;
Executed by:
  • tst_qmdiarea - unknown status
3
579}-
580-
581-
582-
583-
584-
585-
586bool QGLShaderProgram::isLinked() const-
587{-
588 const QGLShaderProgramPrivate * const d = d_func();-
589 return
executed 3 times by 1 test: return d->linked;
Executed by:
  • tst_qmdiarea - unknown status
d->linked;
executed 3 times by 1 test: return d->linked;
Executed by:
  • tst_qmdiarea - unknown status
3
590}-
591-
592-
593-
594-
595-
596-
597-
598QString QGLShaderProgram::log() const-
599{-
600 const QGLShaderProgramPrivate * const d = d_func();-
601 return
never executed: return d->log;
d->log;
never executed: return d->log;
0
602}-
603bool QGLShaderProgram::bind()-
604{-
605 QGLShaderProgramPrivate * const d = d_func();-
606 GLuint program = d->programGuard
d->programGuardDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
? d->programGuard->id() : 0;
0-9
607 if (!program
!programDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-9
608 return
never executed: return false;
false;
never executed: return false;
0
609 if (!d->linked
!d->linkedDescription
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
&& !link()
!link()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-9
610 return
never executed: return false;
false;
never executed: return false;
0
611-
612 if (d->programGuard->group() != QOpenGLContextGroup::currentContextGroup()
d->programGuar...ContextGroup()Description
TRUEnever evaluated
FALSEevaluated 9 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-9
613 QMessageLogger(__FILE__, 1018, __PRETTY_FUNCTION__).warning("QGLShaderProgram::bind: program is not valid in the current context.");-
614 return
never executed: return false;
false;
never executed: return false;
0
615 }-
616-
617 d->glfuncs->glUseProgram(program);-
618 return
executed 9 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
true;
executed 9 times by 1 test: return true;
Executed by:
  • tst_qmdiarea - unknown status
9
619}-
620void QGLShaderProgram::release()-
621{-
622 QGLShaderProgramPrivate * const d = d_func();-
623-
624 if (d->programGuard
d->programGuardDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->programGuard->group() != QOpenGLContextGroup::currentContextGroup()
d->programGuar...ContextGroup()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
625 QMessageLogger(__FILE__, 1040, __PRETTY_FUNCTION__).warning("QGLShaderProgram::release: program is not valid in the current context.");
never executed: QMessageLogger(__FILE__, 1040, __PRETTY_FUNCTION__).warning("QGLShaderProgram::release: program is not valid in the current context.");
0
626-
627 d->glfuncs->glUseProgram(0);-
628}
never executed: end of block
0
629-
630-
631-
632-
633-
634-
635GLuint QGLShaderProgram::programId() const-
636{-
637 const QGLShaderProgramPrivate * const d = d_func();-
638 GLuint id = d->programGuard
d->programGuardDescription
TRUEnever evaluated
FALSEnever evaluated
? d->programGuard->id() : 0;
0
639 if (id
idDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
640 return
never executed: return id;
id;
never executed: return id;
0
641-
642-
643-
644-
645 if (!const_cast<QGLShaderProgram *>(this)->init()
!const_cast<QG...(this)->init()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
646 return
never executed: return 0;
0;
never executed: return 0;
0
647 return
never executed: return d->programGuard ? d->programGuard->id() : 0;
d->programGuard ? d->programGuard->id() : 0;
never executed: return d->programGuard ? d->programGuard->id() : 0;
0
648}-
649void QGLShaderProgram::bindAttributeLocation(const char *name, int location)-
650{-
651 QGLShaderProgramPrivate * const d = d_func();-
652 if (!init()
!init()Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
|| !d->programGuard
!d->programGuardDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
|| !d->programGuard->id()
!d->programGuard->id()Description
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-10
653 return;
never executed: return;
0
654 d->glfuncs->glBindAttribLocation(d->programGuard->id(), location, name);-
655 d->linked = false;-
656}
executed 10 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
10
657void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int location)-
658{-
659 bindAttributeLocation(name.constData(), location);-
660}
never executed: end of block
0
661void QGLShaderProgram::bindAttributeLocation(const QString& name, int location)-
662{-
663 bindAttributeLocation(name.toLatin1().constData(), location);-
664}
never executed: end of block
0
665int QGLShaderProgram::attributeLocation(const char *name) const-
666{-
667 const QGLShaderProgramPrivate * const d = d_func();-
668 if (d->linked
d->linkedDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->programGuard
d->programGuardDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->programGuard->id()
d->programGuard->id()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
669 return
never executed: return d->glfuncs->glGetAttribLocation(d->programGuard->id(), name);
d->glfuncs->glGetAttribLocation(d->programGuard->id(), name);
never executed: return d->glfuncs->glGetAttribLocation(d->programGuard->id(), name);
0
670 } else {-
671 QMessageLogger(__FILE__, 1134, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::attributeLocation(" << name-
672 << "): shader program is not linked";-
673 return
never executed: return -1;
-1;
never executed: return -1;
0
674 }-
675}-
676int QGLShaderProgram::attributeLocation(const QByteArray& name) const-
677{-
678 return
never executed: return attributeLocation(name.constData());
attributeLocation(name.constData());
never executed: return attributeLocation(name.constData());
0
679}-
680int QGLShaderProgram::attributeLocation(const QString& name) const-
681{-
682 return
never executed: return attributeLocation(name.toLatin1().constData());
attributeLocation(name.toLatin1().constData());
never executed: return attributeLocation(name.toLatin1().constData());
0
683}-
684-
685-
686-
687-
688-
689-
690void QGLShaderProgram::setAttributeValue(int location, GLfloat value)-
691{-
692 QGLShaderProgramPrivate * const d = d_func();-
693 (void)d;;-
694 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
695 d->glfuncs->glVertexAttrib1fv(location, &value);
never executed: d->glfuncs->glVertexAttrib1fv(location, &value);
0
696}
never executed: end of block
0
697void QGLShaderProgram::setAttributeValue(const char *name, GLfloat value)-
698{-
699 setAttributeValue(attributeLocation(name), value);-
700}
never executed: end of block
0
701-
702-
703-
704-
705-
706-
707-
708void QGLShaderProgram::setAttributeValue(int location, GLfloat x, GLfloat y)-
709{-
710 QGLShaderProgramPrivate * const d = d_func();-
711 (void)d;;-
712 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
713 GLfloat values[2] = {x, y};-
714 d->glfuncs->glVertexAttrib2fv(location, values);-
715 }
never executed: end of block
0
716}
never executed: end of block
0
717void QGLShaderProgram::setAttributeValue(const char *name, GLfloat x, GLfloat y)-
718{-
719 setAttributeValue(attributeLocation(name), x, y);-
720}
never executed: end of block
0
721-
722-
723-
724-
725-
726-
727-
728void QGLShaderProgram::setAttributeValue-
729 (int location, GLfloat x, GLfloat y, GLfloat z)-
730{-
731 QGLShaderProgramPrivate * const d = d_func();-
732 (void)d;;-
733 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
734 GLfloat values[3] = {x, y, z};-
735 d->glfuncs->glVertexAttrib3fv(location, values);-
736 }
never executed: end of block
0
737}
never executed: end of block
0
738void QGLShaderProgram::setAttributeValue-
739 (const char *name, GLfloat x, GLfloat y, GLfloat z)-
740{-
741 setAttributeValue(attributeLocation(name), x, y, z);-
742}
never executed: end of block
0
743-
744-
745-
746-
747-
748-
749-
750void QGLShaderProgram::setAttributeValue-
751 (int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)-
752{-
753 QGLShaderProgramPrivate * const d = d_func();-
754 (void)d;;-
755 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
756 GLfloat values[4] = {x, y, z, w};-
757 d->glfuncs->glVertexAttrib4fv(location, values);-
758 }
never executed: end of block
0
759}
never executed: end of block
0
760void QGLShaderProgram::setAttributeValue-
761 (const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)-
762{-
763 setAttributeValue(attributeLocation(name), x, y, z, w);-
764}
never executed: end of block
0
765-
766-
767-
768-
769-
770-
771void QGLShaderProgram::setAttributeValue(int location, const QVector2D& value)-
772{-
773 QGLShaderProgramPrivate * const d = d_func();-
774 (void)d;;-
775 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
776 d->glfuncs->glVertexAttrib2fv(location, reinterpret_cast<const GLfloat *>(&value));
never executed: d->glfuncs->glVertexAttrib2fv(location, reinterpret_cast<const GLfloat *>(&value));
0
777}
never executed: end of block
0
778void QGLShaderProgram::setAttributeValue(const char *name, const QVector2D& value)-
779{-
780 setAttributeValue(attributeLocation(name), value);-
781}
never executed: end of block
0
782-
783-
784-
785-
786-
787-
788void QGLShaderProgram::setAttributeValue(int location, const QVector3D& value)-
789{-
790 QGLShaderProgramPrivate * const d = d_func();-
791 (void)d;;-
792 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
793 d->glfuncs->glVertexAttrib3fv(location, reinterpret_cast<const GLfloat *>(&value));
never executed: d->glfuncs->glVertexAttrib3fv(location, reinterpret_cast<const GLfloat *>(&value));
0
794}
never executed: end of block
0
795void QGLShaderProgram::setAttributeValue(const char *name, const QVector3D& value)-
796{-
797 setAttributeValue(attributeLocation(name), value);-
798}
never executed: end of block
0
799-
800-
801-
802-
803-
804-
805void QGLShaderProgram::setAttributeValue(int location, const QVector4D& value)-
806{-
807 QGLShaderProgramPrivate * const d = d_func();-
808 (void)d;;-
809 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
810 d->glfuncs->glVertexAttrib4fv(location, reinterpret_cast<const GLfloat *>(&value));
never executed: d->glfuncs->glVertexAttrib4fv(location, reinterpret_cast<const GLfloat *>(&value));
0
811}
never executed: end of block
0
812void QGLShaderProgram::setAttributeValue(const char *name, const QVector4D& value)-
813{-
814 setAttributeValue(attributeLocation(name), value);-
815}
never executed: end of block
0
816-
817-
818-
819-
820-
821-
822void QGLShaderProgram::setAttributeValue(int location, const QColor& value)-
823{-
824 QGLShaderProgramPrivate * const d = d_func();-
825 (void)d;;-
826 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
827 GLfloat values[4] = {GLfloat(value.redF()), GLfloat(value.greenF()),-
828 GLfloat(value.blueF()), GLfloat(value.alphaF())};-
829 d->glfuncs->glVertexAttrib4fv(location, values);-
830 }
never executed: end of block
0
831}
never executed: end of block
0
832void QGLShaderProgram::setAttributeValue(const char *name, const QColor& value)-
833{-
834 setAttributeValue(attributeLocation(name), value);-
835}
never executed: end of block
0
836void QGLShaderProgram::setAttributeValue-
837 (int location, const GLfloat *values, int columns, int rows)-
838{-
839 QGLShaderProgramPrivate * const d = d_func();-
840 (void)d;;-
841 if (rows < 1
rows < 1Description
TRUEnever evaluated
FALSEnever evaluated
|| rows > 4
rows > 4Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
842 QMessageLogger(__FILE__, 1402, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::setAttributeValue: rows" << rows << "not supported";-
843 return;
never executed: return;
0
844 }-
845 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
846 while (columns-- > 0
columns-- > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
847 if (rows == 1
rows == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
848 d->glfuncs->glVertexAttrib1fv(location, values);
never executed: d->glfuncs->glVertexAttrib1fv(location, values);
0
849 else if (rows == 2
rows == 2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
850 d->glfuncs->glVertexAttrib2fv(location, values);
never executed: d->glfuncs->glVertexAttrib2fv(location, values);
0
851 else if (rows == 3
rows == 3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
852 d->glfuncs->glVertexAttrib3fv(location, values);
never executed: d->glfuncs->glVertexAttrib3fv(location, values);
0
853 else-
854 d->glfuncs->glVertexAttrib4fv(location, values);
never executed: d->glfuncs->glVertexAttrib4fv(location, values);
0
855 values += rows;-
856 ++location;-
857 }
never executed: end of block
0
858 }
never executed: end of block
0
859}
never executed: end of block
0
860void QGLShaderProgram::setAttributeValue-
861 (const char *name, const GLfloat *values, int columns, int rows)-
862{-
863 setAttributeValue(attributeLocation(name), values, columns, rows);-
864}
never executed: end of block
0
865void QGLShaderProgram::setAttributeArray-
866 (int location, const GLfloat *values, int tupleSize, int stride)-
867{-
868 QGLShaderProgramPrivate * const d = d_func();-
869 (void)d;;-
870 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
871 d->glfuncs->glVertexAttribPointer(location, tupleSize, 0x1406, 0,-
872 stride, values);-
873 }
never executed: end of block
0
874}
never executed: end of block
0
875void QGLShaderProgram::setAttributeArray-
876 (int location, const QVector2D *values, int stride)-
877{-
878 QGLShaderProgramPrivate * const d = d_func();-
879 (void)d;;-
880 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
881 d->glfuncs->glVertexAttribPointer(location, 2, 0x1406, 0,-
882 stride, values);-
883 }
never executed: end of block
0
884}
never executed: end of block
0
885void QGLShaderProgram::setAttributeArray-
886 (int location, const QVector3D *values, int stride)-
887{-
888 QGLShaderProgramPrivate * const d = d_func();-
889 (void)d;;-
890 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
891 d->glfuncs->glVertexAttribPointer(location, 3, 0x1406, 0,-
892 stride, values);-
893 }
never executed: end of block
0
894}
never executed: end of block
0
895void QGLShaderProgram::setAttributeArray-
896 (int location, const QVector4D *values, int stride)-
897{-
898 QGLShaderProgramPrivate * const d = d_func();-
899 (void)d;;-
900 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
901 d->glfuncs->glVertexAttribPointer(location, 4, 0x1406, 0,-
902 stride, values);-
903 }
never executed: end of block
0
904}
never executed: end of block
0
905void QGLShaderProgram::setAttributeArray-
906 (int location, GLenum type, const void *values, int tupleSize, int stride)-
907{-
908 QGLShaderProgramPrivate * const d = d_func();-
909 (void)d;;-
910 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
911 d->glfuncs->glVertexAttribPointer(location, tupleSize, type, 1,-
912 stride, values);-
913 }
never executed: end of block
0
914}
never executed: end of block
0
915void QGLShaderProgram::setAttributeArray-
916 (const char *name, const GLfloat *values, int tupleSize, int stride)-
917{-
918 setAttributeArray(attributeLocation(name), values, tupleSize, stride);-
919}
never executed: end of block
0
920void QGLShaderProgram::setAttributeArray-
921 (const char *name, const QVector2D *values, int stride)-
922{-
923 setAttributeArray(attributeLocation(name), values, stride);-
924}
never executed: end of block
0
925void QGLShaderProgram::setAttributeArray-
926 (const char *name, const QVector3D *values, int stride)-
927{-
928 setAttributeArray(attributeLocation(name), values, stride);-
929}
never executed: end of block
0
930void QGLShaderProgram::setAttributeArray-
931 (const char *name, const QVector4D *values, int stride)-
932{-
933 setAttributeArray(attributeLocation(name), values, stride);-
934}
never executed: end of block
0
935void QGLShaderProgram::setAttributeArray-
936 (const char *name, GLenum type, const void *values, int tupleSize, int stride)-
937{-
938 setAttributeArray(attributeLocation(name), type, values, tupleSize, stride);-
939}
never executed: end of block
0
940void QGLShaderProgram::setAttributeBuffer-
941 (int location, GLenum type, int offset, int tupleSize, int stride)-
942{-
943 QGLShaderProgramPrivate * const d = d_func();-
944 (void)d;;-
945 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
946 d->glfuncs->glVertexAttribPointer(location, tupleSize, type, 1, stride,-
947 reinterpret_cast<const void *>(qintptr(offset)));-
948 }
never executed: end of block
0
949}
never executed: end of block
0
950void QGLShaderProgram::setAttributeBuffer-
951 (const char *name, GLenum type, int offset, int tupleSize, int stride)-
952{-
953 setAttributeBuffer(attributeLocation(name), type, offset, tupleSize, stride);-
954}
never executed: end of block
0
955void QGLShaderProgram::enableAttributeArray(int location)-
956{-
957 QGLShaderProgramPrivate * const d = d_func();-
958 (void)d;;-
959 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
960 d->glfuncs->glEnableVertexAttribArray(location);
never executed: d->glfuncs->glEnableVertexAttribArray(location);
0
961}
never executed: end of block
0
962void QGLShaderProgram::enableAttributeArray(const char *name)-
963{-
964 enableAttributeArray(attributeLocation(name));-
965}
never executed: end of block
0
966void QGLShaderProgram::disableAttributeArray(int location)-
967{-
968 QGLShaderProgramPrivate * const d = d_func();-
969 (void)d;;-
970 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
971 d->glfuncs->glDisableVertexAttribArray(location);
never executed: d->glfuncs->glDisableVertexAttribArray(location);
0
972}
never executed: end of block
0
973void QGLShaderProgram::disableAttributeArray(const char *name)-
974{-
975 disableAttributeArray(attributeLocation(name));-
976}
never executed: end of block
0
977int QGLShaderProgram::uniformLocation(const char *name) const-
978{-
979 const QGLShaderProgramPrivate * const d = d_func();-
980 (void)d;;-
981 if (d->linked
d->linkedDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& d->programGuard
d->programGuardDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& d->programGuard->id()
d->programGuard->id()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-1
982 return
executed 1 time by 1 test: return d->glfuncs->glGetUniformLocation(d->programGuard->id(), name);
Executed by:
  • tst_qmdiarea - unknown status
d->glfuncs->glGetUniformLocation(d->programGuard->id(), name);
executed 1 time by 1 test: return d->glfuncs->glGetUniformLocation(d->programGuard->id(), name);
Executed by:
  • tst_qmdiarea - unknown status
1
983 } else {-
984 QMessageLogger(__FILE__, 1818, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::uniformLocation(" << name-
985 << "): shader program is not linked";-
986 return
never executed: return -1;
-1;
never executed: return -1;
0
987 }-
988}-
989int QGLShaderProgram::uniformLocation(const QByteArray& name) const-
990{-
991 return
never executed: return uniformLocation(name.constData());
uniformLocation(name.constData());
never executed: return uniformLocation(name.constData());
0
992}-
993int QGLShaderProgram::uniformLocation(const QString& name) const-
994{-
995 return
never executed: return uniformLocation(name.toLatin1().constData());
uniformLocation(name.toLatin1().constData());
never executed: return uniformLocation(name.toLatin1().constData());
0
996}-
997-
998-
999-
1000-
1001-
1002-
1003void QGLShaderProgram::setUniformValue(int location, GLfloat value)-
1004{-
1005 QGLShaderProgramPrivate * const d = d_func();-
1006 (void)d;;-
1007 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1008 d->glfuncs->glUniform1fv(location, 1, &value);
never executed: d->glfuncs->glUniform1fv(location, 1, &value);
0
1009}
never executed: end of block
0
1010void QGLShaderProgram::setUniformValue(const char *name, GLfloat value)-
1011{-
1012 setUniformValue(uniformLocation(name), value);-
1013}
never executed: end of block
0
1014-
1015-
1016-
1017-
1018-
1019-
1020void QGLShaderProgram::setUniformValue(int location, GLint value)-
1021{-
1022 QGLShaderProgramPrivate * const d = d_func();-
1023 (void)d;;-
1024 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1025 d->glfuncs->glUniform1i(location, value);
never executed: d->glfuncs->glUniform1i(location, value);
0
1026}
never executed: end of block
0
1027void QGLShaderProgram::setUniformValue(const char *name, GLint value)-
1028{-
1029 setUniformValue(uniformLocation(name), value);-
1030}
never executed: end of block
0
1031-
1032-
1033-
1034-
1035-
1036-
1037-
1038void QGLShaderProgram::setUniformValue(int location, GLuint value)-
1039{-
1040 QGLShaderProgramPrivate * const d = d_func();-
1041 (void)d;;-
1042 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1043 d->glfuncs->glUniform1i(location, value);
never executed: d->glfuncs->glUniform1i(location, value);
0
1044}
never executed: end of block
0
1045void QGLShaderProgram::setUniformValue(const char *name, GLuint value)-
1046{-
1047 setUniformValue(uniformLocation(name), value);-
1048}
never executed: end of block
0
1049-
1050-
1051-
1052-
1053-
1054-
1055-
1056void QGLShaderProgram::setUniformValue(int location, GLfloat x, GLfloat y)-
1057{-
1058 QGLShaderProgramPrivate * const d = d_func();-
1059 (void)d;;-
1060 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1061 GLfloat values[2] = {x, y};-
1062 d->glfuncs->glUniform2fv(location, 1, values);-
1063 }
never executed: end of block
0
1064}
never executed: end of block
0
1065void QGLShaderProgram::setUniformValue(const char *name, GLfloat x, GLfloat y)-
1066{-
1067 setUniformValue(uniformLocation(name), x, y);-
1068}
never executed: end of block
0
1069-
1070-
1071-
1072-
1073-
1074-
1075-
1076void QGLShaderProgram::setUniformValue-
1077 (int location, GLfloat x, GLfloat y, GLfloat z)-
1078{-
1079 QGLShaderProgramPrivate * const d = d_func();-
1080 (void)d;;-
1081 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1082 GLfloat values[3] = {x, y, z};-
1083 d->glfuncs->glUniform3fv(location, 1, values);-
1084 }
never executed: end of block
0
1085}
never executed: end of block
0
1086void QGLShaderProgram::setUniformValue-
1087 (const char *name, GLfloat x, GLfloat y, GLfloat z)-
1088{-
1089 setUniformValue(uniformLocation(name), x, y, z);-
1090}
never executed: end of block
0
1091-
1092-
1093-
1094-
1095-
1096-
1097-
1098void QGLShaderProgram::setUniformValue-
1099 (int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)-
1100{-
1101 QGLShaderProgramPrivate * const d = d_func();-
1102 (void)d;;-
1103 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1104 GLfloat values[4] = {x, y, z, w};-
1105 d->glfuncs->glUniform4fv(location, 1, values);-
1106 }
never executed: end of block
0
1107}
never executed: end of block
0
1108void QGLShaderProgram::setUniformValue-
1109 (const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w)-
1110{-
1111 setUniformValue(uniformLocation(name), x, y, z, w);-
1112}
never executed: end of block
0
1113-
1114-
1115-
1116-
1117-
1118-
1119void QGLShaderProgram::setUniformValue(int location, const QVector2D& value)-
1120{-
1121 QGLShaderProgramPrivate * const d = d_func();-
1122 (void)d;;-
1123 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1124 d->glfuncs->glUniform2fv(location, 1, reinterpret_cast<const GLfloat *>(&value));
never executed: d->glfuncs->glUniform2fv(location, 1, reinterpret_cast<const GLfloat *>(&value));
0
1125}
never executed: end of block
0
1126void QGLShaderProgram::setUniformValue(const char *name, const QVector2D& value)-
1127{-
1128 setUniformValue(uniformLocation(name), value);-
1129}
never executed: end of block
0
1130-
1131-
1132-
1133-
1134-
1135-
1136void QGLShaderProgram::setUniformValue(int location, const QVector3D& value)-
1137{-
1138 QGLShaderProgramPrivate * const d = d_func();-
1139 (void)d;;-
1140 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1141 d->glfuncs->glUniform3fv(location, 1, reinterpret_cast<const GLfloat *>(&value));
never executed: d->glfuncs->glUniform3fv(location, 1, reinterpret_cast<const GLfloat *>(&value));
0
1142}
never executed: end of block
0
1143void QGLShaderProgram::setUniformValue(const char *name, const QVector3D& value)-
1144{-
1145 setUniformValue(uniformLocation(name), value);-
1146}
never executed: end of block
0
1147-
1148-
1149-
1150-
1151-
1152-
1153void QGLShaderProgram::setUniformValue(int location, const QVector4D& value)-
1154{-
1155 QGLShaderProgramPrivate * const d = d_func();-
1156 (void)d;;-
1157 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1158 d->glfuncs->glUniform4fv(location, 1, reinterpret_cast<const GLfloat *>(&value));
never executed: d->glfuncs->glUniform4fv(location, 1, reinterpret_cast<const GLfloat *>(&value));
0
1159}
never executed: end of block
0
1160void QGLShaderProgram::setUniformValue(const char *name, const QVector4D& value)-
1161{-
1162 setUniformValue(uniformLocation(name), value);-
1163}
never executed: end of block
0
1164-
1165-
1166-
1167-
1168-
1169-
1170-
1171void QGLShaderProgram::setUniformValue(int location, const QColor& color)-
1172{-
1173 QGLShaderProgramPrivate * const d = d_func();-
1174 (void)d;;-
1175 if (location != -1
location != -1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-3
1176 GLfloat values[4] = {GLfloat(color.redF()), GLfloat(color.greenF()),-
1177 GLfloat(color.blueF()), GLfloat(color.alphaF())};-
1178 d->glfuncs->glUniform4fv(location, 1, values);-
1179 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
1180}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
1181void QGLShaderProgram::setUniformValue(const char *name, const QColor& color)-
1182{-
1183 setUniformValue(uniformLocation(name), color);-
1184}
never executed: end of block
0
1185-
1186-
1187-
1188-
1189-
1190-
1191-
1192void QGLShaderProgram::setUniformValue(int location, const QPoint& point)-
1193{-
1194 QGLShaderProgramPrivate * const d = d_func();-
1195 (void)d;;-
1196 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1197 GLfloat values[4] = {GLfloat(point.x()), GLfloat(point.y())};-
1198 d->glfuncs->glUniform2fv(location, 1, values);-
1199 }
never executed: end of block
0
1200}
never executed: end of block
0
1201void QGLShaderProgram::setUniformValue(const char *name, const QPoint& point)-
1202{-
1203 setUniformValue(uniformLocation(name), point);-
1204}
never executed: end of block
0
1205-
1206-
1207-
1208-
1209-
1210-
1211-
1212void QGLShaderProgram::setUniformValue(int location, const QPointF& point)-
1213{-
1214 QGLShaderProgramPrivate * const d = d_func();-
1215 (void)d;;-
1216 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1217 GLfloat values[4] = {GLfloat(point.x()), GLfloat(point.y())};-
1218 d->glfuncs->glUniform2fv(location, 1, values);-
1219 }
never executed: end of block
0
1220}
never executed: end of block
0
1221void QGLShaderProgram::setUniformValue(const char *name, const QPointF& point)-
1222{-
1223 setUniformValue(uniformLocation(name), point);-
1224}
never executed: end of block
0
1225-
1226-
1227-
1228-
1229-
1230-
1231-
1232void QGLShaderProgram::setUniformValue(int location, const QSize& size)-
1233{-
1234 QGLShaderProgramPrivate * const d = d_func();-
1235 (void)d;;-
1236 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1237 GLfloat values[4] = {GLfloat(size.width()), GLfloat(size.height())};-
1238 d->glfuncs->glUniform2fv(location, 1, values);-
1239 }
never executed: end of block
0
1240}
never executed: end of block
0
1241void QGLShaderProgram::setUniformValue(const char *name, const QSize& size)-
1242{-
1243 setUniformValue(uniformLocation(name), size);-
1244}
never executed: end of block
0
1245-
1246-
1247-
1248-
1249-
1250-
1251-
1252void QGLShaderProgram::setUniformValue(int location, const QSizeF& size)-
1253{-
1254 QGLShaderProgramPrivate * const d = d_func();-
1255 (void)d;;-
1256 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1257 GLfloat values[4] = {GLfloat(size.width()), GLfloat(size.height())};-
1258 d->glfuncs->glUniform2fv(location, 1, values);-
1259 }
never executed: end of block
0
1260}
never executed: end of block
0
1261void QGLShaderProgram::setUniformValue(const char *name, const QSizeF& size)-
1262{-
1263 setUniformValue(uniformLocation(name), size);-
1264}
never executed: end of block
0
1265-
1266-
1267-
1268-
1269-
1270-
1271-
1272void QGLShaderProgram::setUniformValue(int location, const QMatrix2x2& value)-
1273{-
1274 QGLShaderProgramPrivate * const d = d_func();-
1275 d->glfuncs->glUniformMatrix2fv(location, 1, 0, value.constData());-
1276}
never executed: end of block
0
1277void QGLShaderProgram::setUniformValue(const char *name, const QMatrix2x2& value)-
1278{-
1279 setUniformValue(uniformLocation(name), value);-
1280}
never executed: end of block
0
1281-
1282-
1283-
1284-
1285-
1286-
1287-
1288void QGLShaderProgram::setUniformValue(int location, const QMatrix2x3& value)-
1289{-
1290 QGLShaderProgramPrivate * const d = d_func();-
1291 d->glfuncs->glUniform3fv(location, 2, value.constData());-
1292}
never executed: end of block
0
1293void QGLShaderProgram::setUniformValue(const char *name, const QMatrix2x3& value)-
1294{-
1295 setUniformValue(uniformLocation(name), value);-
1296}
never executed: end of block
0
1297-
1298-
1299-
1300-
1301-
1302-
1303-
1304void QGLShaderProgram::setUniformValue(int location, const QMatrix2x4& value)-
1305{-
1306 QGLShaderProgramPrivate * const d = d_func();-
1307 d->glfuncs->glUniform4fv(location, 2, value.constData());-
1308}
never executed: end of block
0
1309void QGLShaderProgram::setUniformValue(const char *name, const QMatrix2x4& value)-
1310{-
1311 setUniformValue(uniformLocation(name), value);-
1312}
never executed: end of block
0
1313-
1314-
1315-
1316-
1317-
1318-
1319-
1320void QGLShaderProgram::setUniformValue(int location, const QMatrix3x2& value)-
1321{-
1322 QGLShaderProgramPrivate * const d = d_func();-
1323 d->glfuncs->glUniform2fv(location, 3, value.constData());-
1324}
never executed: end of block
0
1325void QGLShaderProgram::setUniformValue(const char *name, const QMatrix3x2& value)-
1326{-
1327 setUniformValue(uniformLocation(name), value);-
1328}
never executed: end of block
0
1329-
1330-
1331-
1332-
1333-
1334-
1335-
1336void QGLShaderProgram::setUniformValue(int location, const QMatrix3x3& value)-
1337{-
1338 QGLShaderProgramPrivate * const d = d_func();-
1339 d->glfuncs->glUniformMatrix3fv(location, 1, 0, value.constData());-
1340}
never executed: end of block
0
1341void QGLShaderProgram::setUniformValue(const char *name, const QMatrix3x3& value)-
1342{-
1343 setUniformValue(uniformLocation(name), value);-
1344}
never executed: end of block
0
1345-
1346-
1347-
1348-
1349-
1350-
1351-
1352void QGLShaderProgram::setUniformValue(int location, const QMatrix3x4& value)-
1353{-
1354 QGLShaderProgramPrivate * const d = d_func();-
1355 d->glfuncs->glUniform4fv(location, 3, value.constData());-
1356}
never executed: end of block
0
1357void QGLShaderProgram::setUniformValue(const char *name, const QMatrix3x4& value)-
1358{-
1359 setUniformValue(uniformLocation(name), value);-
1360}
never executed: end of block
0
1361-
1362-
1363-
1364-
1365-
1366-
1367-
1368void QGLShaderProgram::setUniformValue(int location, const QMatrix4x2& value)-
1369{-
1370 QGLShaderProgramPrivate * const d = d_func();-
1371 d->glfuncs->glUniform2fv(location, 4, value.constData());-
1372}
never executed: end of block
0
1373void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x2& value)-
1374{-
1375 setUniformValue(uniformLocation(name), value);-
1376}
never executed: end of block
0
1377-
1378-
1379-
1380-
1381-
1382-
1383-
1384void QGLShaderProgram::setUniformValue(int location, const QMatrix4x3& value)-
1385{-
1386 QGLShaderProgramPrivate * const d = d_func();-
1387 d->glfuncs->glUniform3fv(location, 4, value.constData());-
1388}
never executed: end of block
0
1389void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x3& value)-
1390{-
1391 setUniformValue(uniformLocation(name), value);-
1392}
never executed: end of block
0
1393-
1394-
1395-
1396-
1397-
1398-
1399-
1400void QGLShaderProgram::setUniformValue(int location, const QMatrix4x4& value)-
1401{-
1402 QGLShaderProgramPrivate * const d = d_func();-
1403 d->glfuncs->glUniformMatrix4fv(location, 1, 0, value.constData());-
1404}
never executed: end of block
0
1405void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x4& value)-
1406{-
1407 setUniformValue(uniformLocation(name), value);-
1408}
never executed: end of block
0
1409void QGLShaderProgram::setUniformValue(int location, const GLfloat value[2][2])-
1410{-
1411 QGLShaderProgramPrivate * const d = d_func();-
1412 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1413 d->glfuncs->glUniformMatrix2fv(location, 1, 0, value[0]);
never executed: d->glfuncs->glUniformMatrix2fv(location, 1, 0, value[0]);
0
1414}
never executed: end of block
0
1415void QGLShaderProgram::setUniformValue(int location, const GLfloat value[3][3])-
1416{-
1417 QGLShaderProgramPrivate * const d = d_func();-
1418 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1419 d->glfuncs->glUniformMatrix3fv(location, 1, 0, value[0]);
never executed: d->glfuncs->glUniformMatrix3fv(location, 1, 0, value[0]);
0
1420}
never executed: end of block
0
1421void QGLShaderProgram::setUniformValue(int location, const GLfloat value[4][4])-
1422{-
1423 QGLShaderProgramPrivate * const d = d_func();-
1424 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1425 d->glfuncs->glUniformMatrix4fv(location, 1, 0, value[0]);
never executed: d->glfuncs->glUniformMatrix4fv(location, 1, 0, value[0]);
0
1426}
never executed: end of block
0
1427void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[2][2])-
1428{-
1429 setUniformValue(uniformLocation(name), value);-
1430}
never executed: end of block
0
1431void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[3][3])-
1432{-
1433 setUniformValue(uniformLocation(name), value);-
1434}
never executed: end of block
0
1435void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[4][4])-
1436{-
1437 setUniformValue(uniformLocation(name), value);-
1438}
never executed: end of block
0
1439void QGLShaderProgram::setUniformValue(int location, const QTransform& value)-
1440{-
1441 QGLShaderProgramPrivate * const d = d_func();-
1442 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1443 GLfloat mat[3][3] = {-
1444 {GLfloat(value.m11()), GLfloat(value.m12()), GLfloat(value.m13())},-
1445 {GLfloat(value.m21()), GLfloat(value.m22()), GLfloat(value.m23())},-
1446 {GLfloat(value.m31()), GLfloat(value.m32()), GLfloat(value.m33())}-
1447 };-
1448 d->glfuncs->glUniformMatrix3fv(location, 1, 0, mat[0]);-
1449 }
never executed: end of block
0
1450}
never executed: end of block
0
1451void QGLShaderProgram::setUniformValue-
1452 (const char *name, const QTransform& value)-
1453{-
1454 setUniformValue(uniformLocation(name), value);-
1455}
never executed: end of block
0
1456-
1457-
1458-
1459-
1460-
1461-
1462-
1463void QGLShaderProgram::setUniformValueArray(int location, const GLint *values, int count)-
1464{-
1465 QGLShaderProgramPrivate * const d = d_func();-
1466 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1467 d->glfuncs->glUniform1iv(location, count, values);
never executed: d->glfuncs->glUniform1iv(location, count, values);
0
1468}
never executed: end of block
0
1469void QGLShaderProgram::setUniformValueArray-
1470 (const char *name, const GLint *values, int count)-
1471{-
1472 setUniformValueArray(uniformLocation(name), values, count);-
1473}
never executed: end of block
0
1474void QGLShaderProgram::setUniformValueArray(int location, const GLuint *values, int count)-
1475{-
1476 QGLShaderProgramPrivate * const d = d_func();-
1477 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1478 d->glfuncs->glUniform1iv(location, count, reinterpret_cast<const GLint *>(values));
never executed: d->glfuncs->glUniform1iv(location, count, reinterpret_cast<const GLint *>(values));
0
1479}
never executed: end of block
0
1480void QGLShaderProgram::setUniformValueArray-
1481 (const char *name, const GLuint *values, int count)-
1482{-
1483 setUniformValueArray(uniformLocation(name), values, count);-
1484}
never executed: end of block
0
1485void QGLShaderProgram::setUniformValueArray(int location, const GLfloat *values, int count, int tupleSize)-
1486{-
1487 QGLShaderProgramPrivate * const d = d_func();-
1488 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1489 if (tupleSize == 1
tupleSize == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1490 d->glfuncs->glUniform1fv(location, count, values);
never executed: d->glfuncs->glUniform1fv(location, count, values);
0
1491 else if (tupleSize == 2
tupleSize == 2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1492 d->glfuncs->glUniform2fv(location, count, values);
never executed: d->glfuncs->glUniform2fv(location, count, values);
0
1493 else if (tupleSize == 3
tupleSize == 3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1494 d->glfuncs->glUniform3fv(location, count, values);
never executed: d->glfuncs->glUniform3fv(location, count, values);
0
1495 else if (tupleSize == 4
tupleSize == 4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1496 d->glfuncs->glUniform4fv(location, count, values);
never executed: d->glfuncs->glUniform4fv(location, count, values);
0
1497 else-
1498 QMessageLogger(__FILE__, 2677, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::setUniformValue: size" << tupleSize << "not supported";
never executed: QMessageLogger(__FILE__, 2677, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::setUniformValue: size" << tupleSize << "not supported";
0
1499 }-
1500}
never executed: end of block
0
1501void QGLShaderProgram::setUniformValueArray-
1502 (const char *name, const GLfloat *values, int count, int tupleSize)-
1503{-
1504 setUniformValueArray(uniformLocation(name), values, count, tupleSize);-
1505}
never executed: end of block
0
1506-
1507-
1508-
1509-
1510-
1511-
1512-
1513void QGLShaderProgram::setUniformValueArray(int location, const QVector2D *values, int count)-
1514{-
1515 QGLShaderProgramPrivate * const d = d_func();-
1516 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1517 d->glfuncs->glUniform2fv(location, count, reinterpret_cast<const GLfloat *>(values));
never executed: d->glfuncs->glUniform2fv(location, count, reinterpret_cast<const GLfloat *>(values));
0
1518}
never executed: end of block
0
1519void QGLShaderProgram::setUniformValueArray(const char *name, const QVector2D *values, int count)-
1520{-
1521 setUniformValueArray(uniformLocation(name), values, count);-
1522}
never executed: end of block
0
1523-
1524-
1525-
1526-
1527-
1528-
1529-
1530void QGLShaderProgram::setUniformValueArray(int location, const QVector3D *values, int count)-
1531{-
1532 QGLShaderProgramPrivate * const d = d_func();-
1533 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1534 d->glfuncs->glUniform3fv(location, count, reinterpret_cast<const GLfloat *>(values));
never executed: d->glfuncs->glUniform3fv(location, count, reinterpret_cast<const GLfloat *>(values));
0
1535}
never executed: end of block
0
1536void QGLShaderProgram::setUniformValueArray(const char *name, const QVector3D *values, int count)-
1537{-
1538 setUniformValueArray(uniformLocation(name), values, count);-
1539}
never executed: end of block
0
1540-
1541-
1542-
1543-
1544-
1545-
1546-
1547void QGLShaderProgram::setUniformValueArray(int location, const QVector4D *values, int count)-
1548{-
1549 QGLShaderProgramPrivate * const d = d_func();-
1550 (void)d;;-
1551 if (location != -1
location != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1552 d->glfuncs->glUniform4fv(location, count, reinterpret_cast<const GLfloat *>(values));
never executed: d->glfuncs->glUniform4fv(location, count, reinterpret_cast<const GLfloat *>(values));
0
1553}
never executed: end of block
0
1554void QGLShaderProgram::setUniformValueArray(const char *name, const QVector4D *values, int count)-
1555{-
1556 setUniformValueArray(uniformLocation(name), values, count);-
1557}
never executed: end of block
0
1558void QGLShaderProgram::setUniformValueArray(int location, const QMatrix2x2 *values, int count)-
1559{-
1560 QGLShaderProgramPrivate * const d = d_func();-
1561 (void)d;;-
1562 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix2x2) == sizeof(GLfloat) * 2 * 2
sizeof(QMatrix...float) * 2 * 2Description
TRUEnever evaluated
FALSEnever evaluated
) { d->glfuncs->glUniformMatrix2fv(location, count, 0, reinterpret_cast<const GLfloat *>(values[0].constData())); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(2 * 2 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (2 * 2)
index2 < (2 * 2)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[2 * 2 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniformMatrix2fv(location, count, 0, temp.constData()); }
never executed: end of block
0
1563 ;-
1564}-
1565void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix2x2 *values, int count)-
1566{-
1567 setUniformValueArray(uniformLocation(name), values, count);-
1568}
never executed: end of block
0
1569-
1570-
1571-
1572-
1573-
1574-
1575-
1576void QGLShaderProgram::setUniformValueArray(int location, const QMatrix2x3 *values, int count)-
1577{-
1578 QGLShaderProgramPrivate * const d = d_func();-
1579 (void)d;;-
1580 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix2x3) == sizeof(GLfloat) * 2 * 3
sizeof(QMatrix...float) * 2 * 3Description
TRUEnever evaluated
FALSEnever evaluated
) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); d->glfuncs->glUniform3fv(location, count * 2, data); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(2 * 3 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (2 * 3)
index2 < (2 * 3)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[2 * 3 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniform3fv(location, count * 2, temp.constData()); }
never executed: end of block
0
1581-
1582 ;-
1583}-
1584void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix2x3 *values, int count)-
1585{-
1586 setUniformValueArray(uniformLocation(name), values, count);-
1587}
never executed: end of block
0
1588-
1589-
1590-
1591-
1592-
1593-
1594-
1595void QGLShaderProgram::setUniformValueArray(int location, const QMatrix2x4 *values, int count)-
1596{-
1597 QGLShaderProgramPrivate * const d = d_func();-
1598 (void)d;;-
1599 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix2x4) == sizeof(GLfloat) * 2 * 4
sizeof(QMatrix...float) * 2 * 4Description
TRUEnever evaluated
FALSEnever evaluated
) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); d->glfuncs->glUniform4fv(location, count * 2, data); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(2 * 4 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (2 * 4)
index2 < (2 * 4)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[2 * 4 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniform4fv(location, count * 2, temp.constData()); }
never executed: end of block
0
1600-
1601 ;-
1602}-
1603void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix2x4 *values, int count)-
1604{-
1605 setUniformValueArray(uniformLocation(name), values, count);-
1606}
never executed: end of block
0
1607-
1608-
1609-
1610-
1611-
1612-
1613-
1614void QGLShaderProgram::setUniformValueArray(int location, const QMatrix3x2 *values, int count)-
1615{-
1616 QGLShaderProgramPrivate * const d = d_func();-
1617 (void)d;;-
1618 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix3x2) == sizeof(GLfloat) * 3 * 2
sizeof(QMatrix...float) * 3 * 2Description
TRUEnever evaluated
FALSEnever evaluated
) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); d->glfuncs->glUniform2fv(location, count * 3, data); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(3 * 2 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (3 * 2)
index2 < (3 * 2)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[3 * 2 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniform2fv(location, count * 3, temp.constData()); }
never executed: end of block
0
1619-
1620 ;-
1621}-
1622void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix3x2 *values, int count)-
1623{-
1624 setUniformValueArray(uniformLocation(name), values, count);-
1625}
never executed: end of block
0
1626-
1627-
1628-
1629-
1630-
1631-
1632-
1633void QGLShaderProgram::setUniformValueArray(int location, const QMatrix3x3 *values, int count)-
1634{-
1635 QGLShaderProgramPrivate * const d = d_func();-
1636 (void)d;;-
1637 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix3x3) == sizeof(GLfloat) * 3 * 3
sizeof(QMatrix...float) * 3 * 3Description
TRUEnever evaluated
FALSEnever evaluated
) { d->glfuncs->glUniformMatrix3fv(location, count, 0, reinterpret_cast<const GLfloat *>(values[0].constData())); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(3 * 3 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (3 * 3)
index2 < (3 * 3)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[3 * 3 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniformMatrix3fv(location, count, 0, temp.constData()); }
never executed: end of block
0
1638 ;-
1639}-
1640void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix3x3 *values, int count)-
1641{-
1642 setUniformValueArray(uniformLocation(name), values, count);-
1643}
never executed: end of block
0
1644-
1645-
1646-
1647-
1648-
1649-
1650-
1651void QGLShaderProgram::setUniformValueArray(int location, const QMatrix3x4 *values, int count)-
1652{-
1653 QGLShaderProgramPrivate * const d = d_func();-
1654 (void)d;;-
1655 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix3x4) == sizeof(GLfloat) * 3 * 4
sizeof(QMatrix...float) * 3 * 4Description
TRUEnever evaluated
FALSEnever evaluated
) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); d->glfuncs->glUniform4fv(location, count * 3, data); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(3 * 4 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (3 * 4)
index2 < (3 * 4)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[3 * 4 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniform4fv(location, count * 3, temp.constData()); }
never executed: end of block
0
1656-
1657 ;-
1658}-
1659void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix3x4 *values, int count)-
1660{-
1661 setUniformValueArray(uniformLocation(name), values, count);-
1662}
never executed: end of block
0
1663-
1664-
1665-
1666-
1667-
1668-
1669-
1670void QGLShaderProgram::setUniformValueArray(int location, const QMatrix4x2 *values, int count)-
1671{-
1672 QGLShaderProgramPrivate * const d = d_func();-
1673 (void)d;;-
1674 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix4x2) == sizeof(GLfloat) * 4 * 2
sizeof(QMatrix...float) * 4 * 2Description
TRUEnever evaluated
FALSEnever evaluated
) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); d->glfuncs->glUniform2fv(location, count * 4, data); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(4 * 2 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (4 * 2)
index2 < (4 * 2)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[4 * 2 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniform2fv(location, count * 4, temp.constData()); }
never executed: end of block
0
1675-
1676 ;-
1677}-
1678void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x2 *values, int count)-
1679{-
1680 setUniformValueArray(uniformLocation(name), values, count);-
1681}
never executed: end of block
0
1682-
1683-
1684-
1685-
1686-
1687-
1688-
1689void QGLShaderProgram::setUniformValueArray(int location, const QMatrix4x3 *values, int count)-
1690{-
1691 QGLShaderProgramPrivate * const d = d_func();-
1692 (void)d;;-
1693 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix4x3) == sizeof(GLfloat) * 4 * 3
sizeof(QMatrix...float) * 4 * 3Description
TRUEnever evaluated
FALSEnever evaluated
) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); d->glfuncs->glUniform3fv(location, count * 4, data); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(4 * 3 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (4 * 3)
index2 < (4 * 3)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[4 * 3 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniform3fv(location, count * 4, temp.constData()); }
never executed: end of block
0
1694-
1695 ;-
1696}-
1697void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x3 *values, int count)-
1698{-
1699 setUniformValueArray(uniformLocation(name), values, count);-
1700}
never executed: end of block
0
1701-
1702-
1703-
1704-
1705-
1706-
1707-
1708void QGLShaderProgram::setUniformValueArray(int location, const QMatrix4x4 *values, int count)-
1709{-
1710 QGLShaderProgramPrivate * const d = d_func();-
1711 (void)d;;-
1712 if (location == -1
location == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| count <= 0
count <= 0Description
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
if (sizeof(QMatrix4x4) == sizeof(GLfloat) * 4 * 4
sizeof(QMatrix...float) * 4 * 4Description
TRUEnever evaluated
FALSEnever evaluated
) { d->glfuncs->glUniformMatrix4fv(location, count, 0, reinterpret_cast<const GLfloat *>(values[0].constData())); }
never executed: end of block
else { QVarLengthArray<GLfloat> temp(4 * 4 * count); for (int index = 0; index < count
index < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++index) { for (int index2 = 0; index2 < (4 * 4)
index2 < (4 * 4)Description
TRUEnever evaluated
FALSEnever evaluated
; ++index2) { temp.data()[4 * 4 * index + index2] = values[index].constData()[index2]; }
never executed: end of block
}
never executed: end of block
d->glfuncs->glUniformMatrix4fv(location, count, 0, temp.constData()); }
never executed: end of block
0
1713 ;-
1714}-
1715void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x4 *values, int count)-
1716{-
1717 setUniformValueArray(uniformLocation(name), values, count);-
1718}
never executed: end of block
0
1719int QGLShaderProgram::maxGeometryOutputVertices() const-
1720{-
1721 GLint n = 0;-
1722-
1723 const QGLShaderProgramPrivate * const d = d_func();-
1724 if (!QOpenGLContext::currentContext()->isOpenGLES()
!QOpenGLContex...->isOpenGLES()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1725 d->glfuncs->glGetIntegerv(0x8DE0, &n);
never executed: d->glfuncs->glGetIntegerv(0x8DE0, &n);
0
1726-
1727 return
never executed: return n;
n;
never executed: return n;
0
1728}-
1729void QGLShaderProgram::setGeometryOutputVertexCount(int count)-
1730{-
1731-
1732 int max = maxGeometryOutputVertices();-
1733 if (count > max
count > maxDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1734 QMessageLogger(__FILE__, 3093, __PRETTY_FUNCTION__).warning("QGLShaderProgram::setGeometryOutputVertexCount: count: %d higher than maximum: %d",-
1735 count, max);-
1736 }
never executed: end of block
0
1737-
1738 d_func()->geometryVertexCount = count;-
1739}
never executed: end of block
0
1740int QGLShaderProgram::geometryOutputVertexCount() const-
1741{-
1742 return
never executed: return d_func()->geometryVertexCount;
d_func()->geometryVertexCount;
never executed: return d_func()->geometryVertexCount;
0
1743}-
1744-
1745-
1746-
1747-
1748-
1749-
1750-
1751void QGLShaderProgram::setGeometryInputType(GLenum inputType)-
1752{-
1753 d_func()->geometryInputType = inputType;-
1754}
never executed: end of block
0
1755GLenum QGLShaderProgram::geometryInputType() const-
1756{-
1757 return
never executed: return d_func()->geometryInputType;
d_func()->geometryInputType;
never executed: return d_func()->geometryInputType;
0
1758}-
1759void QGLShaderProgram::setGeometryOutputType(GLenum outputType)-
1760{-
1761 d_func()->geometryOutputType = outputType;-
1762}
never executed: end of block
0
1763GLenum QGLShaderProgram::geometryOutputType() const-
1764{-
1765 return
never executed: return d_func()->geometryOutputType;
d_func()->geometryOutputType;
never executed: return d_func()->geometryOutputType;
0
1766}-
1767bool QGLShaderProgram::hasOpenGLShaderPrograms(const QGLContext *context)-
1768{-
1769-
1770 if (!context
!contextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1771 context = QGLContext::currentContext();
never executed: context = QGLContext::currentContext();
0
1772 if (!context
!contextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1773 return
never executed: return false;
false;
never executed: return false;
0
1774-
1775 QOpenGLFunctions functions(context->contextHandle());-
1776 return
never executed: return functions.hasOpenGLFeature(QOpenGLFunctions::Shaders);
functions.hasOpenGLFeature(QOpenGLFunctions::Shaders);
never executed: return functions.hasOpenGLFeature(QOpenGLFunctions::Shaders);
0
1777-
1778-
1779-
1780-
1781}-
1782-
1783-
1784-
1785-
1786void QGLShaderProgram::shaderDestroyed()-
1787{-
1788 QGLShaderProgramPrivate * const d = d_func();-
1789 QGLShader *shader = qobject_cast<QGLShader *>(sender());-
1790 if (shader
shaderDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
&& !d->removingShaders
!d->removingShadersDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-6
1791 removeShader(shader);
never executed: removeShader(shader);
0
1792}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
6
1793bool QGLShader::hasOpenGLShaders(ShaderType type, const QGLContext *context)-
1794{-
1795 if (!context
!contextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1796 context = QGLContext::currentContext();
never executed: context = QGLContext::currentContext();
0
1797 if (!context
!contextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1798 return
never executed: return false;
false;
never executed: return false;
0
1799-
1800 if ((
(type & ~(Geom...x | Fragment))Description
TRUEnever evaluated
FALSEnever evaluated
type & ~(Geometry | Vertex | Fragment))
(type & ~(Geom...x | Fragment))Description
TRUEnever evaluated
FALSEnever evaluated
|| type == 0
type == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1801 return
never executed: return false;
false;
never executed: return false;
0
1802-
1803 QOpenGLFunctions functions(context->contextHandle());-
1804 bool resolved = functions.hasOpenGLFeature(QOpenGLFunctions::Shaders);-
1805 if (!resolved
!resolvedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1806 return
never executed: return false;
false;
never executed: return false;
0
1807-
1808 if ((
(type & Geometry)Description
TRUEnever evaluated
FALSEnever evaluated
type & Geometry)
(type & Geometry)Description
TRUEnever evaluated
FALSEnever evaluated
&& !QByteArray((const char *) functions.glGetString(0x1F03)).contains("GL_EXT_geometry_shader4")
!QByteArray((c...etry_shader4")Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1809 return
never executed: return false;
false;
never executed: return false;
0
1810-
1811 return
never executed: return true;
true;
never executed: return true;
0
1812}-
1813-
1814-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9