OpenCoverage

qsgdistancefieldglyphnode_p.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qsgdistancefieldglyphnode_p_p.h"-
41#include <QtQuick/private/qsgtexture_p.h>-
42#include <QtGui/qopenglfunctions.h>-
43#include <QtGui/qsurface.h>-
44#include <QtGui/qwindow.h>-
45#include <qmath.h>-
46-
47QT_BEGIN_NAMESPACE-
48-
49class QSGDistanceFieldTextMaterialShader : public QSGMaterialShader-
50{-
51public:-
52 QSGDistanceFieldTextMaterialShader();-
53-
54 void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;-
55 char const *const *attributeNames() const override;-
56-
57protected:-
58 void initialize() override;-
59-
60 void updateAlphaRange();-
61 void updateColor(const QVector4D &c);-
62 void updateTextureScale(const QVector2D &ts);-
63-
64 float m_fontScale = 1.0;-
65 float m_matrixScale = 1.0;-
66-
67 int m_matrix_id = -1;-
68 int m_textureScale_id = -1;-
69 int m_alphaMin_id = -1;-
70 int m_alphaMax_id = -1;-
71 int m_color_id = -1;-
72-
73 QVector2D m_lastTextureScale;-
74 QVector4D m_lastColor;-
75 float m_lastAlphaMin = -1;-
76 float m_lastAlphaMax = -1;-
77};-
78-
79char const *const *QSGDistanceFieldTextMaterialShader::attributeNames() const {-
80 static char const *const attr[] = { "vCoord", "tCoord", nullptr };-
81 return attr;
executed 95811 times by 24 tests: return attr;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
95811
82}-
83-
84QSGDistanceFieldTextMaterialShader::QSGDistanceFieldTextMaterialShader()-
85{-
86 setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/distancefieldtext.vert"));
executed 1543 times by 24 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1543
87 setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/distancefieldtext.frag"));
executed 1543 times by 24 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1543
88}
executed 1543 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1543
89-
90static float qt_sg_envFloat(const char *name, float defaultValue)-
91{-
92 if (Q_LIKELY(!qEnvironmentVariableIsSet(name)))
__builtin_expe...(name)), true)Description
TRUEevaluated 240 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEnever evaluated
0-240
93 return defaultValue;
executed 240 times by 24 tests: return defaultValue;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
240
94 bool ok = false;-
95 const float value = qgetenv(name).toFloat(&ok);-
96 return ok ? value : defaultValue;
never executed: return ok ? value : defaultValue;
0
97}-
98-
99static float thresholdFunc(float glyphScale)-
100{-
101 static const float base = qt_sg_envFloat("QT_DF_BASE", 0.5f);-
102 static const float baseDev = qt_sg_envFloat("QT_DF_BASEDEVIATION", 0.065f);-
103 static const float devScaleMin = qt_sg_envFloat("QT_DF_SCALEFORMAXDEV", 0.15f);-
104 static const float devScaleMax = qt_sg_envFloat("QT_DF_SCALEFORNODEV", 0.3f);-
105 return base - ((qBound(devScaleMin, glyphScale, devScaleMax) - devScaleMin) / (devScaleMax - devScaleMin) * -baseDev + baseDev);
executed 34196 times by 24 tests: return base - ((qBound(devScaleMin, glyphScale, devScaleMax) - devScaleMin) / (devScaleMax - devScaleMin) * -baseDev + baseDev);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34196
106}-
107-
108static float spreadFunc(float glyphScale)-
109{-
110 static const float range = qt_sg_envFloat("QT_DF_RANGE", 0.06f);-
111 return range / glyphScale;
executed 34196 times by 24 tests: return range / glyphScale;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34196
112}-
113-
114void QSGDistanceFieldTextMaterialShader::updateAlphaRange()-
115{-
116 float combinedScale = m_fontScale * m_matrixScale;-
117 float base = thresholdFunc(combinedScale);-
118 float range = spreadFunc(combinedScale);-
119 float alphaMin = qMax(0.0f, base - range);-
120 float alphaMax = qMin(base + range, 1.0f);-
121 if (alphaMin != m_lastAlphaMin) {
alphaMin != m_lastAlphaMinDescription
TRUEevaluated 3295 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 30895 times by 23 tests
Evaluated by:
  • tst_examples
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
3295-30895
122 program()->setUniformValue(m_alphaMin_id, GLfloat(alphaMin));-
123 m_lastAlphaMin = alphaMin;-
124 }
executed 3295 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
3295
125 if (alphaMax != m_lastAlphaMax) {
alphaMax != m_lastAlphaMaxDescription
TRUEevaluated 3301 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 30889 times by 23 tests
Evaluated by:
  • tst_examples
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
3301-30889
126 program()->setUniformValue(m_alphaMax_id, GLfloat(alphaMax));-
127 m_lastAlphaMax = alphaMax;-
128 }
executed 3301 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
3301
129}
executed 34190 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34190
130-
131void QSGDistanceFieldTextMaterialShader::updateColor(const QVector4D &c)-
132{-
133 if (m_lastColor != c) {
m_lastColor != cDescription
TRUEevaluated 2415 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 28040 times by 23 tests
Evaluated by:
  • tst_examples
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
2415-28040
134 program()->setUniformValue(m_color_id, c);-
135 m_lastColor = c;-
136 }
executed 2415 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
2415
137}
executed 30455 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
30455
138-
139void QSGDistanceFieldTextMaterialShader::updateTextureScale(const QVector2D &ts)-
140{-
141 if (m_lastTextureScale != ts) {
m_lastTextureScale != tsDescription
TRUEevaluated 2249 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 30841 times by 23 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
2249-30841
142 program()->setUniformValue(m_textureScale_id, ts);-
143 m_lastTextureScale = ts;-
144 }
executed 2249 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
2249
145}
executed 33090 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
33090
146-
147void QSGDistanceFieldTextMaterialShader::initialize()-
148{-
149 QSGMaterialShader::initialize();-
150 m_matrix_id = program()->uniformLocation("matrix");-
151 m_textureScale_id = program()->uniformLocation("textureScale");-
152 m_color_id = program()->uniformLocation("color");-
153 m_alphaMin_id = program()->uniformLocation("alphaMin");-
154 m_alphaMax_id = program()->uniformLocation("alphaMax");-
155}
executed 1543 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1543
156-
157void QSGDistanceFieldTextMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)-
158{-
159 Q_ASSERT(oldEffect == nullptr || newEffect->type() == oldEffect->type());-
160 QSGDistanceFieldTextMaterial *material = static_cast<QSGDistanceFieldTextMaterial *>(newEffect);-
161 QSGDistanceFieldTextMaterial *oldMaterial = static_cast<QSGDistanceFieldTextMaterial *>(oldEffect);-
162-
163 bool updated = material->updateTextureSize();-
164-
165 if (oldMaterial == nullptr
oldMaterial == nullptrDescription
TRUEevaluated 30039 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 4151 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
4151-30039
166 || material->color() != oldMaterial->color()
material->colo...erial->color()Description
TRUEevaluated 412 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
FALSEevaluated 3739 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquicktext
  • tst_qquicktextedit
412-3739
167 || state.isOpacityDirty()) {
state.isOpacityDirty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 3735 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquicktext
  • tst_qquicktextedit
4-3735
168 QVector4D color = material->color();-
169 color *= state.opacity();-
170 updateColor(color);-
171 }
executed 30455 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
30455
172-
173 bool updateRange = false;-
174 if (oldMaterial == nullptr
oldMaterial == nullptrDescription
TRUEevaluated 30039 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 4151 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
4151-30039
175 || material->fontScale() != oldMaterial->fontScale()) {
material->font...l->fontScale()Description
TRUEevaluated 1224 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
FALSEevaluated 2927 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
1224-2927
176 m_fontScale = material->fontScale();-
177 updateRange = true;-
178 }
executed 31263 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
31263
179 if (state.isMatrixDirty()) {
state.isMatrixDirty()Description
TRUEevaluated 34190 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEnever evaluated
0-34190
180 program()->setUniformValue(m_matrix_id, state.combinedMatrix());-
181 m_matrixScale = qSqrt(qAbs(state.determinant())) * state.devicePixelRatio();-
182 updateRange = true;-
183 }
executed 34190 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34190
184 if (updateRange) {
updateRangeDescription
TRUEevaluated 34190 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEnever evaluated
0-34190
185 updateAlphaRange();-
186 }
executed 34190 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34190
187-
188 Q_ASSERT(material->glyphCache());-
189-
190 if (updated
updatedDescription
TRUEevaluated 10560 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 23630 times by 23 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
10560-23630
191 || oldMaterial == nullptr
oldMaterial == nullptrDescription
TRUEevaluated 22526 times by 22 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 1104 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
1104-22526
192 || oldMaterial->texture()->textureId != material->texture()->textureId) {
oldMaterial->t...e()->textureIdDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpathview
FALSEevaluated 1100 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
4-1100
193 updateTextureScale(QVector2D(1.0 / material->textureSize().width(),-
194 1.0 / material->textureSize().height()));-
195-
196 QOpenGLFunctions *funcs = state.context()->functions();-
197 funcs->glBindTexture(GL_TEXTURE_2D, material->texture()->textureId);-
198-
199 if (updated) {
updatedDescription
TRUEevaluated 10560 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 22530 times by 22 tests
Evaluated by:
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
10560-22530
200 // Set the mag/min filters to be linear. We only need to do this when the texture-
201 // has been recreated.-
202 funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);-
203 funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);-
204 funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);-
205 funcs->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);-
206 }
executed 10560 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
10560
207 }
executed 33090 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
33090
208}
executed 34190 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34190
209-
210QSGDistanceFieldTextMaterial::QSGDistanceFieldTextMaterial()-
211 : m_glyph_cache(nullptr)-
212 , m_texture(nullptr)-
213 , m_fontScale(1.0)-
214{-
215 setFlag(Blending | RequiresDeterminant, true);-
216}
executed 249131 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
249131
217-
218QSGDistanceFieldTextMaterial::~QSGDistanceFieldTextMaterial()-
219{-
220}-
221-
222QSGMaterialType *QSGDistanceFieldTextMaterial::type() const-
223{-
224 static QSGMaterialType type;-
225 return &type;
never executed: return &type;
0
226}-
227-
228void QSGDistanceFieldTextMaterial::setColor(const QColor &color)-
229{-
230 m_color = QVector4D(color.redF() * color.alphaF(),-
231 color.greenF() * color.alphaF(),-
232 color.blueF() * color.alphaF(),-
233 color.alphaF());-
234}
executed 34 times by 1 test: end of block
Executed by:
  • tst_examples
