qgl2pexvertexarray.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5void QGL2PEXVertexArray::clear()-
6{-
7 vertexArray.reset();-
8 vertexArrayStops.reset();-
9 boundingRectDirty = true;-
10}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
11-
12-
13QGLRect QGL2PEXVertexArray::boundingRect() const-
14{-
15 if (boundingRectDirty
boundingRectDirtyDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-6
16 return
never executed: return QGLRect(0.0, 0.0, 0.0, 0.0);
QGLRect(0.0, 0.0, 0.0, 0.0);
never executed: return QGLRect(0.0, 0.0, 0.0, 0.0);
0
17 else-
18 return
executed 6 times by 1 test: return QGLRect(minX, minY, maxX, maxY);
Executed by:
  • tst_qmdiarea - unknown status
QGLRect(minX, minY, maxX, maxY);
executed 6 times by 1 test: return QGLRect(minX, minY, maxX, maxY);
Executed by:
  • tst_qmdiarea - unknown status
6
19}-
20-
21void QGL2PEXVertexArray::addClosingLine(int index)-
22{-
23 QPointF point(vertexArray.at(index));-
24 if (point != QPointF(vertexArray.last())
point != QPoin...xArray.last())Description
TRUEnever evaluated
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-42
25 vertexArray.add(point);
never executed: vertexArray.add(point);
0
26}
executed 42 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
42
27-
28void QGL2PEXVertexArray::addCentroid(const QVectorPath &path, int subPathIndex)-
29{-
30 const QPointF *const points = reinterpret_cast<const QPointF *>(path.points());-
31 const QPainterPath::ElementType *const elements = path.elements();-
32-
33 QPointF sum = points[subPathIndex];-
34 int count = 1;-
35-
36 for (int i = subPathIndex + 1; i < path.elementCount()
i < path.elementCount()Description
TRUEevaluated 207 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
&& (!elements
!elementsDescription
TRUEnever evaluated
FALSEevaluated 207 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
|| elements[i] != QPainterPath::MoveToElement
elements[i] !=...:MoveToElementDescription
TRUEevaluated 168 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 39 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
); ++i) {
0-207
37 sum += points[i];-
38 ++count;-
39 }
executed 168 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
168
40-
41 const QPointF centroid = sum / qreal(count);-
42 vertexArray.add(centroid);-
43}
executed 42 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
42
44-
45void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline)-
46{-
47 const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());-
48 const QPainterPath::ElementType* const elements = path.elements();-
49-
50 if (boundingRectDirty
boundingRectDirtyDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-3
51 minX = maxX = points[0].x();-
52 minY = maxY = points[0].y();-
53 boundingRectDirty = false;-
54 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
55-
56 if (!outline
!outlineDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
&& !path.isConvex()
!path.isConvex()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
)
0-3
57 addCentroid(path, 0);
executed 3 times by 1 test: addCentroid(path, 0);
Executed by:
  • tst_qmdiarea - unknown status
3
58-
59 int lastMoveTo = vertexArray.size();-
60 vertexArray.add(points[0]);-
61-
62 do {-
63 if (!elements
!elementsDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
) {
0-3
64-
65-
66-
67 for (int i=1; i<path.elementCount()
i<path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
68 lineToArray(points[i].x(), points[i].y());
never executed: lineToArray(points[i].x(), points[i].y());
0
69-
70 break;
never executed: break;
0
71 }-
72-
73-
74 for (int i=1; i<path.elementCount()
i<path.elementCount()Description
TRUEevaluated 207 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
; ++i) {
3-207
75 switch (elements[i]) {-
76 case
executed 39 times by 1 test: case QPainterPath::MoveToElement:
Executed by:
  • tst_qmdiarea - unknown status
QPainterPath::MoveToElement:
executed 39 times by 1 test: case QPainterPath::MoveToElement:
Executed by:
  • tst_qmdiarea - unknown status
39
77 if (!outline
!outlineDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
)
0-39
78 addClosingLine(lastMoveTo);
executed 39 times by 1 test: addClosingLine(lastMoveTo);
Executed by:
  • tst_qmdiarea - unknown status
39
79-
80 vertexArrayStops.add(vertexArray.size());-
81 if (!outline
!outlineDescription
TRUEevaluated 39 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) {
0-39
82 if (!path.isConvex()
!path.isConvex()Description
TRUEevaluated 39 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
) addCentroid(path, i);
executed 39 times by 1 test: addCentroid(path, i);
Executed by:
  • tst_qmdiarea - unknown status
0-39
83 lastMoveTo = vertexArray.size();-
84 }
executed 39 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
39
85 lineToArray(points[i].x(), points[i].y());-
86 break;
executed 39 times by 1 test: break;
Executed by:
  • tst_qmdiarea - unknown status
39
87 case
executed 168 times by 1 test: case QPainterPath::LineToElement:
Executed by:
  • tst_qmdiarea - unknown status
QPainterPath::LineToElement:
executed 168 times by 1 test: case QPainterPath::LineToElement:
Executed by:
  • tst_qmdiarea - unknown status
168
88-
89 lineToArray(points[i].x(), points[i].y());-
90 break;
executed 168 times by 1 test: break;
Executed by:
  • tst_qmdiarea - unknown status
168
91 case
never executed: case QPainterPath::CurveToElement:
QPainterPath::CurveToElement:
never executed: case QPainterPath::CurveToElement:
{
0
92 QBezier b = QBezier::fromPoints(*(((const QPointF *) points) + i - 1),-
93 points[i],-
94 points[i+1],-
95 points[i+2]);-
96 QRectF bounds = b.bounds();-
97-
98 int threshold = qMin<float>(64, qMax(bounds.width(), bounds.height()) * 3.14f / (curveInverseScale * 6));-
99 if (threshold < 3
threshold < 3Description
TRUEnever evaluated
FALSEnever evaluated
) threshold = 3;
never executed: threshold = 3;
0
100 qreal one_over_threshold_minus_1 = qreal(1) / (threshold - 1);-
101 for (int t=0; t<threshold
t<thresholdDescription
TRUEnever evaluated
FALSEnever evaluated
; ++t) {
0
102 QPointF pt = b.pointAt(t * one_over_threshold_minus_1);-
103 lineToArray(pt.x(), pt.y());-
104 }
never executed: end of block
0
105 i += 2;-
106 break;
never executed: break;
}
0
107 default
never executed: default:
:
never executed: default:
0
108 break;
never executed: break;
0
109 }-
110 }-
111 } while (0);-
112-
113 if (!outline
!outlineDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEnever evaluated
)
0-3
114 addClosingLine(lastMoveTo);
executed 3 times by 1 test: addClosingLine(lastMoveTo);
Executed by:
  • tst_qmdiarea - unknown status
3
115 vertexArrayStops.add(vertexArray.size());-
116}
executed 3 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
3
117-
118void QGL2PEXVertexArray::lineToArray(const GLfloat x, const GLfloat y)-
119{-
120 vertexArray.add(QGLPoint(x, y));-
121-
122 if (x > maxX
x > maxXDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 192 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
15-192
123 maxX = x;
executed 15 times by 1 test: maxX = x;
Executed by:
  • tst_qmdiarea - unknown status
15
124 else if (x < minX
x < minXDescription
TRUEnever evaluated
FALSEevaluated 192 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-192
125 minX = x;
never executed: minX = x;
0
126 if (y > maxY
y > maxYDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
FALSEevaluated 189 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
18-189
127 maxY = y;
executed 18 times by 1 test: maxY = y;
Executed by:
  • tst_qmdiarea - unknown status
18
128 else if (y < minY
y < minYDescription
TRUEnever evaluated
FALSEevaluated 189 times by 1 test
Evaluated by:
  • tst_qmdiarea - unknown status
)
0-189
129 minY = y;
never executed: minY = y;
0
130}
executed 207 times by 1 test: end of block
Executed by:
  • tst_qmdiarea - unknown status
207
131-
132-
Switch to Source codePreprocessed file

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