Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | QGraphicsEffectPrivate::~QGraphicsEffectPrivate() | - |
8 | { | - |
9 | } | - |
10 | QGraphicsEffectSource::QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent) | - |
11 | : QObject(dd, parent) | - |
12 | {} | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | QGraphicsEffectSource::~QGraphicsEffectSource() | - |
18 | {} | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | QRectF QGraphicsEffectSource::boundingRect(Qt::CoordinateSystem system) const | - |
26 | { | - |
27 | return d_func()->boundingRect(system); | - |
28 | } | - |
29 | QRectF QGraphicsEffect::sourceBoundingRect(Qt::CoordinateSystem system) const | - |
30 | { | - |
31 | const QGraphicsEffectPrivate * const d = d_func(); | - |
32 | if (d->source) | - |
33 | return d->source->boundingRect(system); | - |
34 | return QRectF(); | - |
35 | } | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | const QGraphicsItem *QGraphicsEffectSource::graphicsItem() const | - |
44 | { | - |
45 | return d_func()->graphicsItem(); | - |
46 | } | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | const QWidget *QGraphicsEffectSource::widget() const | - |
55 | { | - |
56 | return d_func()->widget(); | - |
57 | } | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | const QStyleOption *QGraphicsEffectSource::styleOption() const | - |
66 | { | - |
67 | return d_func()->styleOption(); | - |
68 | } | - |
69 | void QGraphicsEffectSource::draw(QPainter *painter) | - |
70 | { | - |
71 | const QGraphicsEffectSourcePrivate * const d = d_func(); | - |
72 | | - |
73 | QPixmap pm; | - |
74 | if (QPixmapCache::find(d->m_cacheKey, &pm)) { | - |
75 | QTransform restoreTransform; | - |
76 | if (d->m_cachedSystem == Qt::DeviceCoordinates) { | - |
77 | restoreTransform = painter->worldTransform(); | - |
78 | painter->setWorldTransform(QTransform()); | - |
79 | } | - |
80 | | - |
81 | painter->drawPixmap(d->m_cachedOffset, pm); | - |
82 | | - |
83 | if (d->m_cachedSystem == Qt::DeviceCoordinates) | - |
84 | painter->setWorldTransform(restoreTransform); | - |
85 | } else { | - |
86 | d_func()->draw(painter); | - |
87 | } | - |
88 | } | - |
89 | void QGraphicsEffect::drawSource(QPainter *painter) | - |
90 | { | - |
91 | const QGraphicsEffectPrivate * const d = d_func(); | - |
92 | if (d->source) | - |
93 | d->source->draw(painter); | - |
94 | } | - |
95 | void QGraphicsEffectSource::update() | - |
96 | { | - |
97 | d_func()->update(); | - |
98 | } | - |
99 | bool QGraphicsEffectSource::isPixmap() const | - |
100 | { | - |
101 | return d_func()->isPixmap(); | - |
102 | } | - |
103 | bool QGraphicsEffect::sourceIsPixmap() const | - |
104 | { | - |
105 | return source() ? source()->isPixmap() : false; | - |
106 | } | - |
107 | QPixmap QGraphicsEffectSource::pixmap(Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const | - |
108 | { | - |
109 | const QGraphicsEffectSourcePrivate * const d = d_func(); | - |
110 | | - |
111 | | - |
112 | const QGraphicsItem *item = graphicsItem(); | - |
113 | if (system == Qt::LogicalCoordinatesTRUE | never evaluated | FALSE | never evaluated |
&& mode == QGraphicsEffect::NoPadTRUE | never evaluated | FALSE | never evaluated |
&& itemTRUE | never evaluated | FALSE | never evaluated |
&& isPixmap()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
114 | const QGraphicsPixmapItem *pixmapItem = static_cast<const QGraphicsPixmapItem *>(item); | - |
115 | if (offsetTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
116 | * never executed: *offset = pixmapItem->offset().toPoint(); offset = pixmapItem->offset().toPoint();never executed: *offset = pixmapItem->offset().toPoint(); | 0 |
117 | return never executed: return pixmapItem->pixmap(); pixmapItem->pixmap();never executed: return pixmapItem->pixmap(); | 0 |
118 | } | - |
119 | | - |
120 | if (__builtin_expect(!!(TRUE | never evaluated | FALSE | never evaluated |
system == Qt::DeviceCoordinates && item && !static_cast<const QGraphicsItemEffectSourcePrivate *>(d_func())->info), false)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
121 | ) { | - |
122 | QMessageLogger(__FILE__, 321327, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context"); | - |
123 | return never executed: return QPixmap(); QPixmap();never executed: return QPixmap(); | 0 |
124 | } | - |
125 | | - |
126 | QPixmap pm; | - |
127 | if (itemTRUE | never evaluated | FALSE | never evaluated |
&& d->m_cachedSystem == systemTRUE | never evaluated | FALSE | never evaluated |
&& d->m_cachedMode == modeTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
128 | QPixmapCache::find(d->m_cacheKey, &pm); never executed: QPixmapCache::find(d->m_cacheKey, &pm); | 0 |
129 | | - |
130 | if (pm.isNull()TRUE | never evaluated | FALSE | never evaluated |
) { | 0 |
131 | pm = d->pixmap(system, &d->m_cachedOffset, mode); | - |
132 | d->m_cachedSystem = system; | - |
133 | d->m_cachedMode = mode; | - |
134 | | - |
135 | d->invalidateCache(); | - |
136 | d->m_cacheKey = QPixmapCache::insert(pm); | - |
137 | } never executed: end of block | 0 |
138 | | - |
139 | if (offsetTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
140 | * never executed: *offset = d->m_cachedOffset; offset = d->m_cachedOffset;never executed: *offset = d->m_cachedOffset; | 0 |
141 | | - |
142 | return never executed: return pm; pm;never executed: return pm; | 0 |
143 | } | - |
144 | QPixmap QGraphicsEffect::sourcePixmap(Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const | - |
145 | { | - |
146 | const QGraphicsEffectPrivate * const d = d_func(); | - |
147 | if (d->source) | - |
148 | return d->source->pixmap(system, offset, mode); | - |
149 | return QPixmap(); | - |
150 | } | - |
151 | | - |
152 | QGraphicsEffectSourcePrivate::~QGraphicsEffectSourcePrivate() | - |
153 | { | - |
154 | invalidateCache(); | - |
155 | } | - |
156 | | - |
157 | void QGraphicsEffectSourcePrivate::setCachedOffset(const QPoint &offset) | - |
158 | { | - |
159 | m_cachedOffset = offset; | - |
160 | } | - |
161 | | - |
162 | void QGraphicsEffectSourcePrivate::invalidateCache(InvalidateReason reason) const | - |
163 | { | - |
164 | if (m_cachedMode != QGraphicsEffect::PadToEffectiveBoundingRect | - |
165 | && (reason == EffectRectChanged | - |
166 | || (reason == TransformChanged && m_cachedSystem == Qt::LogicalCoordinates))) { | - |
167 | return; | - |
168 | } | - |
169 | | - |
170 | QPixmapCache::remove(m_cacheKey); | - |
171 | } | - |
172 | | - |
173 | | - |
174 | | - |
175 | | - |
176 | | - |
177 | QGraphicsEffect::QGraphicsEffect(QObject *parent) | - |
178 | : QObject(*new QGraphicsEffectPrivate, parent) | - |
179 | { | - |
180 | } | - |
181 | | - |
182 | | - |
183 | | - |
184 | | - |
185 | QGraphicsEffect::QGraphicsEffect(QGraphicsEffectPrivate &dd, QObject *parent) | - |
186 | : QObject(dd, parent) | - |
187 | { | - |
188 | } | - |
189 | | - |
190 | | - |
191 | | - |
192 | | - |
193 | QGraphicsEffect::~QGraphicsEffect() | - |
194 | { | - |
195 | QGraphicsEffectPrivate * const d = d_func(); | - |
196 | d->setGraphicsEffectSource(0); | - |
197 | } | - |
198 | QRectF QGraphicsEffect::boundingRect() const | - |
199 | { | - |
200 | const QGraphicsEffectPrivate * const d = d_func(); | - |
201 | if (d->source) | - |
202 | return boundingRectFor(d->source->boundingRect()); | - |
203 | return QRectF(); | - |
204 | } | - |
205 | QRectF QGraphicsEffect::boundingRectFor(const QRectF &rect) const | - |
206 | { | - |
207 | return rect; | - |
208 | } | - |
209 | bool QGraphicsEffect::isEnabled() const | - |
210 | { | - |
211 | const QGraphicsEffectPrivate * const d = d_func(); | - |
212 | return d->isEnabled; | - |
213 | } | - |
214 | | - |
215 | void QGraphicsEffect::setEnabled(bool enable) | - |
216 | { | - |
217 | QGraphicsEffectPrivate * const d = d_func(); | - |
218 | if (d->isEnabled == enable) | - |
219 | return; | - |
220 | | - |
221 | d->isEnabled = enable; | - |
222 | if (d->source) { | - |
223 | d->source->d_func()->effectBoundingRectChanged(); | - |
224 | d->source->d_func()->invalidateCache(); | - |
225 | } | - |
226 | enabledChanged(enable); | - |
227 | } | - |
228 | void QGraphicsEffect::update() | - |
229 | { | - |
230 | QGraphicsEffectPrivate * const d = d_func(); | - |
231 | if (d->source) | - |
232 | d->source->update(); | - |
233 | } | - |
234 | QGraphicsEffectSource *QGraphicsEffect::source() const | - |
235 | { | - |
236 | const QGraphicsEffectPrivate * const d = d_func(); | - |
237 | return d->source; | - |
238 | } | - |
239 | void QGraphicsEffect::updateBoundingRect() | - |
240 | { | - |
241 | QGraphicsEffectPrivate * const d = d_func(); | - |
242 | if (d->source) { | - |
243 | d->source->d_func()->effectBoundingRectChanged(); | - |
244 | d->source->d_func()->invalidateCache(QGraphicsEffectSourcePrivate::EffectRectChanged); | - |
245 | } | - |
246 | } | - |
247 | void QGraphicsEffect::sourceChanged(ChangeFlags flags) | - |
248 | { | - |
249 | (void)flags;; | - |
250 | } | - |
251 | QGraphicsColorizeEffect::QGraphicsColorizeEffect(QObject *parent) | - |
252 | : QGraphicsEffect(*new QGraphicsColorizeEffectPrivate, parent) | - |
253 | { | - |
254 | } | - |
255 | | - |
256 | | - |
257 | | - |
258 | | - |
259 | QGraphicsColorizeEffect::~QGraphicsColorizeEffect() | - |
260 | { | - |
261 | } | - |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | | - |
268 | | - |
269 | QColor QGraphicsColorizeEffect::color() const | - |
270 | { | - |
271 | const QGraphicsColorizeEffectPrivate * const d = d_func(); | - |
272 | return d->filter->color(); | - |
273 | } | - |
274 | | - |
275 | void QGraphicsColorizeEffect::setColor(const QColor &color) | - |
276 | { | - |
277 | QGraphicsColorizeEffectPrivate * const d = d_func(); | - |
278 | if (d->filter->color() == color) | - |
279 | return; | - |
280 | | - |
281 | d->filter->setColor(color); | - |
282 | update(); | - |
283 | colorChanged(color); | - |
284 | } | - |
285 | qreal QGraphicsColorizeEffect::strength() const | - |
286 | { | - |
287 | const QGraphicsColorizeEffectPrivate * const d = d_func(); | - |
288 | return d->filter->strength(); | - |
289 | } | - |
290 | | - |
291 | void QGraphicsColorizeEffect::setStrength(qreal strength) | - |
292 | { | - |
293 | QGraphicsColorizeEffectPrivate * const d = d_func(); | - |
294 | if (qFuzzyCompare(d->filter->strength(), strength)) | - |
295 | return; | - |
296 | | - |
297 | d->filter->setStrength(strength); | - |
298 | d->opaque = !qFuzzyIsNull(strength); | - |
299 | update(); | - |
300 | strengthChanged(strength); | - |
301 | } | - |
302 | void QGraphicsColorizeEffect::draw(QPainter *painter) | - |
303 | { | - |
304 | QGraphicsColorizeEffectPrivate * const d = d_func(); | - |
305 | | - |
306 | if (!d->opaque) { | - |
307 | drawSource(painter); | - |
308 | return; | - |
309 | } | - |
310 | | - |
311 | QPoint offset; | - |
312 | if (sourceIsPixmap()) { | - |
313 | | - |
314 | const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, NoPad); | - |
315 | if (!pixmap.isNull()) | - |
316 | d->filter->draw(painter, offset, pixmap); | - |
317 | | - |
318 | return; | - |
319 | } | - |
320 | | - |
321 | | - |
322 | const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset); | - |
323 | if (pixmap.isNull()) | - |
324 | return; | - |
325 | | - |
326 | QTransform restoreTransform = painter->worldTransform(); | - |
327 | painter->setWorldTransform(QTransform()); | - |
328 | d->filter->draw(painter, offset, pixmap); | - |
329 | painter->setWorldTransform(restoreTransform); | - |
330 | } | - |
331 | QGraphicsBlurEffect::QGraphicsBlurEffect(QObject *parent) | - |
332 | : QGraphicsEffect(*new QGraphicsBlurEffectPrivate, parent) | - |
333 | { | - |
334 | QGraphicsBlurEffectPrivate * const d = d_func(); | - |
335 | d->filter->setBlurHints(QGraphicsBlurEffect::PerformanceHint); | - |
336 | } | - |
337 | | - |
338 | | - |
339 | | - |
340 | | - |
341 | QGraphicsBlurEffect::~QGraphicsBlurEffect() | - |
342 | { | - |
343 | } | - |
344 | qreal QGraphicsBlurEffect::blurRadius() const | - |
345 | { | - |
346 | const QGraphicsBlurEffectPrivate * const d = d_func(); | - |
347 | return d->filter->radius(); | - |
348 | } | - |
349 | | - |
350 | void QGraphicsBlurEffect::setBlurRadius(qreal radius) | - |
351 | { | - |
352 | QGraphicsBlurEffectPrivate * const d = d_func(); | - |
353 | if (qFuzzyCompare(d->filter->radius(), radius)) | - |
354 | return; | - |
355 | | - |
356 | d->filter->setRadius(radius); | - |
357 | updateBoundingRect(); | - |
358 | blurRadiusChanged(radius); | - |
359 | } | - |
360 | QGraphicsBlurEffect::BlurHints QGraphicsBlurEffect::blurHints() const | - |
361 | { | - |
362 | const QGraphicsBlurEffectPrivate * const d = d_func(); | - |
363 | return d->filter->blurHints(); | - |
364 | } | - |
365 | | - |
366 | void QGraphicsBlurEffect::setBlurHints(QGraphicsBlurEffect::BlurHints hints) | - |
367 | { | - |
368 | QGraphicsBlurEffectPrivate * const d = d_func(); | - |
369 | if (d->filter->blurHints() == hints) | - |
370 | return; | - |
371 | | - |
372 | d->filter->setBlurHints(hints); | - |
373 | blurHintsChanged(hints); | - |
374 | } | - |
375 | QRectF QGraphicsBlurEffect::boundingRectFor(const QRectF &rect) const | - |
376 | { | - |
377 | const QGraphicsBlurEffectPrivate * const d = d_func(); | - |
378 | return d->filter->boundingRectFor(rect); | - |
379 | } | - |
380 | | - |
381 | | - |
382 | | - |
383 | | - |
384 | void QGraphicsBlurEffect::draw(QPainter *painter) | - |
385 | { | - |
386 | QGraphicsBlurEffectPrivate * const d = d_func(); | - |
387 | if (d->filter->radius() < 1) { | - |
388 | drawSource(painter); | - |
389 | return; | - |
390 | } | - |
391 | | - |
392 | PixmapPadMode mode = PadToEffectiveBoundingRect; | - |
393 | | - |
394 | QPoint offset; | - |
395 | QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset, mode); | - |
396 | if (pixmap.isNull()) | - |
397 | return; | - |
398 | | - |
399 | d->filter->draw(painter, offset, pixmap); | - |
400 | } | - |
401 | QGraphicsDropShadowEffect::QGraphicsDropShadowEffect(QObject *parent) | - |
402 | : QGraphicsEffect(*new QGraphicsDropShadowEffectPrivate, parent) | - |
403 | { | - |
404 | } | - |
405 | | - |
406 | | - |
407 | | - |
408 | | - |
409 | QGraphicsDropShadowEffect::~QGraphicsDropShadowEffect() | - |
410 | { | - |
411 | } | - |
412 | QPointF QGraphicsDropShadowEffect::offset() const | - |
413 | { | - |
414 | const QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
415 | return d->filter->offset(); | - |
416 | } | - |
417 | | - |
418 | void QGraphicsDropShadowEffect::setOffset(const QPointF &offset) | - |
419 | { | - |
420 | QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
421 | if (d->filter->offset() == offset) | - |
422 | return; | - |
423 | | - |
424 | d->filter->setOffset(offset); | - |
425 | updateBoundingRect(); | - |
426 | offsetChanged(offset); | - |
427 | } | - |
428 | qreal QGraphicsDropShadowEffect::blurRadius() const | - |
429 | { | - |
430 | const QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
431 | return d->filter->blurRadius(); | - |
432 | } | - |
433 | | - |
434 | void QGraphicsDropShadowEffect::setBlurRadius(qreal blurRadius) | - |
435 | { | - |
436 | QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
437 | if (qFuzzyCompare(d->filter->blurRadius(), blurRadius)) | - |
438 | return; | - |
439 | | - |
440 | d->filter->setBlurRadius(blurRadius); | - |
441 | updateBoundingRect(); | - |
442 | blurRadiusChanged(blurRadius); | - |
443 | } | - |
444 | QColor QGraphicsDropShadowEffect::color() const | - |
445 | { | - |
446 | const QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
447 | return d->filter->color(); | - |
448 | } | - |
449 | | - |
450 | void QGraphicsDropShadowEffect::setColor(const QColor &color) | - |
451 | { | - |
452 | QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
453 | if (d->filter->color() == color) | - |
454 | return; | - |
455 | | - |
456 | d->filter->setColor(color); | - |
457 | update(); | - |
458 | colorChanged(color); | - |
459 | } | - |
460 | QRectF QGraphicsDropShadowEffect::boundingRectFor(const QRectF &rect) const | - |
461 | { | - |
462 | const QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
463 | return d->filter->boundingRectFor(rect); | - |
464 | } | - |
465 | | - |
466 | | - |
467 | | - |
468 | | - |
469 | void QGraphicsDropShadowEffect::draw(QPainter *painter) | - |
470 | { | - |
471 | QGraphicsDropShadowEffectPrivate * const d = d_func(); | - |
472 | if (d->filter->blurRadius() <= 0 && d->filter->offset().isNull()) { | - |
473 | drawSource(painter); | - |
474 | return; | - |
475 | } | - |
476 | | - |
477 | PixmapPadMode mode = PadToEffectiveBoundingRect; | - |
478 | | - |
479 | | - |
480 | QPoint offset; | - |
481 | const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset, mode); | - |
482 | if (pixmap.isNull()) | - |
483 | return; | - |
484 | | - |
485 | QTransform restoreTransform = painter->worldTransform(); | - |
486 | painter->setWorldTransform(QTransform()); | - |
487 | d->filter->draw(painter, offset, pixmap); | - |
488 | painter->setWorldTransform(restoreTransform); | - |
489 | } | - |
490 | QGraphicsOpacityEffect::QGraphicsOpacityEffect(QObject *parent) | - |
491 | : QGraphicsEffect(*new QGraphicsOpacityEffectPrivate, parent) | - |
492 | { | - |
493 | } | - |
494 | | - |
495 | | - |
496 | | - |
497 | | - |
498 | QGraphicsOpacityEffect::~QGraphicsOpacityEffect() | - |
499 | { | - |
500 | } | - |
501 | qreal QGraphicsOpacityEffect::opacity() const | - |
502 | { | - |
503 | const QGraphicsOpacityEffectPrivate * const d = d_func(); | - |
504 | return d->opacity; | - |
505 | } | - |
506 | | - |
507 | void QGraphicsOpacityEffect::setOpacity(qreal opacity) | - |
508 | { | - |
509 | QGraphicsOpacityEffectPrivate * const d = d_func(); | - |
510 | opacity = qBound(qreal(0.0), opacity, qreal(1.0)); | - |
511 | | - |
512 | if (qFuzzyCompare(d->opacity, opacity)) | - |
513 | return; | - |
514 | | - |
515 | d->opacity = opacity; | - |
516 | if ((d->isFullyTransparent = qFuzzyIsNull(d->opacity))) | - |
517 | d->isFullyOpaque = 0; | - |
518 | else | - |
519 | d->isFullyOpaque = qFuzzyIsNull(d->opacity - 1); | - |
520 | update(); | - |
521 | opacityChanged(opacity); | - |
522 | } | - |
523 | QBrush QGraphicsOpacityEffect::opacityMask() const | - |
524 | { | - |
525 | const QGraphicsOpacityEffectPrivate * const d = d_func(); | - |
526 | return d->opacityMask; | - |
527 | } | - |
528 | | - |
529 | void QGraphicsOpacityEffect::setOpacityMask(const QBrush &mask) | - |
530 | { | - |
531 | QGraphicsOpacityEffectPrivate * const d = d_func(); | - |
532 | if (d->opacityMask == mask) | - |
533 | return; | - |
534 | | - |
535 | d->opacityMask = mask; | - |
536 | d->hasOpacityMask = (mask.style() != Qt::NoBrush); | - |
537 | update(); | - |
538 | | - |
539 | opacityMaskChanged(mask); | - |
540 | } | - |
541 | void QGraphicsOpacityEffect::draw(QPainter *painter) | - |
542 | { | - |
543 | QGraphicsOpacityEffectPrivate * const d = d_func(); | - |
544 | | - |
545 | | - |
546 | if (d->isFullyTransparent) | - |
547 | return; | - |
548 | | - |
549 | | - |
550 | if (d->isFullyOpaque && !d->hasOpacityMask) { | - |
551 | drawSource(painter); | - |
552 | return; | - |
553 | } | - |
554 | | - |
555 | QPoint offset; | - |
556 | Qt::CoordinateSystem system = sourceIsPixmap() ? Qt::LogicalCoordinates : Qt::DeviceCoordinates; | - |
557 | QPixmap pixmap = sourcePixmap(system, &offset, QGraphicsEffect::NoPad); | - |
558 | if (pixmap.isNull()) | - |
559 | return; | - |
560 | | - |
561 | painter->save(); | - |
562 | painter->setOpacity(d->opacity); | - |
563 | | - |
564 | if (d->hasOpacityMask) { | - |
565 | QPainter pixmapPainter(&pixmap); | - |
566 | pixmapPainter.setRenderHints(painter->renderHints()); | - |
567 | pixmapPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn); | - |
568 | if (system == Qt::DeviceCoordinates) { | - |
569 | QTransform worldTransform = painter->worldTransform(); | - |
570 | worldTransform *= QTransform::fromTranslate(-offset.x(), -offset.y()); | - |
571 | pixmapPainter.setWorldTransform(worldTransform); | - |
572 | pixmapPainter.fillRect(sourceBoundingRect(), d->opacityMask); | - |
573 | } else { | - |
574 | pixmapPainter.translate(-offset); | - |
575 | pixmapPainter.fillRect(pixmap.rect(), d->opacityMask); | - |
576 | } | - |
577 | } | - |
578 | | - |
579 | if (system == Qt::DeviceCoordinates) | - |
580 | painter->setWorldTransform(QTransform()); | - |
581 | | - |
582 | painter->drawPixmap(offset, pixmap); | - |
583 | painter->restore(); | - |
584 | } | - |
585 | | - |
586 | | - |
587 | | - |
588 | | - |
| | |