Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferToImageBitmap-state-persistency.html

Issue 1995733005: Fix 2D canvas state persistency after OffscreenCanvas.transferToImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 var aCanvas = new OffscreenCanvas(50, 50);
5 var ctx = aCanvas.getContext('2d');
6
7 ctx.rect(0, 0, 25, 50);
8 ctx.clip();
9 ctx.translate(20, 20);
10 // Verify backing is reset through transferToImageBitmap()
11 ctx.fillStyle = '#0f0';
12 var firstImage = aCanvas.transferToImageBitmap();
13 // trasnform should be preserved
14 ctx.fillRect(0, 0, 10, 10);
15 var secondImage = aCanvas.transferToImageBitmap();
16
17 var testCanvas = document.createElement('canvas');
18 var testCtx = testCanvas.getContext('2d');
19 testCtx.drawImage(secondImage, 0, 0);
20 // Verify that transform was carried over.
21 var imgData = testCtx.getImageData(23, 25, 1, 1).data;
22 shouldBe("imgData[0]", "0");
23 shouldBe("imgData[1]", "255");
24 shouldBe("imgData[2]", "0");
25 shouldBe("imgData[3]", "255");
26 // Verify that clip was carried over.
27 var imgData = testCtx.getImageData(27, 25, 1, 1).data;
28 shouldBe("imgData[0]", "0");
29 shouldBe("imgData[1]", "0");
30 shouldBe("imgData[2]", "0");
31 shouldBe("imgData[3]", "0");
32 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferToImageBitmap-state-persistency-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698