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

Unified Diff: content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html

Issue 2359723003: Implement OffscreenCanvas Accelerated 2D commit() (Closed)
Patch Set: remove isAccelerated() Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html
diff --git a/content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html b/content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html
new file mode 100644
index 0000000000000000000000000000000000000000..a0092d9fbd06b4d1670cdc9523f0b5069d256655
--- /dev/null
+++ b/content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html
@@ -0,0 +1,71 @@
+<!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 2d commit flow on worker thread: blue 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 transferredCanvas = e.data;
+ var offscreen2d = transferredCanvas.getContext("2d");
+ offscreen2d.fillStyle = "blue";
+ offscreen2d.fillRect(0, 0, transferredCanvas.width, transferredCanvas.height);
+ offscreen2d.commit();
+ self.postMessage("");
Ken Russell (switch to Gerrit) 2016/09/22 22:47:27 I think that you should change this test so it wai
+};
+</script>
+<script>
+var g_swapsBeforeAck = 15;
+
+function main()
+{
+ draw();
+ waitForFinish();
+}
+
+function makeWorker(script)
+{
+ var blob = new Blob([script]);
+ return new Worker(URL.createObjectURL(blob));
+}
+
+function draw()
+{
+ var canvas2D = document.getElementById("c");
+ var offscreenCanvas = canvas2D.transferControlToOffscreen();
+ var worker = makeWorker(document.getElementById("myWorker").textContent);
+ worker.postMessage(offscreenCanvas, [offscreenCanvas]);
+}
+
+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);
+ }
+}
+
+</script>
+</head>
+<body onload="main()">
+<div style="position:relative; width:350px; height:350px; background-color:white">
+</div>
+<div id="container" style="position:absolute; top:0px; left:0px">
+<canvas id="c" width="320" height="320" class="nomargin"></canvas>
+</div>
+</body>
+</html>
« no previous file with comments | « content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_main.html ('k') | content/test/gpu/gpu_tests/pixel_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698