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

Side by Side Diff: third_party/WebKit/LayoutTests/virtual/threaded/fast/idleToBlob/OffscreenCanvas-convertToBlob-webgl-worker.html

Issue 2420203002: Implement convertToBlob() in OffscreenCanvas (Closed)
Patch Set: rebase and fix global-interface-listing-service-worker-expected.txt Created 4 years, 1 month 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 <img id="png"/>
2 <script id="myWorker" type="text/worker">
3 self.onmessage = function (e) {
4 var offCanvas = new OffscreenCanvas(50, 50);
5 var gl = offCanvas.getContext('webgl');
6 gl.clearColor(0, 1, 0, 1);
7 gl.clear(gl.COLOR_BUFFER_BIT);
8
9 // TODO: Add more image types to this test once the toImageData() for webgl
10 // is completed. See crbug.com/657531.
11 offCanvas.convertToBlob()
12 .then(function(blob) {
13 self.postMessage({version: "png", data:blob});
14 });
15 }
16 </script>
17 <script>
18 if (window.testRunner) {
19 testRunner.waitUntilDone();
20 }
21
22 var pngImage = document.getElementById('png');
23 function imageLoaded() {
24 if (window.testRunner) {
25 window.testRunner.notifyDone();
26 }
27 }
28 pngImage.addEventListener('load', imageLoaded);
29
30 var workerBlob = new Blob([document.getElementById('myWorker').textContent]);
31 var worker = new Worker(URL.createObjectURL(workerBlob));
32 worker.addEventListener("message", function(msg) {
33 var blob = msg.data.data;
34 switch (msg.data.version) {
35 case 'png':
36 pngImage.src = URL.createObjectURL(blob);
37 break;
38 }
39 });
40 worker.postMessage("");
41 </script>
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698