diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-03-21 23:40:21 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:23 (GMT) |
commit | b9ef3b8b5cd54ae2e1feae09b912af8b9c8c8550 (patch) | |
tree | ee1204ab031abc0dfc42a000ee4689e368a1ca2c | |
parent | 0e0637799f6c54924f711d7cbc84857dc1813a19 (diff) | |
download | Qt-b9ef3b8b5cd54ae2e1feae09b912af8b9c8c8550.zip Qt-b9ef3b8b5cd54ae2e1feae09b912af8b9c8c8550.tar.gz Qt-b9ef3b8b5cd54ae2e1feae09b912af8b9c8c8550.tar.bz2 |
Fix QGraphicsEffect cache when the item is not visible by the view.
We can't rely on the exposed rect since the item can be outside the view
so we need to regenerate the complete pixmap.
Task-number:QTBUG-8750
Reviewed-by:sroedal
(cherry picked from commit fcb738161efc965e91c3d528c31ac77d3a05ac64)
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index bb3eed3..b263d63 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -10937,7 +10937,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP // Item coordinates with info. QTransform newEffectTransform = info->transformPtr->inverted(); newEffectTransform *= effectTransform; - scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, info->exposedRegion, + scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0, info->widget, info->opacity, &newEffectTransform, info->wasDirtySceneTransform, info->drawItem); } diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index c535572..f582ca9 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4718,7 +4718,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (item->d_ptr->graphicsEffect && item->d_ptr->graphicsEffect->isEnabled()) { ENSURE_TRANSFORM_PTR; QGraphicsItemPaintInfo info(viewTransform, transformPtr, effectTransform, exposedRegion, widget, &styleOptionTmp, - painter, opacity, wasDirtyParentSceneTransform, drawItem); + painter, opacity, wasDirtyParentSceneTransform, itemHasContents && !itemIsFullyTransparent); QGraphicsEffectSource *source = item->d_ptr->graphicsEffect->d_func()->source; QGraphicsItemEffectSourcePrivate *sourced = static_cast<QGraphicsItemEffectSourcePrivate *> (source->d_func()); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 564b405..8d736e9 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -7794,7 +7794,7 @@ void tst_QGraphicsItem::hitTestGraphicsEffectItem() QTest::qWait(50); // Make sure all visible items are repainted. - QCOMPARE(item1->repaints, 0); + QCOMPARE(item1->repaints, 1); QCOMPARE(item2->repaints, 1); QCOMPARE(item3->repaints, 1); |