Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
|
Justin Novosad
2016/12/01 19:39:57
Nit: the file name should be ...-no-context rather
| |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 test(function() { | |
| 6 var offscreenCanvas = new OffscreenCanvas(100, 50); | |
| 7 var ctx = offscreenCanvas.getContext('2d'); | |
| 8 ctx.fillStyle = "#0f0"; | |
| 9 ctx.fillRect(0, 0, 100, 50); | |
| 10 ctx.globalCompositeOperation = 'copy'; | |
|
Justin Novosad
2016/12/01 19:39:57
Add a comment to explain why 'copy' is important f
| |
| 11 | |
| 12 var offscreenCanvas2 = new OffscreenCanvas(100, 50); | |
| 13 ctx.drawImage(offscreenCanvas2, 0, 0); | |
| 14 | |
| 15 var clr = ctx.getImageData(50, 25, 1, 1).data; | |
| 16 assert_array_equals(clr, [0, 0, 0, 0]); | |
| 17 }, 'Use OffscreenCanvas without a context as ImageSource should draw transparent black'); | |
| 18 </script> | |
| OLD | NEW |