summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-12 10:27:07 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-08-12 12:43:05 +0000
commitcdc0916f60753f3dd6f97b504a27d49d3567f6b0 (patch)
treef650da24be21acbcb507b1f7db8a023c17c50072
parent5762738fce7306120c1d93da84ef9c2693d95881 (diff)
Canvas: add a testcase for QSGSimpleTextureNode crash.
Task-number: QTBUG-47714 Change-Id: I8ecf2673ebc5de3d0fe1dec8a67bee81f5d4fb8f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
index 5960e53557..93f85107a7 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml
@@ -677,5 +677,27 @@ CanvasTestCase {
waitForRendering(implicitlySizedItem);
comparePixel(implicitlySizedItem.canvas.context, xCenter, yCenter, 0, 0, 0, 255);
}
+
+ Component {
+ id: simpleTextureNodeUsageComponent
+
+ Canvas {
+ id: canvas
+ anchors.fill: parent
+
+ onPaint: {
+ var ctx = canvas.getContext("2d");
+ ctx.clearRect(0, 0, 200, 200);
+ }
+ }
+ }
+
+ function test_simpleTextureNodeUsage() {
+ var canvas = simpleTextureNodeUsageComponent.createObject(container);
+ verify(canvas);
+ wait(0);
+ // Shouldn't crash.
+ canvas.requestPaint();
+ }
}
}