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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-clearRect-in-worker.html

Issue 1826383002: Change the context type name to "bitmaprender" for ImageBitmapRenderingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <canvas id='output' width='100' height='100'></canvas> 4 <canvas id='output' width='100' height='100'></canvas>
5 5
6 <script id='myWorker' type='text/worker'> 6 <script id='myWorker' type='text/worker'>
7 self.onmessage = function(e) { 7 self.onmessage = function(e) {
8 var aCanvas = new OffscreenCanvas(100, 100); 8 var aCanvas = new OffscreenCanvas(100, 100);
9 var ctx = aCanvas.getContext('2d'); 9 var ctx = aCanvas.getContext('2d');
10 ctx.fillStyle = 'green'; 10 ctx.fillStyle = 'green';
11 ctx.fillRect(20, 20, 60, 60); 11 ctx.fillRect(20, 20, 60, 60);
12 ctx.fillStyle = 'red'; 12 ctx.fillStyle = 'red';
13 ctx.fillRect(25, 25, 50, 50); 13 ctx.fillRect(25, 25, 50, 50);
14 // No red should be visible after this 14 // No red should be visible after this
15 ctx.clearRect(25, 25, 50, 50); 15 ctx.clearRect(25, 25, 50, 50);
16 var image = aCanvas.transferToImageBitmap(); 16 var image = aCanvas.transferToImageBitmap();
17 self.postMessage(image, [image]); 17 self.postMessage(image, [image]);
18 }; 18 };
19 </script> 19 </script>
20 20
21 <script> 21 <script>
22 if (window.testRunner) { 22 if (window.testRunner) {
23 testRunner.waitUntilDone(); 23 testRunner.waitUntilDone();
24 } 24 }
25 var blob = new Blob([document.getElementById('myWorker').textContent]); 25 var blob = new Blob([document.getElementById('myWorker').textContent]);
26 var worker = new Worker(URL.createObjectURL(blob)); 26 var worker = new Worker(URL.createObjectURL(blob));
27 worker.addEventListener('message', msg => { 27 worker.addEventListener('message', msg => {
28 var outputCtx = document.getElementById('output').getContext('imagebitmap'); 28 var outputCtx = document.getElementById('output').getContext('bitmaprenderer') ;
29 outputCtx.transferImageBitmap(msg.data); 29 outputCtx.transferImageBitmap(msg.data);
30 if (window.testRunner) { 30 if (window.testRunner) {
31 testRunner.notifyDone(); 31 testRunner.notifyDone();
32 } 32 }
33 }); 33 });
34 worker.postMessage(""); 34 worker.postMessage("");
35 </script> 35 </script>
36 </body> 36 </body>
37 </html> 37 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-fillRect-in-worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698