aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcanvasitem.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-03-14 13:04:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-16 00:53:31 +0100
commit4ef1032a4e5b0e612fb2d440fb3ef82fd5af3c5a (patch)
treecaf5b863665fa7c14c032d974bc9f0f22a3cabe1 /src/quick/items/context2d/qquickcanvasitem.cpp
parent156508dbc058e8d43106afb19d1dee50f5d65b93 (diff)
Canvas: do not emit paint when resized but hidden
It turns out to be a bad idea (as in, breaks the enterprise controls) to block paint() altogether when hidden. The original bug report QTBUG-31830 only complained about paint() being emitted upon resize while _hidden_, so this change solves exactly that. User is still free to call requestPaint() even when hidden, and Canvas now doesn't recklessly ignore the request. Task-number: QTBUG-31830 Change-Id: Icd82188f65406b3ef6ae3b19b5984944576886ff Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcanvasitem.cpp')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 17adf1b66b..8b9ad50a3f 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -590,8 +590,10 @@ void QQuickCanvasItem::geometryChanged(const QRectF &newGeometry, const QRectF &
emit canvasWindowChanged();
}
- if (d->available && newSize != oldGeometry.size())
- requestPaint();
+ if (d->available && newSize != oldGeometry.size()) {
+ if (isVisible() || (d->extra.isAllocated() && d->extra->effectRefCount > 0))
+ requestPaint();
+ }
}
void QQuickCanvasItem::releaseResources()
@@ -640,9 +642,6 @@ void QQuickCanvasItem::updatePolish()
QQuickItem::updatePolish();
Q_D(QQuickCanvasItem);
- if (!isVisible() && !(d->extra.isAllocated() && d->extra->effectRefCount>0))
- return;
-
if (d->context && d->renderStrategy != QQuickCanvasItem::Cooperative)
d->context->prepare(d->canvasSize.toSize(), d->tileSize, d->canvasWindow.toRect(), d->dirtyRect.toRect(), d->smooth, antialiasing());