qpaintengine_blitter.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpaintengine_blitter.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5class CapabilitiesToStateMask-
6{-
7public:-
8 CapabilitiesToStateMask(QBlittable::Capabilities capabilities)-
9 : m_capabilities(capabilities)-
10 , fillRectMask(0)-
11 , drawRectMask(0)-
12 , drawPixmapMask(0)-
13 , alphaFillRectMask(0)-
14 , opacityPixmapMask(0)-
15 , capabillitiesState(0)-
16 {-
17 if (capabilities & QBlittable::SolidRectCapability
capabilities &...RectCapabilityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
18 setFillRectMask();
never executed: setFillRectMask();
0
19 if (capabilities & QBlittable::SourcePixmapCapability
capabilities &...xmapCapabilityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
20 setSourcePixmapMask();
never executed: setSourcePixmapMask();
0
21 if (capabilities & QBlittable::SourceOverPixmapCapability
capabilities &...xmapCapabilityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
22 setSourceOverPixmapMask();
never executed: setSourceOverPixmapMask();
0
23 if (capabilities & QBlittable::SourceOverScaledPixmapCapability
capabilities &...xmapCapabilityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
24 setSourceOverScaledPixmapMask();
never executed: setSourceOverScaledPixmapMask();
0
25 if (capabilities & QBlittable::AlphaFillRectCapability
capabilities &...RectCapabilityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
26 setAlphaFillRectMask();
never executed: setAlphaFillRectMask();
0
27 if (capabilities & QBlittable::OpacityPixmapCapability
capabilities &...xmapCapabilityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
28 setOpacityPixmapMask();
never executed: setOpacityPixmapMask();
0
29 }
never executed: end of block
0
30-
31 inline bool canBlitterFillRect() const-
32 {-
33 return
never executed: return checkStateAgainstMask(capabillitiesState, fillRectMask);
checkStateAgainstMask(capabillitiesState, fillRectMask);
never executed: return checkStateAgainstMask(capabillitiesState, fillRectMask);
0
34 }-
35-
36 inline bool canBlitterAlphaFillRect() const-
37 {-
38 return
never executed: return checkStateAgainstMask(capabillitiesState, alphaFillRectMask);
checkStateAgainstMask(capabillitiesState, alphaFillRectMask);
never executed: return checkStateAgainstMask(capabillitiesState, alphaFillRectMask);
0
39 }-
40-
41 inline bool canBlitterDrawRectMask() const-
42 {-
43 return
never executed: return checkStateAgainstMask(capabillitiesState, drawRectMask);
checkStateAgainstMask(capabillitiesState, drawRectMask);
never executed: return checkStateAgainstMask(capabillitiesState, drawRectMask);
0
44 }-
45-
46 bool canBlitterDrawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) const-
47 {-
48 if (pm.handle()->classId() != QPlatformPixmap::BlitterClass
pm.handle()->c...::BlitterClassDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
49 return
never executed: return false;
false;
never executed: return false;
0
50 if (checkStateAgainstMask(capabillitiesState, drawPixmapMask)
checkStateAgai...rawPixmapMask)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
51 if (m_capabilities & (QBlittable::SourceOverPixmapCapability
m_capabilities...mapCapability)Description
TRUEnever evaluated
FALSEnever evaluated
0
52 | QBlittable::SourceOverScaledPixmapCapability)
m_capabilities...mapCapability)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
53 if (r.size() != sr.size()
r.size() != sr.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
54 return
never executed: return m_capabilities & QBlittable::SourceOverScaledPixmapCapability;
m_capabilities & QBlittable::SourceOverScaledPixmapCapability;
never executed: return m_capabilities & QBlittable::SourceOverScaledPixmapCapability;
0
55 else-
56 return
never executed: return m_capabilities & QBlittable::SourceOverPixmapCapability;
m_capabilities & QBlittable::SourceOverPixmapCapability;
never executed: return m_capabilities & QBlittable::SourceOverPixmapCapability;
0
57 }-
58 if ((
(m_capabilitie...mapCapability)Description
TRUEnever evaluated
FALSEnever evaluated
m_capabilities & QBlittable::SourcePixmapCapability)
(m_capabilitie...mapCapability)Description
TRUEnever evaluated
FALSEnever evaluated
&& r.size() == sr.size()
r.size() == sr.size()Description
TRUEnever evaluated
FALSEnever evaluated
&& !pm.hasAlphaChannel()
!pm.hasAlphaChannel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
59 return
never executed: return m_capabilities & QBlittable::SourcePixmapCapability;
m_capabilities & QBlittable::SourcePixmapCapability;
never executed: return m_capabilities & QBlittable::SourcePixmapCapability;
0
60 }
never executed: end of block
0
61 return
never executed: return false;
false;
never executed: return false;
0
62 }-
63-
64 bool canBlitterDrawPixmapOpacity(const QPixmap &pm) const-
65 {-
66 if (pm.handle()->classId() != QPlatformPixmap::BlitterClass
pm.handle()->c...::BlitterClassDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
67 return
never executed: return false;
false;
never executed: return false;
0
68-
69 return
never executed: return checkStateAgainstMask(capabillitiesState, opacityPixmapMask);
checkStateAgainstMask(capabillitiesState, opacityPixmapMask);
never executed: return checkStateAgainstMask(capabillitiesState, opacityPixmapMask);
0
70 }-
71-
72 bool canBlitterDrawCachedGlyphs(const QTransform &transform, QFontEngine::GlyphFormat requestedGlyphFormat, bool complexClip) const-
73 {-
74 if (transform.type() > QTransform::TxScale
transform.type...sform::TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
75 return
never executed: return false;
false;
never executed: return false;
0
76 if (!(m_capabilities & QBlittable::DrawScaledCachedGlyphsCapability)
!(m_capabiliti...phsCapability)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
77 return
never executed: return false;
false;
never executed: return false;
0
78 if (requestedGlyphFormat == QFontEngine::Format_ARGB
requestedGlyph...e::Format_ARGBDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(m_capabilities & QBlittable::SubPixelGlyphsCapability)
!(m_capabiliti...phsCapability)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
79 return
never executed: return false;
false;
never executed: return false;
0
80 if (complexClip
complexClipDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(m_capabilities & QBlittable::ComplexClipCapability)
!(m_capabiliti...lipCapability)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
81 return
never executed: return false;
false;
never executed: return false;
0
82 return
never executed: return true;
true;
never executed: return true;
0
83 }-
84-
85 inline void updateState(uint mask, bool on) {-
86 updateStateBits(&capabillitiesState, mask, on);-
87 }
never executed: end of block
0
88-
89private:-
90-
91 static inline void updateStateBits(uint *state, uint mask, bool on)-
92 {-
93 *state = on
onDescription
TRUEnever evaluated
FALSEnever evaluated
? (*state | mask) : (*state & ~mask);
0
94 }
never executed: end of block
0
95-
96 static inline bool checkStateAgainstMask(uint state, uint mask)-
97 {-
98 return
never executed: return !state || (state & mask && !(state & ~mask));
!state || (state & mask && !(state & ~mask));
never executed: return !state || (state & mask && !(state & ~mask));
0
99 }-
100-
101 void setFillRectMask() {-
102 updateStateBits(&fillRectMask, 0x00000001, false);-
103 updateStateBits(&fillRectMask, 0x00000002, false);-
104-
105 updateStateBits(&fillRectMask, 0x00000010, false);-
106 updateStateBits(&fillRectMask, 0x00000020, false);-
107-
108 updateStateBits(&fillRectMask, 0x00000100, true);-
109-
110-
111 updateStateBits(&fillRectMask, 0x00001000, true);-
112 updateStateBits(&fillRectMask, 0x00002000, false);-
113 updateStateBits(&fillRectMask, 0x00004000, false);-
114-
115 updateStateBits(&fillRectMask, 0x00010000, false);-
116 updateStateBits(&fillRectMask, 0x00020000, false);-
117 }
never executed: end of block
0
118-
119 void setAlphaFillRectMask() {-
120 updateStateBits(&alphaFillRectMask, 0x00000001, false);-
121 updateStateBits(&alphaFillRectMask, 0x00000002, false);-
122-
123 updateStateBits(&alphaFillRectMask, 0x00000010, false);-
124 updateStateBits(&alphaFillRectMask, 0x00000020, true);-
125-
126 updateStateBits(&alphaFillRectMask, 0x00000100, true);-
127-
128-
129 updateStateBits(&alphaFillRectMask, 0x00001000, true);-
130 updateStateBits(&alphaFillRectMask, 0x00002000, false);-
131 updateStateBits(&alphaFillRectMask, 0x00004000, false);-
132-
133 updateStateBits(&alphaFillRectMask, 0x00010000, false);-
134 updateStateBits(&alphaFillRectMask, 0x00020000, false);-
135 }
never executed: end of block
0
136-
137 void setSourcePixmapMask() {-
138 updateStateBits(&drawPixmapMask, 0x00000001, false);-
139 updateStateBits(&drawPixmapMask, 0x00000002, false);-
140-
141 updateStateBits(&drawPixmapMask, 0x00000010, true);-
142 updateStateBits(&drawPixmapMask, 0x00000020, false);-
143-
144 updateStateBits(&drawPixmapMask, 0x00000100, true);-
145-
146 updateStateBits(&drawPixmapMask, 0x00001000, true);-
147 updateStateBits(&drawPixmapMask, 0x00002000, false);-
148 updateStateBits(&drawPixmapMask, 0x00004000, false);-
149-
150 updateStateBits(&drawPixmapMask, 0x00010000, false);-
151 updateStateBits(&drawPixmapMask, 0x00020000, false);-
152 }
never executed: end of block
0
153-
154 void setSourceOverPixmapMask() {-
155 setSourcePixmapMask();-
156 }
never executed: end of block
0
157-
158 void setSourceOverScaledPixmapMask() {-
159 setSourceOverPixmapMask();-
160 updateStateBits(&drawPixmapMask, 0x00000001, true);-
161 }
never executed: end of block
0
162-
163 void setOpacityPixmapMask() {-
164 updateStateBits(&opacityPixmapMask, 0x00000001, true);-
165 updateStateBits(&opacityPixmapMask, 0x00000002, false);-
166-
167 updateStateBits(&opacityPixmapMask, 0x00000010, true);-
168 updateStateBits(&opacityPixmapMask, 0x00000020, true);-
169-
170 updateStateBits(&opacityPixmapMask, 0x00000100, true);-
171-
172 updateStateBits(&opacityPixmapMask, 0x00001000, true);-
173 updateStateBits(&opacityPixmapMask, 0x00002000, true);-
174 updateStateBits(&opacityPixmapMask, 0x00004000, false);-
175-
176 updateStateBits(&opacityPixmapMask, 0x00010000, false);-
177 updateStateBits(&opacityPixmapMask, 0x00020000, false);-
178 }
never executed: end of block
0
179-
180 QBlittable::Capabilities m_capabilities;-
181 uint fillRectMask;-
182 uint drawRectMask;-
183 uint drawPixmapMask;-
184 uint alphaFillRectMask;-
185 uint opacityPixmapMask;-
186 uint capabillitiesState;-
187};-
188-
189class QBlitterPaintEnginePrivate : public QRasterPaintEnginePrivate-
190{-
191 inline QBlitterPaintEngine* q_func() { return static_cast<QBlitterPaintEngine *>(q_ptr); } inline const QBlitterPaintEngine* q_func() const { return static_cast<const QBlitterPaintEngine *>(q_ptr); } friend class QBlitterPaintEngine;-
192public:-
193 QBlitterPaintEnginePrivate(QBlittablePlatformPixmap *p)-
194 : QRasterPaintEnginePrivate()-
195 , pmData(p)-
196 , caps(pmData->blittable()->capabilities())-
197 , hasXForm(false)-
198-
199 {}
never executed: end of block
0
200-
201 void lock();-
202 void unlock();-
203 void fillRect(const QRectF &rect, const QColor &color, bool alpha);-
204 void clipAndDrawPixmap(const QRectF &clip, const QRectF &target, const QPixmap &pm, const QRectF &sr, bool opacity);-
205-
206-
207 void updateCompleteState(QPainterState *s);-
208 void updatePenState(QPainterState *s);-
209 void updateBrushState(QPainterState *s);-
210 void updateOpacityState(QPainterState *s);-
211 void updateCompositionModeState(QPainterState *s);-
212 void updateRenderHintsState(QPainterState *s);-
213 void updateTransformState(QPainterState *s);-
214 void updateClipState(QPainterState *s);-
215-
216 QBlittablePlatformPixmap *pmData;-
217 CapabilitiesToStateMask caps;-
218 uint hasXForm;-
219};-
220-
221-
222inline void QBlitterPaintEnginePrivate::lock()-
223{-
224 if (!pmData->blittable()->isLocked()
!pmData->blitt...()->isLocked()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
225 rasterBuffer->prepare(pmData->buffer());
never executed: rasterBuffer->prepare(pmData->buffer());
0
226}
never executed: end of block
0
227-
228inline void QBlitterPaintEnginePrivate::unlock()-
229{-
230 pmData->blittable()->unlock();-
231}
never executed: end of block
0
232-
233-
234void QBlitterPaintEnginePrivate::updateCompleteState(QPainterState *s)-
235{-
236 updatePenState(s);-
237 updateBrushState(s);-
238 updateOpacityState(s);-
239 updateCompositionModeState(s);-
240 updateRenderHintsState(s);-
241 updateTransformState(s);-
242 updateClipState(s);-
243}
never executed: end of block
0
244-
245void QBlitterPaintEnginePrivate::updatePenState(QPainterState *s)-
246{-
247 caps.updateState(0x00000100, qpen_style(s->pen) != Qt::NoPen);-
248}
never executed: end of block
0
249-
250void QBlitterPaintEnginePrivate::updateBrushState(QPainterState *s)-
251{-
252 Qt::BrushStyle style = qbrush_style(s->brush);-
253-
254 caps.updateState(0x00000010, style > Qt::SolidPattern);-
255 caps.updateState(0x00000020,-
256 qbrush_color(s->brush).alpha() < 255);-
257}
never executed: end of block
0
258-
259void QBlitterPaintEnginePrivate::updateOpacityState(QPainterState *s)-
260{-
261 bool translucent = s->opacity < 1;-
262 caps.updateState(0x00002000, translucent);-
263}
never executed: end of block
0
264-
265void QBlitterPaintEnginePrivate::updateCompositionModeState(QPainterState *s)-
266{-
267 bool nonTrivial = s->composition_mode != QPainter::CompositionMode_SourceOver
s->composition...ode_SourceOverDescription
TRUEnever evaluated
FALSEnever evaluated
0
268 && s->composition_mode != QPainter::CompositionMode_Source
s->composition...ionMode_SourceDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
269-
270 caps.updateState(0x00004000, nonTrivial);-
271}
never executed: end of block
0
272-
273void QBlitterPaintEnginePrivate::updateRenderHintsState(QPainterState *s)-
274{-
275 bool aa = s->renderHints & QPainter::Antialiasing;-
276 caps.updateState(0x00001000, aa);-
277}
never executed: end of block
0
278-
279void QBlitterPaintEnginePrivate::updateTransformState(QPainterState *s)-
280{-
281 QTransform::TransformationType type = s->matrix.type();-
282-
283-
284-
285-
286 caps.updateState(0x00000002, (type > QTransform::TxScale) ||-
287 ((type == QTransform::TxScale) && ((s->matrix.m11() < 0.0) || (s->matrix.m22() < 0.0))));-
288 caps.updateState(0x00000001, type > QTransform::TxTranslate);-
289-
290 hasXForm = type >= QTransform::TxTranslate;-
291}
never executed: end of block
0
292-
293void QBlitterPaintEnginePrivate::updateClipState(QPainterState *)-
294{-
295 const QClipData *clipData = clip();-
296 bool complexClip = clipData
clipDataDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(clipData->hasRectClip
clipData->hasRectClipDescription
TRUEnever evaluated
FALSEnever evaluated
|| clipData->hasRegionClip
clipData->hasRegionClipDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
297 caps.updateState(0x00020000, complexClip);-
298}
never executed: end of block
0
299-
300void QBlitterPaintEnginePrivate::fillRect(const QRectF &rect, const QColor &color, bool alpha)-
301{-
302 QBlitterPaintEngine * const q = q_func();-
303 pmData->unmarkRasterOverlay(rect);-
304 QRectF targetRect = rect;-
305 if (hasXForm
hasXFormDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
306 targetRect = q->state()->matrix.mapRect(rect);
never executed: targetRect = q->state()->matrix.mapRect(rect);
0
307 const QClipData *clipData = clip();-
308 if (clipData
clipDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
309 if (clipData->hasRectClip
clipData->hasRectClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
310 unlock();-
311 if (alpha
alphaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
312 pmData->blittable()->alphaFillRect(targetRect & clipData->clipRect, color, q->state()->compositionMode());
never executed: pmData->blittable()->alphaFillRect(targetRect & clipData->clipRect, color, q->state()->compositionMode());
0
313 else-
314 pmData->blittable()->fillRect(targetRect & clipData->clipRect, color);
never executed: pmData->blittable()->fillRect(targetRect & clipData->clipRect, color);
0
315 } else if (clipData->hasRegionClip
clipData->hasRegionClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
316 QVector<QRect> rects = clipData->clipRegion.rects();-
317 for (int i = 0; i < rects.size()
i < rects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
318 QRect intersectRect = rects.at(i).intersected(targetRect.toRect());-
319 if (!intersectRect.isEmpty()
!intersectRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
320 unlock();-
321 if (alpha
alphaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
322 pmData->blittable()->alphaFillRect(intersectRect, color, q->state()->compositionMode());
never executed: pmData->blittable()->alphaFillRect(intersectRect, color, q->state()->compositionMode());
0
323 else-
324 pmData->blittable()->fillRect(intersectRect, color);
never executed: pmData->blittable()->fillRect(intersectRect, color);
0
325 }-
326 }
never executed: end of block
0
327 }
never executed: end of block
0
328 }
never executed: end of block
else {
0
329 if (targetRect.x() >= 0
targetRect.x() >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& targetRect.y() >= 0
targetRect.y() >= 0Description
TRUEnever evaluated
FALSEnever evaluated
0
330 && targetRect.width() <= q->paintDevice()->width()
targetRect.wid...ice()->width()Description
TRUEnever evaluated
FALSEnever evaluated
0
331 && targetRect.height() <= q->paintDevice()->height()
targetRect.hei...ce()->height()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
332 unlock();-
333 if (alpha
alphaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
334 pmData->blittable()->alphaFillRect(targetRect, color, q->state()->compositionMode());
never executed: pmData->blittable()->alphaFillRect(targetRect, color, q->state()->compositionMode());
0
335 else-
336 pmData->blittable()->fillRect(targetRect, color);
never executed: pmData->blittable()->fillRect(targetRect, color);
0
337 } else {-
338 QRectF deviceRect(0, 0, q->paintDevice()->width(), q->paintDevice()->height());-
339 unlock();-
340 if (alpha
alphaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
341 pmData->blittable()->alphaFillRect(deviceRect & targetRect, color, q->state()->compositionMode());
never executed: pmData->blittable()->alphaFillRect(deviceRect & targetRect, color, q->state()->compositionMode());
0
342 else-
343 pmData->blittable()->fillRect(deviceRect & targetRect, color);
never executed: pmData->blittable()->fillRect(deviceRect & targetRect, color);
0
344 }-
345 }-
346}-
347-
348void QBlitterPaintEnginePrivate::clipAndDrawPixmap(const QRectF &clip,-
349 const QRectF &target,-
350 const QPixmap &pm,-
351 const QRectF &sr,-
352 bool opacity)-
353{-
354 QBlitterPaintEngine * const q = q_func();-
355 QRectF intersectedRect = clip.intersected(target);-
356 if (intersectedRect.isEmpty()
intersectedRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
357 return;
never executed: return;
0
358 QRectF source = sr;-
359 if (intersectedRect.size() != target.size()
intersectedRec... target.size()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
360 if (sr.size() == target.size()
sr.size() == target.size()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
361-
362 qreal deltaTop = target.top() - intersectedRect.top();-
363 qreal deltaLeft = target.left() - intersectedRect.left();-
364 qreal deltaBottom = target.bottom() - intersectedRect.bottom();-
365 qreal deltaRight = target.right() - intersectedRect.right();-
366 source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom);-
367 }
never executed: end of block
else {
0
368-
369 qreal hFactor = sr.size().width() / target.size().width();-
370 qreal vFactor = sr.size().height() / target.size().height();-
371 qreal deltaTop = (target.top() - intersectedRect.top()) * vFactor;-
372 qreal deltaLeft = (target.left() - intersectedRect.left()) * hFactor;-
373 qreal deltaBottom = (target.bottom() - intersectedRect.bottom()) * vFactor;-
374 qreal deltaRight = (target.right() - intersectedRect.right()) * hFactor;-
375 source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom);-
376 }
never executed: end of block
0
377 }-
378 pmData->unmarkRasterOverlay(intersectedRect);-
379 if (opacity
opacityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
380 pmData->blittable()->drawPixmapOpacity(intersectedRect, pm, source, q->state()->compositionMode(), q->state()->opacity);
never executed: pmData->blittable()->drawPixmapOpacity(intersectedRect, pm, source, q->state()->compositionMode(), q->state()->opacity);
0
381 else-
382 pmData->blittable()->drawPixmap(intersectedRect, pm, source);
never executed: pmData->blittable()->drawPixmap(intersectedRect, pm, source);
0
383}-
384-
385QBlitterPaintEngine::QBlitterPaintEngine(QBlittablePlatformPixmap *p)-
386 : QRasterPaintEngine(*(new QBlitterPaintEnginePrivate(p)), p->buffer())-
387{}
never executed: end of block
0
388-
389-
390void QBlitterPaintEngine::penChanged()-
391{-
392 QBlitterPaintEnginePrivate * const d = d_func();-
393-
394 QRasterPaintEngine::penChanged();-
395 d->updatePenState(state());-
396}
never executed: end of block
0
397-
398void QBlitterPaintEngine::brushChanged()-
399{-
400 QBlitterPaintEnginePrivate * const d = d_func();-
401-
402 QRasterPaintEngine::brushChanged();-
403 d->updateBrushState(state());-
404}
never executed: end of block
0
405-
406void QBlitterPaintEngine::opacityChanged()-
407{-
408 QBlitterPaintEnginePrivate * const d = d_func();-
409-
410 QRasterPaintEngine::opacityChanged();-
411 d->updateOpacityState(state());-
412}
never executed: end of block
0
413-
414void QBlitterPaintEngine::compositionModeChanged()-
415{-
416 QBlitterPaintEnginePrivate * const d = d_func();-
417-
418 QRasterPaintEngine::compositionModeChanged();-
419 d->updateCompositionModeState(state());-
420}
never executed: end of block
0
421-
422void QBlitterPaintEngine::renderHintsChanged()-
423{-
424 QBlitterPaintEnginePrivate * const d = d_func();-
425-
426 QRasterPaintEngine::renderHintsChanged();-
427 d->updateRenderHintsState(state());-
428}
never executed: end of block
0
429-
430void QBlitterPaintEngine::transformChanged()-
431{-
432 QBlitterPaintEnginePrivate * const d = d_func();-
433-
434 QRasterPaintEngine::transformChanged();-
435 d->updateTransformState(state());-
436}
never executed: end of block
0
437-
438void QBlitterPaintEngine::clipEnabledChanged()-
439{-
440 QBlitterPaintEnginePrivate * const d = d_func();-
441 QRasterPaintEngine::clipEnabledChanged();-
442 d->updateClipState(state());-
443}
never executed: end of block
0
444-
445bool QBlitterPaintEngine::begin(QPaintDevice *pdev)-
446{-
447 QBlitterPaintEnginePrivate * const d = d_func();-
448 bool ok = QRasterPaintEngine::begin(pdev);-
449-
450-
451-
452 d->pdev = pdev;-
453 return
never executed: return ok;
ok;
never executed: return ok;
0
454}-
455-
456bool QBlitterPaintEngine::end()-
457{-
458-
459-
460-
461-
462-
463 return
never executed: return QRasterPaintEngine::end();
QRasterPaintEngine::end();
never executed: return QRasterPaintEngine::end();
0
464}-
465-
466void QBlitterPaintEngine::setState(QPainterState *s)-
467{-
468 QBlitterPaintEnginePrivate * const d = d_func();-
469-
470 QRasterPaintEngine::setState(s);-
471 d->updateCompleteState(s);-
472}
never executed: end of block
0
473-
474-
475void QBlitterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)-
476{-
477 QBlitterPaintEnginePrivate * const d = d_func();-
478 if (path.shape() == QVectorPath::RectangleHint
path.shape() =...:RectangleHintDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
479 QRectF rect(((const QPointF *) path.points())[0], ((const QPointF *) path.points())[2]);-
480 fillRect(rect, brush);-
481 }
never executed: end of block
else {
0
482 d->lock();-
483 d->pmData->markRasterOverlay(path);-
484 QRasterPaintEngine::fill(path, brush);-
485 }
never executed: end of block
0
486}-
487-
488void QBlitterPaintEngine::fillRect(const QRectF &rect, const QColor &color)-
489{-
490 QBlitterPaintEnginePrivate * const d = d_func();-
491 if (d->caps.canBlitterAlphaFillRect()
d->caps.canBli...lphaFillRect()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
492 d->fillRect(rect, color, true);-
493 }
never executed: end of block
else if (d->caps.canBlitterFillRect()
d->caps.canBlitterFillRect()Description
TRUEnever evaluated
FALSEnever evaluated
&& color.alpha() == 0xff
color.alpha() == 0xffDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
494 d->fillRect(rect, color, false);-
495 }
never executed: end of block
else {
0
496 d->lock();-
497 d->pmData->markRasterOverlay(rect);-
498 QRasterPaintEngine::fillRect(rect, color);-
499 }
never executed: end of block
0
500}-
501-
502void QBlitterPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)-
503{-
504 if (rect.size().isEmpty()
rect.size().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
505 return;
never executed: return;
0
506-
507 QBlitterPaintEnginePrivate * const d = d_func();-
508-
509 if (qbrush_style(brush) == Qt::SolidPattern
qbrush_style(b...::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
0
510 && d->caps.canBlitterAlphaFillRect()
d->caps.canBli...lphaFillRect()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
511 d->fillRect(rect, qbrush_color(brush), true);-
512 }
never executed: end of block
else if (qbrush_style(brush) == Qt::SolidPattern
qbrush_style(b...::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
0
513 && qbrush_color(brush).alpha() == 0xff
qbrush_color(b...lpha() == 0xffDescription
TRUEnever evaluated
FALSEnever evaluated
0
514 && d->caps.canBlitterFillRect()
d->caps.canBlitterFillRect()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
515 d->fillRect(rect, qbrush_color(brush), false);-
516 }
never executed: end of block
else if ((
(brush.style()...exturePattern)Description
TRUEnever evaluated
FALSEnever evaluated
brush.style() == Qt::TexturePattern)
(brush.style()...exturePattern)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
517 (
(brush.transfo...::TxTranslate)Description
TRUEnever evaluated
FALSEnever evaluated
brush.transform().type() <= QTransform::TxTranslate)
(brush.transfo...::TxTranslate)Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
518 ((
(d->caps.canBl...sh.texture()))Description
TRUEnever evaluated
FALSEnever evaluated
d->caps.canBlitterDrawPixmapOpacity(brush.texture()))
(d->caps.canBl...sh.texture()))Description
TRUEnever evaluated
FALSEnever evaluated
||
0
519 (
(d->caps.canBl...ture(), rect))Description
TRUEnever evaluated
FALSEnever evaluated
d->caps.canBlitterDrawPixmap(rect, brush.texture(), rect))
(d->caps.canBl...ture(), rect))Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
520 bool rectIsFilled = false;-
521 QRectF transformedRect = state()->matrix.mapRect(rect);-
522 qreal x = transformedRect.x();-
523 qreal y = transformedRect.y();-
524 QPixmap pm = brush.texture();-
525 d->unlock();-
526 int srcX = int(rect.x() - state()->brushOrigin.x() - brush.transform().dx()) % pm.width();-
527 if (srcX < 0
srcX < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
528 srcX = pm.width() + srcX;
never executed: srcX = pm.width() + srcX;
0
529 const int startX = srcX;-
530 int srcY = int(rect.y() - state()->brushOrigin.y() - brush.transform().dy()) % pm.height();-
531 if (srcY < 0
srcY < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
532 srcY = pm.height() + srcY;
never executed: srcY = pm.height() + srcY;
0
533 while (!rectIsFilled
!rectIsFilledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
534 qreal blitWidth = (pm.width() ) - srcX;-
535 qreal blitHeight = (pm.height() ) - srcY;-
536 if (x + blitWidth > transformedRect.right()
x + blitWidth ...edRect.right()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
537 blitWidth = transformedRect.right() -x;
never executed: blitWidth = transformedRect.right() -x;
0
538 if (y + blitHeight > transformedRect.bottom()
y + blitHeight...dRect.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
539 blitHeight = transformedRect.bottom() - y;
never executed: blitHeight = transformedRect.bottom() - y;
0
540 const QClipData *clipData = d->clip();-
541 if (clipData->hasRectClip
clipData->hasRectClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
542 QRect targetRect = QRect(x, y, blitWidth, blitHeight).intersected(clipData->clipRect);-
543 if (targetRect.isValid()
targetRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
544 int tmpSrcX = srcX + (targetRect.x() - x);-
545 int tmpSrcY = srcY + (targetRect.y() - y);-
546 QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height());-
547 d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect);-
548 }
never executed: end of block
0
549 }
never executed: end of block
else if (clipData->hasRegionClip
clipData->hasRegionClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
550 QRect unclippedTargetRect(x, y, blitWidth, blitHeight);-
551 const QVector<QRect> intersectedRects = clipData->clipRegion.intersected(unclippedTargetRect).rects();-
552 const int intersectedSize = intersectedRects.size();-
553 for (int i = 0; i < intersectedSize
i < intersectedSizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
554 const QRect &targetRect = intersectedRects.at(i);-
555 if (!targetRect.isValid()
!targetRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| targetRect.isEmpty()
targetRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
556 continue;
never executed: continue;
0
557 int tmpSrcX = srcX + (targetRect.x() - x);-
558 int tmpSrcY = srcY + (targetRect.y() - y);-
559 QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height());-
560 d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect);-
561 }
never executed: end of block
0
562 }
never executed: end of block
0
563 x+=blitWidth;-
564 if (qFuzzyCompare(x, transformedRect.right())
qFuzzyCompare(...dRect.right())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
565 x = transformedRect.x();-
566 srcX = startX;-
567 srcY = 0;-
568 y += blitHeight;-
569 if (qFuzzyCompare(y, transformedRect.bottom())
qFuzzyCompare(...Rect.bottom())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
570 rectIsFilled = true;
never executed: rectIsFilled = true;
0
571 }
never executed: end of block
else
0
572 srcX = 0;
never executed: srcX = 0;
0
573 }-
574 }
never executed: end of block
else {
0
575 d->lock();-
576 d->pmData->markRasterOverlay(rect);-
577 QRasterPaintEngine::fillRect(rect, brush);-
578 }
never executed: end of block
0
579-
580}-
581-
582void QBlitterPaintEngine::drawRects(const QRect *rects, int rectCount)-
583{-
584 QBlitterPaintEnginePrivate * const d = d_func();-
585 if (d->caps.canBlitterDrawRectMask()
d->caps.canBli...DrawRectMask()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
586 for (int i=0; i<rectCount
i<rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
587 d->fillRect(rects[i], qbrush_color(state()->brush), false);
never executed: d->fillRect(rects[i], qbrush_color(state()->brush), false);
0
588 }
never executed: end of block
else {
0
589 d->pmData->markRasterOverlay(rects, rectCount);-
590 QRasterPaintEngine::drawRects(rects, rectCount);-
591 }
never executed: end of block
0
592}-
593-
594void QBlitterPaintEngine::drawRects(const QRectF *rects, int rectCount)-
595{-
596 QBlitterPaintEnginePrivate * const d = d_func();-
597 if (d->caps.canBlitterDrawRectMask()
d->caps.canBli...DrawRectMask()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
598 for (int i = 0; i < rectCount
i < rectCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
599 d->fillRect(rects[i], qbrush_color(state()->brush), false);
never executed: d->fillRect(rects[i], qbrush_color(state()->brush), false);
0
600 }
never executed: end of block
else {
0
601 d->pmData->markRasterOverlay(rects, rectCount);-
602 QRasterPaintEngine::drawRects(rects, rectCount);-
603 }
never executed: end of block
0
604}-
605-
606void QBlitterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)-
607{-
608 drawPixmap(QRectF(pos, pm.size()), pm, pm.rect());-
609}
never executed: end of block
0
610-
611void QBlitterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)-
612{-
613 QBlitterPaintEnginePrivate * const d = d_func();-
614 bool canDrawOpacity;-
615-
616 canDrawOpacity = d->caps.canBlitterDrawPixmapOpacity(pm);-
617 if (canDrawOpacity
canDrawOpacityDescription
TRUEnever evaluated
FALSEnever evaluated
|| (
(d->caps.canBl...ap(r, pm, sr))Description
TRUEnever evaluated
FALSEnever evaluated
d->caps.canBlitterDrawPixmap(r, pm, sr))
(d->caps.canBl...ap(r, pm, sr))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
618-
619 d->unlock();-
620 QRectF targetRect = r;-
621 if (d->hasXForm
d->hasXFormDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
622 targetRect = state()->matrix.mapRect(r);
never executed: targetRect = state()->matrix.mapRect(r);
0
623 const QClipData *clipData = d->clip();-
624 if (clipData
clipDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
625 if (clipData->hasRectClip
clipData->hasRectClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
626 d->clipAndDrawPixmap(clipData->clipRect, targetRect, pm, sr, canDrawOpacity);-
627 }
never executed: end of block
else if (clipData->hasRegionClip
clipData->hasRegionClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
628 QVector<QRect>rects = clipData->clipRegion.rects();-
629 for (int i = 0; i<rects.size()
i<rects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
630 d->clipAndDrawPixmap(rects.at(i), targetRect, pm, sr, canDrawOpacity);
never executed: d->clipAndDrawPixmap(rects.at(i), targetRect, pm, sr, canDrawOpacity);
0
631 }
never executed: end of block
0
632 }
never executed: end of block
else {
0
633 QRectF deviceRect(0, 0, paintDevice()->width(), paintDevice()->height());-
634 d->clipAndDrawPixmap(deviceRect, targetRect, pm, sr, canDrawOpacity);-
635 }
never executed: end of block
0
636 }else {-
637 d->lock();-
638 d->pmData->markRasterOverlay(r);-
639 QRasterPaintEngine::drawPixmap(r, pm, sr);-
640 }
never executed: end of block
0
641}-
642-
643-
644void QBlitterPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)-
645{-
646 QBlitterPaintEnginePrivate * const d = d_func();-
647 d->lock();-
648 d->pmData->markRasterOverlay(points, pointCount);-
649 QRasterPaintEngine::drawPolygon(points, pointCount, mode);-
650}
never executed: end of block
0
651-
652void QBlitterPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode)-
653{-
654 QBlitterPaintEnginePrivate * const d = d_func();-
655 d->lock();-
656 d->pmData->markRasterOverlay(points, pointCount);-
657 QRasterPaintEngine::drawPolygon(points, pointCount, mode);-
658}
never executed: end of block
0
659-
660void QBlitterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData)-
661{-
662 QBlitterPaintEnginePrivate * const d = d_func();-
663 d->lock();-
664 d->pmData->markRasterOverlay(path);-
665 QRasterPaintEngine::fillPath(path, fillData);-
666}
never executed: end of block
0
667-
668void QBlitterPaintEngine::fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode)-
669{-
670 QBlitterPaintEnginePrivate * const d = d_func();-
671 d->lock();-
672 d->pmData->markRasterOverlay(points, pointCount);-
673 QRasterPaintEngine::fillPolygon(points, pointCount, mode);-
674}
never executed: end of block
0
675-
676void QBlitterPaintEngine::drawEllipse(const QRectF &r)-
677{-
678 QBlitterPaintEnginePrivate * const d = d_func();-
679 d->lock();-
680 d->pmData->markRasterOverlay(r);-
681 QRasterPaintEngine::drawEllipse(r);-
682}
never executed: end of block
0
683-
684void QBlitterPaintEngine::drawImage(const QPointF &pos, const QImage &image)-
685{-
686 drawImage(QRectF(pos, image.size()), image, image.rect());-
687}
never executed: end of block
0
688-
689void QBlitterPaintEngine::drawImage(const QRectF &r, const QImage &pm, const QRectF &sr,-
690 Qt::ImageConversionFlags flags)-
691{-
692 QBlitterPaintEnginePrivate * const d = d_func();-
693 d->lock();-
694 d->pmData->markRasterOverlay(r);-
695 QRasterPaintEngine::drawImage(r, pm, sr, flags);-
696}
never executed: end of block
0
697-
698void QBlitterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)-
699{-
700 QBlitterPaintEnginePrivate * const d = d_func();-
701 d->lock();-
702 d->pmData->markRasterOverlay(r);-
703 QRasterPaintEngine::drawTiledPixmap(r, pm, sr);-
704}
never executed: end of block
0
705-
706void QBlitterPaintEngine::drawTextItem(const QPointF &pos, const QTextItem &ti)-
707{-
708 QBlitterPaintEnginePrivate * const d = d_func();-
709 d->lock();-
710 d->pmData->markRasterOverlay(pos, ti);-
711 QRasterPaintEngine::drawTextItem(pos, ti);-
712}
never executed: end of block
0
713-
714void QBlitterPaintEngine::drawPoints(const QPointF *points, int pointCount)-
715{-
716 QBlitterPaintEnginePrivate * const d = d_func();-
717 d->lock();-
718 d->pmData->markRasterOverlay(points, pointCount);-
719 QRasterPaintEngine::drawPoints(points, pointCount);-
720}
never executed: end of block
0
721-
722void QBlitterPaintEngine::drawPoints(const QPoint *points, int pointCount)-
723{-
724 QBlitterPaintEnginePrivate * const d = d_func();-
725 d->lock();-
726 d->pmData->markRasterOverlay(points, pointCount);-
727 QRasterPaintEngine::drawPoints(points, pointCount);-
728}
never executed: end of block
0
729-
730void QBlitterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)-
731{-
732 QBlitterPaintEnginePrivate * const d = d_func();-
733 d->lock();-
734 d->pmData->markRasterOverlay(path);-
735 QRasterPaintEngine::stroke(path, pen);-
736}
never executed: end of block
0
737-
738void QBlitterPaintEngine::drawStaticTextItem(QStaticTextItem *sti)-
739{-
740 QBlitterPaintEnginePrivate * const d = d_func();-
741 d->lock();-
742 QRasterPaintEngine::drawStaticTextItem(sti);-
743-
744-
745-
746-
747-
748}
never executed: end of block
0
749-
750bool QBlitterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions, QFontEngine *fontEngine)-
751{-
752 QBlitterPaintEnginePrivate * const d = d_func();-
753 QFontEngine::GlyphFormat glyphFormat = d->glyphCacheFormat;-
754 if (fontEngine->glyphFormat != QFontEngine::Format_None
fontEngine->gl...e::Format_NoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
755 glyphFormat = fontEngine->glyphFormat;
never executed: glyphFormat = fontEngine->glyphFormat;
0
756-
757 const QClipData *clipData = d->clip();-
758 const bool complexClip = clipData
clipDataDescription
TRUEnever evaluated
FALSEnever evaluated
&& !clipData->hasRectClip
!clipData->hasRectClipDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
759-
760 const QPainterState *s = state();-
761 if (d->caps.canBlitterDrawCachedGlyphs(s->transform(), glyphFormat, complexClip)
d->caps.canBli..., complexClip)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
762 d->unlock();-
763 const bool result = d->pmData->blittable()->drawCachedGlyphs(s, glyphFormat, numGlyphs, glyphs, positions, fontEngine);-
764-
765 d->lock();-
766 return
never executed: return result;
result;
never executed: return result;
0
767 } else {-
768 return
never executed: return QRasterPaintEngine::drawCachedGlyphs(numGlyphs, glyphs, positions, fontEngine);
QRasterPaintEngine::drawCachedGlyphs(numGlyphs, glyphs, positions, fontEngine);
never executed: return QRasterPaintEngine::drawCachedGlyphs(numGlyphs, glyphs, positions, fontEngine);
0
769 }-
770}-
771-
772-
Switch to Source codePreprocessed file

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