| Index: content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| diff --git a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html b/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| similarity index 69%
|
| copy from content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html
|
| copy to content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| index 3ae0e56c24d2c1864f35277dbaa6b75ff33191d1..d4a9ea713d881c86af13fffbb099c1210e6874b8 100644
|
| --- a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_main.html
|
| +++ b/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| @@ -8,15 +8,29 @@ 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: red 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 gl = transferredOffscreenCanvas.getContext("webgl");
|
| + gl.clearColor(1.0, 0.0, 0.0, 1.0);
|
| + gl.clear(gl.COLOR_BUFFER_BIT);
|
| + gl.commit();
|
| +};
|
| +</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 +41,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()
|
|
|