Chromium Code Reviews| Index: content/test/data/gpu/pixel_offscreenCanvas_2D_commit_worker.html |
| diff --git a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html b/content/test/data/gpu/pixel_offscreenCanvas_2D_commit_worker.html |
| similarity index 67% |
| copy from content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html |
| copy to content/test/data/gpu/pixel_offscreenCanvas_2D_commit_worker.html |
| index 3ae0e56c24d2c1864f35277dbaa6b75ff33191d1..8fba38b1fd1eeca9de1f80ab26275db65b441443 100644 |
| --- a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html |
| +++ b/content/test/data/gpu/pixel_offscreenCanvas_2D_commit_worker.html |
| @@ -8,15 +8,27 @@ that the baseline images are regenerated on the next run. |
| <html> |
| <head> |
| -<title>OffscreenCanvas commit flow on main thread: green square on white background.</title> |
| +<title>OffscreenCanvas commit flow on worker thread: green square on white background.</title> |
| <style type="text/css"> |
| .nomargin { |
| margin: 0px auto; |
| } |
| </style> |
| +<script id="myWorker" type="text/worker"> |
| +self.onmessage = function(e) { |
| + var transferredOffscreenCanvas = e.data; |
| + var offscreen2d = transferredOffscreenCanvas.getContext("2d"); |
| + offscreen2d.commit(); |
|
Ken Russell (switch to Gerrit)
2016/09/22 00:50:37
Same here.
|
| +}; |
| +</script> |
| <script> |
| var g_swapsBeforeAck = 15; |
| +function makeWorker(script) { |
| + var blob = new Blob([script]); |
| + return new Worker(URL.createObjectURL(blob)); |
| +} |
| + |
| function main() |
| { |
| draw(); |
| @@ -27,10 +39,8 @@ function draw() |
| { |
| var canvas = document.getElementById("c"); |
| var offscreenCanvas = canvas.transferControlToOffscreen(); |
| - var gl = offscreenCanvas.getContext("webgl"); |
| - gl.clearColor(0.0, 1.0, 0.0, 1.0); |
| - gl.clear(gl.COLOR_BUFFER_BIT); |
| - gl.commit(); |
| + var worker = makeWorker(document.getElementById("myWorker").textContent); |
| + worker.postMessage(offscreenCanvas, [offscreenCanvas]); |
| } |
| function waitForFinish() |