qpaintengine.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpaintengine.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4qreal QTextItem::descent() const-
5{-
6 const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);-
7 return
never executed: return ti->descent.toReal();
ti->descent.toReal();
never executed: return ti->descent.toReal();
0
8}-
9-
10-
11-
12-
13-
14-
15qreal QTextItem::ascent() const-
16{-
17 const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);-
18 return
never executed: return ti->ascent.toReal();
ti->ascent.toReal();
never executed: return ti->ascent.toReal();
0
19}-
20-
21-
22-
23-
24-
25-
26qreal QTextItem::width() const-
27{-
28 const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);-
29 return
never executed: return ti->width.toReal();
ti->width.toReal();
never executed: return ti->width.toReal();
0
30}-
31-
32-
33-
34-
35-
36-
37QTextItem::RenderFlags QTextItem::renderFlags() const-
38{-
39 const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);-
40 return
never executed: return ti->flags;
ti->flags;
never executed: return ti->flags;
0
41}-
42-
43-
44-
45-
46-
47-
48QString QTextItem::text() const-
49{-
50 const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);-
51 return
never executed: return QString(ti->chars, ti->num_chars);
QString(ti->chars, ti->num_chars);
never executed: return QString(ti->chars, ti->num_chars);
0
52}-
53-
54-
55-
56-
57-
58-
59QFont QTextItem::font() const-
60{-
61 const QTextItemInt *ti = static_cast<const QTextItemInt *>(this);-
62 return
never executed: return ti->f ? *ti->f : QGuiApplication::font();
ti->f
ti->fDescription
TRUEnever evaluated
FALSEnever evaluated
? *ti->f : QGuiApplication::font();
never executed: return ti->f ? *ti->f : QGuiApplication::font();
0
63}-
64void QPaintEngine::syncState()-
65{-
66 ((!(state)) ? qt_assert("state",__FILE__,295) : qt_noop());-
67 updateState(*state);-
68-
69 if (isExtended()
isExtended()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
70 static_cast<
never executed: static_cast<QPaintEngineEx *>(this)->sync();
QPaintEngineEx *>(this)->sync();
never executed: static_cast<QPaintEngineEx *>(this)->sync();
0
71}
never executed: end of block
0
72-
73static QPaintEngine *qt_polygon_recursion = 0;-
74struct QT_Point {-
75 int x;-
76 int y;-
77};-
78void QPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)-
79{-
80 ((!(qt_polygon_recursion != this)) ? qt_assert_x("QPaintEngine::drawPolygon", "At least one drawPolygon function must be implemented",-
81 __FILE__-
82 ,-
83 321-
84 ) : qt_noop())-
85 ;-
86 qt_polygon_recursion = this;-
87 ((!(sizeof(QT_Point) == sizeof(QPoint))) ? qt_assert("sizeof(QT_Point) == sizeof(QPoint)",__FILE__,323) : qt_noop());-
88 QVarLengthArray<QT_Point> p(pointCount);-
89 for (int i = 0; i < pointCount
i < pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
90 p[i].x = qRound(points[i].x());-
91 p[i].y = qRound(points[i].y());-
92 }
never executed: end of block
0
93 drawPolygon((QPoint *)p.data(), pointCount, mode);-
94 qt_polygon_recursion = 0;-
95}
never executed: end of block
0
96-
97struct QT_PointF {-
98 qreal x;-
99 qreal y;-
100};-
101void QPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode)-
102{-
103 ((!(qt_polygon_recursion != this)) ? qt_assert_x("QPaintEngine::drawPolygon", "At least one drawPolygon function must be implemented",-
104 __FILE__-
105 ,-
106 348-
107 ) : qt_noop())-
108 ;-
109 qt_polygon_recursion = this;-
110 ((!(sizeof(QT_PointF) == sizeof(QPointF))) ? qt_assert("sizeof(QT_PointF) == sizeof(QPointF)",__FILE__,350) : qt_noop());-
111 QVarLengthArray<QT_PointF> p(pointCount);-
112 for (int i=0; i<pointCount
i<pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
113 p[i].x = points[i].x();-
114 p[i].y = points[i].y();-
115 }
never executed: end of block
0
116 drawPolygon((QPointF *)p.data(), pointCount, mode);-
117 qt_polygon_recursion = 0;-
118}
never executed: end of block
0
119void QPaintEngine::drawPoints(const QPointF *points, int pointCount)-
120{-
121 QPainter *p = painter();-
122 if (!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
123 return;
never executed: return;
0
124-
125 qreal penWidth = p->pen().widthF();-
126 if (penWidth == 0
penWidth == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
127 penWidth = 1;
never executed: penWidth = 1;
0
128-
129 bool ellipses = p->pen().capStyle() == Qt::RoundCap;-
130-
131 p->save();-
132-
133 QTransform transform;-
134 if (qt_pen_is_cosmetic(p->pen(), p->renderHints())
qt_pen_is_cosm...renderHints())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
135 transform = p->transform();-
136 p->setTransform(QTransform());-
137 }
never executed: end of block
0
138-
139 p->setBrush(p->pen().brush());-
140 p->setPen(Qt::NoPen);-
141-
142 for (int i=0; i<pointCount
i<pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
143 QPointF pos = transform.map(points[i]);-
144 QRectF rect(pos.x() - penWidth / 2, pos.y() - penWidth / 2, penWidth, penWidth);-
145-
146 if (ellipses
ellipsesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
147 p->drawEllipse(rect);
never executed: p->drawEllipse(rect);
0
148 else-
149 p->drawRect(rect);
never executed: p->drawRect(rect);
0
150 }-
151-
152 p->restore();-
153}
never executed: end of block
0
154void QPaintEngine::drawPoints(const QPoint *points, int pointCount)-
155{-
156 ((!(sizeof(QT_PointF) == sizeof(QPointF))) ? qt_assert("sizeof(QT_PointF) == sizeof(QPointF)",__FILE__,472) : qt_noop());-
157 QT_PointF fp[256];-
158 while (pointCount
pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
159 int i = 0;-
160 while (i < pointCount
i < pointCountDescription
TRUEnever evaluated
FALSEnever evaluated
&& i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
161 fp[i].x = points[i].x();-
162 fp[i].y = points[i].y();-
163 ++i;-
164 }
never executed: end of block
0
165 drawPoints((QPointF *)(void *)fp, i);-
166 points += i;-
167 pointCount -= i;-
168 }
never executed: end of block
0
169}
never executed: end of block
0
170void QPaintEngine::drawEllipse(const QRectF &rect)-
171{-
172 QPainterPath path;-
173 path.addEllipse(rect);-
174 if (hasFeature(PainterPaths)
hasFeature(PainterPaths)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
175 drawPath(path);-
176 }
never executed: end of block
else {
0
177 QPolygonF polygon = path.toFillPolygon();-
178 drawPolygon(polygon.data(), polygon.size(), ConvexMode);-
179 }
never executed: end of block
0
180}-
181-
182-
183-
184-
185-
186void QPaintEngine::drawEllipse(const QRect &rect)-
187{-
188 drawEllipse(QRectF(rect));-
189}
never executed: end of block
0
190void qt_fill_tile(QPixmap *tile, const QPixmap &pixmap)-
191{-
192 QPainter p(tile);-
193 p.drawPixmap(0, 0, pixmap);-
194 int x = pixmap.width();-
195 while (x < tile->width()
x < tile->width()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
196 p.drawPixmap(x, 0, *tile, 0, 0, x, pixmap.height());-
197 x *= 2;-
198 }
never executed: end of block
0
199 int y = pixmap.height();-
200 while (y < tile->height()
y < tile->height()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
201 p.drawPixmap(0, y, *tile, 0, 0, tile->width(), y);-
202 y *= 2;-
203 }
never executed: end of block
0
204}
never executed: end of block
0
205-
206void qt_draw_tile(QPaintEngine *gc, qreal x, qreal y, qreal w, qreal h,-
207 const QPixmap &pixmap, qreal xOffset, qreal yOffset)-
208{-
209 qreal yPos, xPos, drawH, drawW, yOff, xOff;-
210 yPos = y;-
211 yOff = yOffset;-
212 while(yPos < y + h
yPos < y + hDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
213 drawH = pixmap.height() - yOff;-
214 if (yPos + drawH > y + h
yPos + drawH > y + hDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
215 drawH = y + h - yPos;
never executed: drawH = y + h - yPos;
0
216 xPos = x;-
217 xOff = xOffset;-
218 while(xPos < x + w
xPos < x + wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
219 drawW = pixmap.width() - xOff;-
220 if (xPos + drawW > x + w
xPos + drawW > x + wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
221 drawW = x + w - xPos;
never executed: drawW = x + w - xPos;
0
222 if (drawW > 0
drawW > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& drawH > 0
drawH > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
223 gc->drawPixmap(QRectF(xPos, yPos, drawW, drawH), pixmap, QRectF(xOff, yOff, drawW, drawH));
never executed: gc->drawPixmap(QRectF(xPos, yPos, drawW, drawH), pixmap, QRectF(xOff, yOff, drawW, drawH));
0
224 xPos += drawW;-
225 xOff = 0;-
226 }
never executed: end of block
0
227 yPos += drawH;-
228 yOff = 0;-
229 }
never executed: end of block
0
230}
never executed: end of block
0
231-
232-
233-
234-
235-
236-
237-
238void QPaintEngine::drawTiledPixmap(const QRectF &rect, const QPixmap &pixmap, const QPointF &p)-
239{-
240 int sw = pixmap.width();-
241 int sh = pixmap.height();-
242-
243 if (sw*sh < 8192
sw*sh < 8192Description
TRUEnever evaluated
FALSEnever evaluated
&& sw*sh < 16*rect.width()*rect.height()
sw*sh < 16*rec...*rect.height()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
244 int tw = sw, th = sh;-
245 while (tw*th < 32678
tw*th < 32678Description
TRUEnever evaluated
FALSEnever evaluated
&& tw < rect.width()/2
tw < rect.width()/2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
246 tw *= 2;
never executed: tw *= 2;
0
247 while (tw*th < 32678
tw*th < 32678Description
TRUEnever evaluated
FALSEnever evaluated
&& th < rect.height()/2
th < rect.height()/2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
248 th *= 2;
never executed: th *= 2;
0
249 QPixmap tile;-
250 if (pixmap.depth() == 1
pixmap.depth() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
251 tile = QBitmap(tw, th);-
252 }
never executed: end of block
else {
0
253 tile = QPixmap(tw, th);-
254 if (pixmap.hasAlphaChannel()
pixmap.hasAlphaChannel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
255 tile.fill(Qt::transparent);
never executed: tile.fill(Qt::transparent);
0
256 }
never executed: end of block
0
257 qt_fill_tile(&tile, pixmap);-
258 qt_draw_tile(this, rect.x(), rect.y(), rect.width(), rect.height(), tile, p.x(), p.y());-
259 }
never executed: end of block
else {
0
260 qt_draw_tile(this, rect.x(), rect.y(), rect.width(), rect.height(), pixmap, p.x(), p.y());-
261 }
never executed: end of block
0
262}-
263void QPaintEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr,-
264 Qt::ImageConversionFlags flags)-
265{-
266 QRectF baseSize(0, 0, image.width(), image.height());-
267 QImage im = image;-
268 if (baseSize != sr
baseSize != srDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
269 im = im.copy(qFloor(sr.x()), qFloor(sr.y()),
never executed: im = im.copy(qFloor(sr.x()), qFloor(sr.y()), qCeil(sr.width()), qCeil(sr.height()));
0
270 qCeil(sr.width()), qCeil(sr.height()));
never executed: im = im.copy(qFloor(sr.x()), qFloor(sr.y()), qCeil(sr.width()), qCeil(sr.height()));
0
271 QPixmap pm = QPixmap::fromImage(im, flags);-
272 drawPixmap(r, pm, QRectF(QPointF(0, 0), pm.size()));-
273}
never executed: end of block
0
274QPaintEngine::QPaintEngine(PaintEngineFeatures caps)-
275 : state(0),-
276 gccaps(caps),-
277 active(0),-
278 selfDestruct(false),-
279 extended(false),-
280 d_ptr(new QPaintEnginePrivate)-
281{-
282 d_ptr->q_ptr = this;-
283}
never executed: end of block
0
284-
285-
286-
287-
288-
289QPaintEngine::QPaintEngine(QPaintEnginePrivate &dptr, PaintEngineFeatures caps)-
290 : state(0),-
291 gccaps(caps),-
292 active(0),-
293 selfDestruct(false),-
294 extended(false),-
295 d_ptr(&dptr)-
296{-
297 d_ptr->q_ptr = this;-
298}
never executed: end of block
0
299-
300-
301-
302-
303QPaintEngine::~QPaintEngine()-
304{-
305}-
306-
307-
308-
309-
310QPainter *QPaintEngine::painter() const-
311{-
312 return
never executed: return state ? state->painter() : 0;
state
stateDescription
TRUEnever evaluated
FALSEnever evaluated
? state->painter() : 0;
never executed: return state ? state->painter() : 0;
0
313}-
314-
315-
316-
317-
318-
319void QPaintEngine::drawPath(const QPainterPath &)-
320{-
321 if (hasFeature(PainterPaths)
hasFeature(PainterPaths)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
322 QMessageLogger(__FILE__, 732, __PRETTY_FUNCTION__).warning("QPaintEngine::drawPath: Must be implemented when feature PainterPaths is set");-
323 }
never executed: end of block
0
324}
never executed: end of block
0
325-
326-
327-
328-
329-
330-
331-
332void QPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)-
333{-
334 const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);-
335-
336 QPainterPath path;-
337 path.setFillRule(Qt::WindingFill);-
338 if (ti.glyphs.numGlyphs
ti.glyphs.numGlyphsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
339 ti.fontEngine->addOutlineToPath(0, 0, ti.glyphs, &path, ti.flags);
never executed: ti.fontEngine->addOutlineToPath(0, 0, ti.glyphs, &path, ti.flags);
0
340 if (!path.isEmpty()
!path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
341 painter()->save();-
342 painter()->setRenderHint(QPainter::Antialiasing,-
343 bool((painter()->renderHints() & QPainter::TextAntialiasing)-
344 && !(painter()->font().styleStrategy() & QFont::NoAntialias)));-
345 painter()->translate(p.x(), p.y());-
346 painter()->fillPath(path, painter()->pen().brush());-
347 painter()->restore();-
348 }
never executed: end of block
0
349}
never executed: end of block
0
350-
351-
352-
353-
354-
355-
356void QPaintEngine::drawLines(const QLineF *lines, int lineCount)-
357{-
358 for (int i=0; i<lineCount
i<lineCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
359 QPointF pts[2] = { lines[i].p1(), lines[i].p2() };-
360-
361 if (pts[0] == pts[1]
pts[0] == pts[1]Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
362 if (state->pen().capStyle() != Qt::FlatCap
state->pen().c...!= Qt::FlatCapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
363 drawPoints(pts, 1);
never executed: drawPoints(pts, 1);
0
364 continue;
never executed: continue;
0
365 }-
366-
367 drawPolygon(pts, 2, PolylineMode);-
368 }
never executed: end of block
0
369}
never executed: end of block
0
370void QPaintEngine::drawLines(const QLine *lines, int lineCount)-
371{-
372 struct PointF {-
373 qreal x;-
374 qreal y;-
375 };-
376 struct LineF {-
377 PointF p1;-
378 PointF p2;-
379 };-
380 ((!(sizeof(PointF) == sizeof(QPointF))) ? qt_assert("sizeof(PointF) == sizeof(QPointF)",__FILE__,798) : qt_noop());-
381 ((!(sizeof(LineF) == sizeof(QLineF))) ? qt_assert("sizeof(LineF) == sizeof(QLineF)",__FILE__,799) : qt_noop());-
382 LineF fl[256];-
383 while (lineCount
lineCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
384 int i = 0;-
385 while (i < lineCount
i < lineCountDescription
TRUEnever evaluated
FALSEnever evaluated
&& i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
386 fl[i].p1.x = lines[i].x1();-
387 fl[i].p1.y = lines[i].y1();-
388 fl[i].p2.x = lines[i].x2();-
389 fl[i].p2.y = lines[i].y2();-
390 ++i;-
391 }
never executed: end of block
0
392 drawLines((QLineF *)(void *)fl, i);-
393 lines += i;-
394 lineCount -= i;-
395 }
never executed: end of block
0
396}
never executed: end of block
0
397void QPaintEngine::drawRects(const QRect *rects, int rectCount)-
398{-
399 struct RectF {-
400 qreal x;-
401 qreal y;-
402 qreal w;-
403 qreal h;-
404 };-
405 ((!(sizeof(RectF) == sizeof(QRectF))) ? qt_assert("sizeof(RectF) == sizeof(QRectF)",__FILE__,832) : qt_noop());-
406 RectF fr[256];-
407 while (rectCount
rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
408 int i = 0;-
409 while (i < rectCount
i < rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
&& i < 256
i < 256Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
410 fr[i].x = rects[i].x();-
411 fr[i].y = rects[i].y();-
412 fr[i].w = rects[i].width();-
413 fr[i].h = rects[i].height();-
414 ++i;-
415 }
never executed: end of block
0
416 drawRects((QRectF *)(void *)fr, i);-
417 rects += i;-
418 rectCount -= i;-
419 }
never executed: end of block
0
420}
never executed: end of block
0
421-
422-
423-
424-
425-
426-
427void QPaintEngine::drawRects(const QRectF *rects, int rectCount)-
428{-
429 if (hasFeature(PainterPaths)
hasFeature(PainterPaths)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
430 !state->penNeedsResolving()
!state->penNeedsResolving()Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
431 !state->brushNeedsResolving()
!state->brushNeedsResolving()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
432 for (int i=0; i<rectCount
i<rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
433 QPainterPath path;-
434 path.addRect(rects[i]);-
435 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
436 continue;
never executed: continue;
0
437 drawPath(path);-
438 }
never executed: end of block
0
439 }
never executed: end of block
else {
0
440 for (int i=0; i<rectCount
i<rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
441 QRectF rf = rects[i];-
442 QPointF pts[4] = { QPointF(rf.x(), rf.y()),-
443 QPointF(rf.x() + rf.width(), rf.y()),-
444 QPointF(rf.x() + rf.width(), rf.y() + rf.height()),-
445 QPointF(rf.x(), rf.y() + rf.height()) };-
446 drawPolygon(pts, 4, ConvexMode);-
447 }
never executed: end of block
0
448 }
never executed: end of block
0
449}-
450-
451-
452-
453-
454-
455void QPaintEngine::setPaintDevice(QPaintDevice *device)-
456{-
457 d_func()->pdev = device;-
458}
never executed: end of block
0
459-
460-
461-
462-
463-
464QPaintDevice *QPaintEngine::paintDevice() const-
465{-
466 return
never executed: return d_func()->pdev;
d_func()->pdev;
never executed: return d_func()->pdev;
0
467}-
468QPoint QPaintEngine::coordinateOffset() const-
469{-
470 return
never executed: return QPoint();
QPoint();
never executed: return QPoint();
0
471}-
472void QPaintEngine::setSystemClip(const QRegion &region)-
473{-
474 QPaintEnginePrivate * const d = d_func();-
475 d->systemClip = region;-
476-
477-
478 if (d->hasSystemTransform
d->hasSystemTransformDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->hasSystemViewport
d->hasSystemViewportDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
479 d->transformSystemClip();-
480 d->systemStateChanged();-
481 }
never executed: end of block
0
482}
never executed: end of block
0
483QRegion QPaintEngine::systemClip() const-
484{-
485 return
never executed: return d_func()->systemClip;
d_func()->systemClip;
never executed: return d_func()->systemClip;
0
486}-
487-
488-
489-
490-
491-
492-
493-
494void QPaintEngine::setSystemRect(const QRect &rect)-
495{-
496 if (isActive()
isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
497 QMessageLogger(__FILE__, 954, __PRETTY_FUNCTION__).warning("QPaintEngine::setSystemRect: Should not be changed while engine is active");-
498 return;
never executed: return;
0
499 }-
500 d_func()->systemRect = rect;-
501}
never executed: end of block
0
502-
503-
504-
505-
506-
507-
508-
509QRect QPaintEngine::systemRect() const-
510{-
511 return
never executed: return d_func()->systemRect;
d_func()->systemRect;
never executed: return d_func()->systemRect;
0
512}-
513-
514QPaintEnginePrivate::~QPaintEnginePrivate()-
515{-
516}-
517-
518void QPaintEnginePrivate::drawBoxTextItem(const QPointF &p, const QTextItemInt &ti)-
519{-
520 if (!ti.glyphs.numGlyphs
!ti.glyphs.numGlyphsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
521 return;
never executed: return;
0
522-
523-
524 const int size = qRound(ti.fontEngine->ascent());-
525 QVarLengthArray<QFixedPoint> positions;-
526 QVarLengthArray<glyph_t> glyphs;-
527 QTransform matrix = QTransform::fromTranslate(p.x(), p.y() - size);-
528 ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);-
529 if (glyphs.size() == 0
glyphs.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
530 return;
never executed: return;
0
531-
532 QSize s(size - 3, size - 3);-
533-
534 QPainter *painter = q_func()->state->painter();-
535 painter->save();-
536 painter->setBrush(Qt::NoBrush);-
537 QPen pen = painter->pen();-
538 pen.setWidthF(ti.fontEngine->lineThickness().toReal());-
539 painter->setPen(pen);-
540 for (int k = 0; k < positions.size()
k < positions.size()Description
TRUEnever evaluated
FALSEnever evaluated
; k++)
0
541 painter->drawRect(QRectF(positions[k].toPointF(), s));
never executed: painter->drawRect(QRectF(positions[k].toPointF(), s));
0
542 painter->restore();-
543}
never executed: end of block
0
544-
545-
Switch to Source codePreprocessed file

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