aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickcanvasitem
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2012-05-28 10:48:37 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-05 01:59:58 +0200
commit41a9f34461e34c171ce7ecc4b3e9bc64948ffbde (patch)
tree64272e64e1fb99758810a039cee38ea7333084e5 /tests/auto/quick/qquickcanvasitem
parent3747f1972db869853a593f869154debf174c9cf2 (diff)
Fix canvas item drawImage bug with FBO render target
If canvas' render target is FramebufferObject, only the first drawImage() call was successful, it could be fixed by adding beginNativePainting() and endNativePainting(), but this could be unexpected behavior with OpenGL paint engine. task-number: QTBUG-23595 Change-Id: Iff70fc88f6d39655dd283fa5dde3365887910460 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickcanvasitem')
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_image.qml14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_image.qml b/tests/auto/quick/qquickcanvasitem/data/tst_image.qml
index 5853c034c4..71931acae8 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_image.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_image.qml
@@ -692,4 +692,16 @@ CanvasTestCase {
comparePixel(ctx, 50,25, 0,255,0,255, 2);
}
-}
+ function test_multiple_painting(row) {
+ var canvas = createCanvasObject(row);
+ var ctx = canvas.getContext('2d');
+ loadImages(canvas);
+
+ ctx.fillStyle = '#0f0';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.drawImage('red.png', 0, 0, 50, 50);
+ ctx.drawImage('red.png', 50, 0, 100, 50);
+ comparePixel(ctx, 25,25, 255,0,0,255, 2);
+ comparePixel(ctx, 75,25, 255,0,0,255, 2);
+ }
+} \ No newline at end of file