34
235-
236QSGMaterialShader *QSGDistanceFieldTextMaterial::createShader() const-
237{-
238 return new QSGDistanceFieldTextMaterialShader;
never executed: return new QSGDistanceFieldTextMaterialShader;
0
239}-
240-
241bool QSGDistanceFieldTextMaterial::updateTextureSize()-
242{-
243 if (!m_texture)
!m_textureDescription
TRUEnever evaluated
FALSEevaluated 34190 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
0-34190
244 m_texture = m_glyph_cache->glyphTexture(0); // invalid texture
never executed: m_texture = m_glyph_cache->glyphTexture(0);
0
245-
246 if (m_texture->size != m_size) {
m_texture->size != m_sizeDescription
TRUEevaluated 10560 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 23630 times by 23 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
10560-23630
247 m_size = m_texture->size;-
248 return true;
executed 10560 times by 24 tests: return true;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
10560
249 } else {-
250 return false;
executed 23630 times by 23 tests: return false;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
23630
251 }-
252}-
253-
254int QSGDistanceFieldTextMaterial::compare(const QSGMaterial *o) const-
255{-
256 Q_ASSERT(o && type() == o->type());-
257 const QSGDistanceFieldTextMaterial *other = static_cast<const QSGDistanceFieldTextMaterial *>(o);-
258 if (m_glyph_cache != other->m_glyph_cache)
m_glyph_cache ...>m_glyph_cacheDescription
TRUEevaluated 389 times by 3 tests
Evaluated by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquicktext
FALSEevaluated 515555 times by 17 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_touchmouse
389-515555
259 return m_glyph_cache - other->m_glyph_cache;
executed 389 times by 3 tests: return m_glyph_cache - other->m_glyph_cache;
Executed by:
  • tst_examples
  • tst_qquickpathview
  • tst_qquicktext
389
260 if (m_fontScale != other->m_fontScale) {
m_fontScale !=...r->m_fontScaleDescription
TRUEevaluated 3577 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquicktextedit
FALSEevaluated 511978 times by 17 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_touchmouse
3577-511978
261 return int(other->m_fontScale < m_fontScale) - int(m_fontScale < other->m_fontScale);
executed 3577 times by 7 tests: return int(other->m_fontScale < m_fontScale) - int(m_fontScale < other->m_fontScale);
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquicktextedit
3577
262 }-
263 if (m_color != other->m_color)
m_color != other->m_colorDescription
TRUEevaluated 120 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
FALSEevaluated 511858 times by 17 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_touchmouse
120-511858
264 return &m_color < &other->m_color ? -1 : 1;
executed 120 times by 4 tests: return &m_color < &other->m_color ? -1 : 1;
Executed by:
  • tst_examples
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
120
265 int t0 = m_texture ? m_texture->textureId : 0;
m_textureDescription
TRUEevaluated 511858 times by 17 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_touchmouse
FALSEnever evaluated
0-511858
266 int t1 = other->m_texture ? other->m_texture->textureId : 0;
other->m_textureDescription
TRUEevaluated 511858 times by 17 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_touchmouse
FALSEnever evaluated
0-511858
267 return t0 - t1;
executed 511858 times by 17 tests: return t0 - t1;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_touchmouse
511858
268}-
269-
270-
271class DistanceFieldStyledTextMaterialShader : public QSGDistanceFieldTextMaterialShader-
272{-
273public:-
274 DistanceFieldStyledTextMaterialShader();-
275-
276 void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;-
277-
278protected:-
279 void initialize() override;-
280-
281 int m_styleColor_id = -1;-
282};-
283-
284DistanceFieldStyledTextMaterialShader::DistanceFieldStyledTextMaterialShader()-
285 : QSGDistanceFieldTextMaterialShader()-
286{-
287}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
288-
289void DistanceFieldStyledTextMaterialShader::initialize()-
290{-
291 QSGDistanceFieldTextMaterialShader::initialize();-
292 m_styleColor_id = program()->uniformLocation("styleColor");-
293}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
294-
295void DistanceFieldStyledTextMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)-
296{-
297 QSGDistanceFieldTextMaterialShader::updateState(state, newEffect, oldEffect);-
298-
299 QSGDistanceFieldStyledTextMaterial *material = static_cast<QSGDistanceFieldStyledTextMaterial *>(newEffect);-
300 QSGDistanceFieldStyledTextMaterial *oldMaterial = static_cast<QSGDistanceFieldStyledTextMaterial *>(oldEffect);-
301-
302 if (oldMaterial == nullptr
oldMaterial == nullptrDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
2-16
303 || material->styleColor() != oldMaterial->styleColor()
material->styl...->styleColor()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
0-2
304 || (state.isOpacityDirty())) {
(state.isOpacityDirty())Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
0-2
305 QVector4D color = material->styleColor();-
306 color *= state.opacity();-
307 program()->setUniformValue(m_styleColor_id, color);-
308 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_examples
16
309}
executed 18 times by 1 test: end of block
Executed by:
  • tst_examples
18
310-
311QSGDistanceFieldStyledTextMaterial::QSGDistanceFieldStyledTextMaterial()-
312 : QSGDistanceFieldTextMaterial()-
313{-
314}
executed 34 times by 1 test: end of block
Executed by:
  • tst_examples
34
315-
316QSGDistanceFieldStyledTextMaterial::~QSGDistanceFieldStyledTextMaterial()-
317{-
318}-
319-
320void QSGDistanceFieldStyledTextMaterial::setStyleColor(const QColor &color)-
321{-
322 m_styleColor = QVector4D(color.redF() * color.alphaF(),-
323 color.greenF() * color.alphaF(),-
324 color.blueF() * color.alphaF(),-
325 color.alphaF());-
326}
executed 34 times by 1 test: end of block
Executed by:
  • tst_examples
34
327-
328int QSGDistanceFieldStyledTextMaterial::compare(const QSGMaterial *o) const-
329{-
330 Q_ASSERT(o && type() == o->type());-
331 const QSGDistanceFieldStyledTextMaterial *other = static_cast<const QSGDistanceFieldStyledTextMaterial *>(o);-
332 if (m_styleColor != other->m_styleColor)
m_styleColor !...->m_styleColorDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
0-22
333 return &m_styleColor < &other->m_styleColor ? -1 : 1;
never executed: return &m_styleColor < &other->m_styleColor ? -1 : 1;
0
334 return QSGDistanceFieldTextMaterial::compare(o);
executed 22 times by 1 test: return QSGDistanceFieldTextMaterial::compare(o);
Executed by:
  • tst_examples
22
335}-
336-
337-
338class DistanceFieldOutlineTextMaterialShader : public DistanceFieldStyledTextMaterialShader-
339{-
340public:-
341 DistanceFieldOutlineTextMaterialShader();-
342-
343 void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;-
344-
345protected:-
346 void initialize() override;-
347-
348 void updateOutlineAlphaRange(int dfRadius);-
349-
350 int m_outlineAlphaMax0_id = -1;-
351 int m_outlineAlphaMax1_id = -1;-
352};-
353-
354DistanceFieldOutlineTextMaterialShader::DistanceFieldOutlineTextMaterialShader()-
355 : DistanceFieldStyledTextMaterialShader()-
356{-
357 setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/distancefieldoutlinetext.frag"));
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
4
358}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
359-
360void DistanceFieldOutlineTextMaterialShader::initialize()-
361{-
362 DistanceFieldStyledTextMaterialShader::initialize();-
363 m_outlineAlphaMax0_id = program()->uniformLocation("outlineAlphaMax0");-
364 m_outlineAlphaMax1_id = program()->uniformLocation("outlineAlphaMax1");-
365}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
366-
367void DistanceFieldOutlineTextMaterialShader::updateOutlineAlphaRange(int dfRadius)-
368{-
369 float combinedScale = m_fontScale * m_matrixScale;-
370 float base = thresholdFunc(combinedScale);-
371 float range = spreadFunc(combinedScale);-
372 float outlineLimit = qMax(0.2f, base - 0.5f / dfRadius / m_fontScale);-
373-
374 float alphaMin = qMax(0.0f, base - range);-
375 float styleAlphaMin0 = qMax(0.0f, outlineLimit - range);-
376 float styleAlphaMin1 = qMin(outlineLimit + range, alphaMin);-
377 program()->setUniformValue(m_outlineAlphaMax0_id, GLfloat(styleAlphaMin0));-
378 program()->setUniformValue(m_outlineAlphaMax1_id, GLfloat(styleAlphaMin1));-
379}
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
380-
381void DistanceFieldOutlineTextMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)-
382{-
383 DistanceFieldStyledTextMaterialShader::updateState(state, newEffect, oldEffect);-
384-
385 QSGDistanceFieldOutlineTextMaterial *material = static_cast<QSGDistanceFieldOutlineTextMaterial *>(newEffect);-
386 QSGDistanceFieldOutlineTextMaterial *oldMaterial = static_cast<QSGDistanceFieldOutlineTextMaterial *>(oldEffect);-
387-
388 if (oldMaterial == nullptr
oldMaterial == nullptrDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
2-4
389 || material->fontScale() != oldMaterial->fontScale()
material->font...l->fontScale()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-2
390 || state.isMatrixDirty())
state.isMatrixDirty()Description
TRUEnever evaluated
FALSEnever evaluated
0
391 updateOutlineAlphaRange(material->glyphCache()->distanceFieldRadius());
executed 6 times by 1 test: updateOutlineAlphaRange(material->glyphCache()->distanceFieldRadius());
Executed by:
  • tst_examples
6
392}
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
393-
394-
395QSGDistanceFieldOutlineTextMaterial::QSGDistanceFieldOutlineTextMaterial()-
396 : QSGDistanceFieldStyledTextMaterial()-
397{-
398}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
399-
400QSGDistanceFieldOutlineTextMaterial::~QSGDistanceFieldOutlineTextMaterial()-
401{-
402}-
403-
404QSGMaterialType *QSGDistanceFieldOutlineTextMaterial::type() const-
405{-
406 static QSGMaterialType type;-
407 return &type;
executed 28 times by 1 test: return &type;
Executed by:
  • tst_examples
28
408}-
409-
410QSGMaterialShader *QSGDistanceFieldOutlineTextMaterial::createShader() const-
411{-
412 return new DistanceFieldOutlineTextMaterialShader;
executed 4 times by 1 test: return new DistanceFieldOutlineTextMaterialShader;
Executed by:
  • tst_examples
4
413}-
414-
415-
416class DistanceFieldShiftedStyleTextMaterialShader : public DistanceFieldStyledTextMaterialShader-
417{-
418public:-
419 DistanceFieldShiftedStyleTextMaterialShader();-
420-
421 void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;-
422-
423protected:-
424 void initialize() override;-
425-
426 void updateShift(qreal fontScale, const QPointF& shift);-
427-
428 int m_shift_id = -1;-
429};-
430-
431DistanceFieldShiftedStyleTextMaterialShader::DistanceFieldShiftedStyleTextMaterialShader()-
432 : DistanceFieldStyledTextMaterialShader()-
433{-
434 setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/distancefieldshiftedtext.vert"));
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
4
435 setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/distancefieldshiftedtext.frag"));
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
4
436}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
437-
438void DistanceFieldShiftedStyleTextMaterialShader::initialize()-
439{-
440 DistanceFieldStyledTextMaterialShader::initialize();-
441 m_shift_id = program()->uniformLocation("shift");-
442}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
443-
444void DistanceFieldShiftedStyleTextMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)-
445{-
446 DistanceFieldStyledTextMaterialShader::updateState(state, newEffect, oldEffect);-
447-
448 QSGDistanceFieldShiftedStyleTextMaterial *material = static_cast<QSGDistanceFieldShiftedStyleTextMaterial *>(newEffect);-
449 QSGDistanceFieldShiftedStyleTextMaterial *oldMaterial = static_cast<QSGDistanceFieldShiftedStyleTextMaterial *>(oldEffect);-
450-
451 if (oldMaterial == nullptr
oldMaterial == nullptrDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
0-12
452 || oldMaterial->fontScale() != material->fontScale()
oldMaterial->f...l->fontScale()Description
TRUEnever evaluated
FALSEnever evaluated
0
453 || oldMaterial->shift() != material->shift()
oldMaterial->s...erial->shift()Description
TRUEnever evaluated
FALSEnever evaluated
0
454 || oldMaterial->textureSize() != material->textureSize()) {
oldMaterial->t...>textureSize()Description
TRUEnever evaluated
FALSEnever evaluated
0
455 updateShift(material->fontScale(), material->shift());-
456 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
457}
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
458-
459void DistanceFieldShiftedStyleTextMaterialShader::updateShift(qreal fontScale, const QPointF &shift)-
460{-
461 QPointF texel(1.0 / fontScale * shift.x(),-
462 1.0 / fontScale * shift.y());-
463 program()->setUniformValue(m_shift_id, texel);-
464}
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
465-
466QSGDistanceFieldShiftedStyleTextMaterial::QSGDistanceFieldShiftedStyleTextMaterial()-
467 : QSGDistanceFieldStyledTextMaterial()-
468{-
469}
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
470-
471QSGDistanceFieldShiftedStyleTextMaterial::~QSGDistanceFieldShiftedStyleTextMaterial()-
472{-
473}-
474-
475QSGMaterialType *QSGDistanceFieldShiftedStyleTextMaterial::type() const-
476{-
477 static QSGMaterialType type;-
478 return &type;
executed 198 times by 1 test: return &type;
Executed by:
  • tst_examples
198
479}-
480-
481QSGMaterialShader *QSGDistanceFieldShiftedStyleTextMaterial::createShader() const-
482{-
483 return new DistanceFieldShiftedStyleTextMaterialShader;
executed 4 times by 1 test: return new DistanceFieldShiftedStyleTextMaterialShader;
Executed by:
  • tst_examples
4
484}-
485-
486int QSGDistanceFieldShiftedStyleTextMaterial::compare(const QSGMaterial *o) const-
487{-
488 const QSGDistanceFieldShiftedStyleTextMaterial *other = static_cast<const QSGDistanceFieldShiftedStyleTextMaterial *>(o);-
489 if (m_shift != other->m_shift)
m_shift != other->m_shiftDescription
TRUEnever evaluated
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_examples
0-20
490 return &m_shift < &other->m_shift ? -1 : 1;
never executed: return &m_shift < &other->m_shift ? -1 : 1;
0
491 return QSGDistanceFieldStyledTextMaterial::compare(o);
executed 20 times by 1 test: return QSGDistanceFieldStyledTextMaterial::compare(o);
Executed by:
  • tst_examples
20
492}-
493-
494class QSGHiQSubPixelDistanceFieldTextMaterialShader : public QSGDistanceFieldTextMaterialShader-
495{-
496public:-
497 QSGHiQSubPixelDistanceFieldTextMaterialShader();-
498-
499 void initialize() override;-
500 void activate() override;-
501 void deactivate() override;-
502 void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override;-
503-
504private:-
505 int m_fontScale_id = -1;-
506 int m_vecDelta_id = -1;-
507};-
508-
509QSGHiQSubPixelDistanceFieldTextMaterialShader::QSGHiQSubPixelDistanceFieldTextMaterialShader()-
510 : QSGDistanceFieldTextMaterialShader()-
511{-
512 setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/hiqsubpixeldistancefieldtext.vert"));
executed 1535 times by 24 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1535
513 setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/hiqsubpixeldistancefieldtext.frag"));
executed 1535 times by 24 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1535
514}
executed 1535 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1535
515-
516void QSGHiQSubPixelDistanceFieldTextMaterialShader::initialize()-
517{-
518 QSGDistanceFieldTextMaterialShader::initialize();-
519 m_fontScale_id = program()->uniformLocation("fontScale");-
520 m_vecDelta_id = program()->uniformLocation("vecDelta");-
521}
executed 1535 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1535
522-
523void QSGHiQSubPixelDistanceFieldTextMaterialShader::activate()-
524{-
525 QSGDistanceFieldTextMaterialShader::activate();-
526 QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_SRC_COLOR);-
527}
executed 30023 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
30023
528-
529void QSGHiQSubPixelDistanceFieldTextMaterialShader::deactivate()-
530{-
531 QSGDistanceFieldTextMaterialShader::deactivate();-
532 QOpenGLContext::currentContext()->functions()->glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);-
533}
executed 30023 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
30023
534-
535void QSGHiQSubPixelDistanceFieldTextMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)-
536{-
537 Q_ASSERT(oldEffect == nullptr || newEffect->type() == oldEffect->type());-
538 QSGDistanceFieldTextMaterial *material = static_cast<QSGDistanceFieldTextMaterial *>(newEffect);-
539 QSGDistanceFieldTextMaterial *oldMaterial = static_cast<QSGDistanceFieldTextMaterial *>(oldEffect);-
540-
541 if (oldMaterial == nullptr || material->color() != oldMaterial->color()) {
oldMaterial == nullptrDescription
TRUEevaluated 30023 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 4149 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
material->colo...erial->color()Description
TRUEevaluated 412 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickfocusscope
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
FALSEevaluated 3737 times by 7 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquicktext
  • tst_qquicktextedit
412-30023
542 QVector4D c = material->color();-
543 state.context()->functions()->glBlendColor(c.x(), c.y(), c.z(), 1.0f);-
544 }
executed 30435 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
30435
545-
546 if (oldMaterial == nullptr || material->fontScale() != oldMaterial->fontScale())
oldMaterial == nullptrDescription
TRUEevaluated 30023 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 4149 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
material->font...l->fontScale()Description
TRUEevaluated 1222 times by 8 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktextedit
FALSEevaluated 2927 times by 6 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
1222-30023
547 program()->setUniformValue(m_fontScale_id, GLfloat(material->fontScale()));
executed 31245 times by 24 tests: program()->setUniformValue(m_fontScale_id, GLfloat(material->fontScale()));
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
31245
548-
549 if (oldMaterial == nullptr || state.isMatrixDirty()) {
oldMaterial == nullptrDescription
TRUEevaluated 30023 times by 24 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
FALSEevaluated 4149 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
state.isMatrixDirty()Description
TRUEevaluated 4149 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktext
  • tst_qquicktextedit
FALSEnever evaluated
0-30023
550 int viewportWidth = state.viewportRect().width();-
551 QMatrix4x4 mat = state.combinedMatrix().inverted();-
552 program()->setUniformValue(m_vecDelta_id, mat.column(0) * (qreal(2) / viewportWidth));-
553 }
executed 34172 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34172
554-
555 QSGDistanceFieldTextMaterialShader::updateState(state, newEffect, oldEffect);-
556}
executed 34172 times by 24 tests: end of block
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
34172
557-
558QSGMaterialType *QSGHiQSubPixelDistanceFieldTextMaterial::type() const-
559{-
560 static QSGMaterialType type;-
561 return &type;
executed 2114412 times by 24 tests: return &type;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
2114412
562}-
563-
564QSGMaterialShader *QSGHiQSubPixelDistanceFieldTextMaterial::createShader() const-
565{-
566 return new QSGHiQSubPixelDistanceFieldTextMaterialShader;
executed 1535 times by 24 tests: return new QSGHiQSubPixelDistanceFieldTextMaterialShader;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickgridview
  • tst_qquickitem
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpincharea
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickspringanimation
  • tst_qquicktaphandler
  • tst_qquicktext
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_scenegraph
  • tst_touchmouse
1535
567}-
568-
569-
570class QSGLoQSubPixelDistanceFieldTextMaterialShader : public QSGHiQSubPixelDistanceFieldTextMaterialShader-
571{-
572public:-
573 QSGLoQSubPixelDistanceFieldTextMaterialShader();-
574};-
575-
576QSGLoQSubPixelDistanceFieldTextMaterialShader::QSGLoQSubPixelDistanceFieldTextMaterialShader()-
577 : QSGHiQSubPixelDistanceFieldTextMaterialShader()-
578{-
579 setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/loqsubpixeldistancefieldtext.vert"));
never executed: return qstring_literal_temp;
0
580 setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/loqsubpixeldistancefieldtext.frag"));
never executed: return qstring_literal_temp;
0
581}
never executed: end of block
0
582-
583QSGMaterialType *QSGLoQSubPixelDistanceFieldTextMaterial::type() const-
584{-
585 static QSGMaterialType type;-
586 return &type;
never executed: return &type;
0
587}-
588-
589QSGMaterialShader *QSGLoQSubPixelDistanceFieldTextMaterial::createShader() const-
590{-
591 return new QSGLoQSubPixelDistanceFieldTextMaterialShader;
never executed: return new QSGLoQSubPixelDistanceFieldTextMaterialShader;
0
592}-
593-
594QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0