diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2010-03-26 15:27:04 (GMT) |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2010-03-26 15:37:49 (GMT) |
commit | e9538ced914739129681362dea03ebc323602126 (patch) | |
tree | c6482bfd9d2e29e319090812ad473d7ce3101c03 /src/gui/graphicsview | |
parent | a8af0e05b30cc4ec26f58378cd5a4e11b20cf9bd (diff) | |
download | Qt-e9538ced914739129681362dea03ebc323602126.zip Qt-e9538ced914739129681362dea03ebc323602126.tar.gz Qt-e9538ced914739129681362dea03ebc323602126.tar.bz2 |
Reverts using composition mode when using DeviceCoordinateMode cache.
Going back to always blitting the newly painted areas to the cache (and
not blending it like before). To avoid painting artifacts when the item
is rotated and when it uses DeviceCoordinateMode cache mode, the entire
cache is always repainted in that case.
Task-number: QTBUG-7863
Reviewed-by: trustme
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 6934abc..6581727 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4285,12 +4285,7 @@ static void _q_paintIntoCache(QPixmap *pix, QGraphicsItem *item, const QRegion & if (!subPix.isNull()) { // Blit the subpixmap into the main pixmap. pixmapPainter.begin(pix); - if (item->cacheMode() == QGraphicsItem::DeviceCoordinateCache - && itemToPixmap.type() > QTransform::TxTranslate) { - pixmapPainter.setCompositionMode(QPainter::CompositionMode_SourceAtop); - } else { - pixmapPainter.setCompositionMode(QPainter::CompositionMode_Source); - } + pixmapPainter.setCompositionMode(QPainter::CompositionMode_Source); pixmapPainter.setClipRegion(pixmapExposed); pixmapPainter.drawPixmap(br.topLeft(), subPix); pixmapPainter.end(); @@ -4456,6 +4451,8 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte } // Create or reuse offscreen pixmap, possibly scroll/blit from the old one. + // If the world transform is rotated we always recreate the cache to avoid + // wrong blending. bool pixModified = false; QGraphicsItemCache::DeviceData *deviceData = &itemCache->deviceData[widget]; bool invertable = true; @@ -4463,7 +4460,9 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte if (invertable) diff *= painter->worldTransform(); deviceData->lastTransform = painter->worldTransform(); - if (!invertable || diff.type() > QTransform::TxTranslate) { + if (!invertable + || diff.type() > QTransform::TxTranslate + || painter->worldTransform().type() > QTransform::TxScale) { pixModified = true; itemCache->allExposed = true; itemCache->exposed.clear(); |