From cdc0916f60753f3dd6f97b504a27d49d3567f6b0 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 12 Aug 2015 10:27:07 +0200 Subject: Canvas: add a testcase for QSGSimpleTextureNode crash. Task-number: QTBUG-47714 Change-Id: I8ecf2673ebc5de3d0fe1dec8a67bee81f5d4fb8f Reviewed-by: Gabriel de Dietrich --- .../quick/qquickcanvasitem/data/tst_canvas.qml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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(); + } } } -- cgit v1.2.3