| Index: content/test/data/gpu/pixel_offscreenCanvas_resize.html
|
| diff --git a/content/test/data/gpu/pixel_offscreenCanvas_resize.html b/content/test/data/gpu/pixel_offscreenCanvas_resize.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4e7e733062521e46d95badb13971b8c47ea39c57
|
| --- /dev/null
|
| +++ b/content/test/data/gpu/pixel_offscreenCanvas_resize.html
|
| @@ -0,0 +1,74 @@
|
| +<!DOCTYPE HTML>
|
| +
|
| +<!-- READ BEFORE UPDATING:
|
| +If this test is updated make sure to increment the "revision" value of the
|
| +associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
|
| +that the baseline images are regenerated on the next run.
|
| +-->
|
| +
|
| +<html>
|
| +<head>
|
| +<title>OffscreenCanvas commit flow With Resize: Blue Rectangle on white background.</title>
|
| +<style type="text/css">
|
| +.nomargin {
|
| + margin: 0px auto;
|
| +}
|
| +</style>
|
| +<script id="myWorker" type="text/worker">
|
| +self.onmessage = function(e) {
|
| + var transferredCanvas = e.data;
|
| + var offscreen2d = transferredCanvas.getContext("2d");
|
| + offscreen2d.fillStyle = "blue";
|
| + offscreen2d.fillRect(0, 0, 200, 200);
|
| + offscreen2d.commit();
|
| +
|
| + // Change the size of offscreenCanvas from 200X200 to 100X300
|
| + transferredCanvas.width = 100;
|
| + transferredCanvas.height = 300;
|
| + offscreen2d.fillStyle = "blue";
|
| + offscreen2d.fillRect(0, 0, 200, 200);
|
| + offscreen2d.commit();
|
| + self.postMessage("");
|
| +};
|
| +</script>
|
| +<script>
|
| +var g_swapsBeforeAck = 15;
|
| +
|
| +function makeWorker(script)
|
| +{
|
| + var blob = new Blob([script]);
|
| + return new Worker(URL.createObjectURL(blob));
|
| +}
|
| +
|
| +function waitForFinish()
|
| +{
|
| + if (g_swapsBeforeAck == 0) {
|
| + domAutomationController.setAutomationId(1);
|
| + domAutomationController.send("SUCCESS");
|
| + } else {
|
| + g_swapsBeforeAck--;
|
| + document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1;
|
| + window.webkitRequestAnimationFrame(waitForFinish);
|
| + }
|
| +}
|
| +
|
| +function main()
|
| +{
|
| + var canvas2D = document.getElementById("c");
|
| + var offscreenCanvas = canvas2D.transferControlToOffscreen();
|
| + var worker = makeWorker(document.getElementById("myWorker").textContent);
|
| + worker.postMessage(offscreenCanvas, [offscreenCanvas]);
|
| + worker.onmessage = function (e) {
|
| + waitForFinish();
|
| + };
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="main()">
|
| +<div style="position:relative; width:300px; height:300px; background-color:white">
|
| +</div>
|
| +<div id="container" style="position:absolute; top:0px; left:0px">
|
| +<canvas id="c" width="200" height="200" class="nomargin"></canvas>
|
| +</div>
|
| +</body>
|
| +</html>
|
|
|