aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickcanvasitem
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2014-02-27 15:13:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-28 00:02:44 +0100
commit4693102d94e1942c4d72ac2b148cb04edb4b2af5 (patch)
tree19d76dcdef25e4e677cfa3ba2ad0de8ff990d469 /tests/auto/quick/qquickcanvasitem
parent24d5fe8113ed149b98c0718aa3b27d3b013577cc (diff)
Canvas: do not emit paint signal when invisible
Task-number: QTBUG-31830 Change-Id: I23c6fc822547120f14c2d9a09f01a8f985745e2a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickcanvasitem')
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml15
2 files changed, 14 insertions, 3 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
index 1a5711ebb2..e299147b36 100644
--- a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
@@ -1,5 +1,6 @@
import QtQuick 2.0
import QtTest 1.0
+import QtQuick.Window 2.1
TestCase {
id:testCase
@@ -15,6 +16,7 @@ TestCase {
if (type === "2d")
return [
{ tag:"image threaded", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Threaded}},
+ { tag:"image canvas invisible", properties:{visible: false, width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Threaded}},
// { tag:"image cooperative", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Cooperative}},
{ tag:"image immediate", properties:{width:100, height:100, renderTarget:Canvas.Image, renderStrategy:Canvas.Immediate}},
// { tag:"fbo cooperative", properties:{width:100, height:100, renderTarget:Canvas.FramebufferObject, renderStrategy:Canvas.Cooperative}},
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
index f13039ad95..b92f6354a5 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
@@ -180,11 +180,20 @@ CanvasTestCase {
tryCompare(c, "availableChangedCount", 1);
//scene graph could be available immediately
//in this case, we force waiting a short while until the init paint finished
- tryCompare(c, "paintedCount", 1);
+ if (c.visible) {
+ tryCompare(c, "paintedCount", 1);
+ } else {
+ tryCompare(c, "paintedCount", 0);
+ }
ctx.fillRect(0, 0, c.width, c.height);
c.toDataURL();
- tryCompare(c, "paintedCount", 2);
- tryCompare(c, "paintCount", 1);
+ if (c.visible) {
+ tryCompare(c, "paintCount", 1);
+ tryCompare(c, "paintedCount", 2);
+ } else {
+ tryCompare(c, "paintCount", 0);
+ tryCompare(c, "paintedCount", 1);
+ }
c.destroy();
}
function test_loadImage(row) {