summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2012-02-09 15:46:09 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-10 07:24:29 +0100
commit66f740c5e7ea74e00808d8f1b73570726eeda5a0 (patch)
treea25f2eb3a3c38a19b31c48f1c281d80bf5f0b6a5 /tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml
parentb06f7aa36c9c80211e662b30d248a1e5192b0460 (diff)
Refactor Canvas rendering paths.
Refactor Canvas rendering paths to enable different drawing contexts. Change-Id: If0e00a14baa673fca6b999a787b4e89885bb1e51 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml')
-rw-r--r--tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml b/tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml
index 2061647268..08197816e9 100644
--- a/tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml
+++ b/tests/auto/qtquick2/qquickcanvasitem/data/tst_fillrect.qml
@@ -2,15 +2,18 @@ import QtQuick 2.0
import QtTest 1.0
Canvas {
- id:canvas; width:1;height:1; renderTarget:Canvas.Image
- onPaint: {
- context.fillStyle = "red";
- context.fillRect(0, 0, canvas.width, canvas.height);
- }
+ id:canvas; width:1;height:1;
+ renderTarget:Canvas.Image
+ renderStrategy: Canvas.Immediate
+
TestCase {
- name: "FillRect"; when: windowShown
+ name: "FillRect"; when: canvas.available
+
function test_fillRect() {
var ctx = canvas.getContext('2d');
+ ctx.fillStyle = "red";
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+
var imageData = ctx.getImageData(0, 0, 1, 1);
var d = imageData.data;
verify(d.length == 4);
@@ -20,4 +23,4 @@ Canvas {
verify(d[3] == 255);
}
}
-} \ No newline at end of file
+}