| Index: content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| diff --git a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html b/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| index 292500ea9b39392e52a27e2ab9aa960d5fb866c0..1dfa64189dfcd568fd4e1f6fc5104e10b1498b85 100644
|
| --- a/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| +++ b/content/test/data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html
|
| @@ -15,9 +15,12 @@ that the baseline images are regenerated on the next run.
|
| }
|
| </style>
|
| <script id="myWorker" type="text/worker">
|
| -function drawTriangle(canvas)
|
| +
|
| +var g_frameNumber = 0;
|
| +var gl;
|
| +
|
| +function drawTriangle()
|
| {
|
| - var gl = canvas.getContext("webgl");
|
| gl.clearColor(0, 1, 0, 1);
|
| gl.clear(gl.COLOR_BUFFER_BIT);
|
|
|
| @@ -60,10 +63,29 @@ function drawTriangle(canvas)
|
| gl.commit();
|
| }
|
|
|
| +function drawLoop()
|
| +{
|
| + if (g_frameNumber < 3) {
|
| + gl.clearColor(1, 0, 0, 1);
|
| + gl.clear(gl.COLOR_BUFFER_BIT);
|
| + g_frameNumber++;
|
| + gl.commit().then(drawLoop);
|
| + } else {
|
| + drawTriangle(offscreenCanvas);
|
| + gl.commit();
|
| +
|
| + // The following clear is never committed
|
| + gl.clearColor(0, 0, 1, 1);
|
| + gl.clear(gl.COLOR_BUFFER_BIT);
|
| +
|
| + self.postMessage("");
|
| + }
|
| +}
|
| +
|
| self.onmessage = function(e) {
|
| var transferredOffscreenCanvas = e.data;
|
| - drawTriangle(transferredOffscreenCanvas);
|
| - self.postMessage("");
|
| + gl = transferredOffscreenCanvas.getContext("webgl");
|
| + drawLoop();
|
| };
|
| </script>
|
| <script>
|
|
|