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

Side by Side Diff: content/test/data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html

Issue 2359723003: Implement OffscreenCanvas Accelerated 2D commit() (Closed)
Patch Set: Temporary code for Unaccelerated case 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2
3 <!-- READ BEFORE UPDATING:
4 If this test is updated make sure to increment the "revision" value of the
5 associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure
6 that the baseline images are regenerated on the next run.
7 -->
8
9 <html>
10 <head>
11 <title>OffscreenCanvas 2d commit flow on worker thread: green square on white ba ckground.</title>
12 <style type="text/css">
13 .nomargin {
14 margin: 0px auto;
15 }
16 </style>
17 <script id="myWorker" type="text/worker">
18 self.onmessage = function(e) {
19 var transferredCanvas = e.data;
20 var offscreen2d = transferredCanvas.getContext("2d");
21 offscreen2d.fillStyle = "green";
22 offscreen2d.fillRect(0, 0, transferredCanvas.width, transferredCanvas.height );
23 offscreen2d.commit();
24 };
25 </script>
26 <script>
27 var g_swapsBeforeAck = 15;
28
29 function main()
30 {
31 draw();
32 waitForFinish();
33 }
34
35 function makeWorker(script)
36 {
37 var blob = new Blob([script]);
38 return new Worker(URL.createObjectURL(blob));
39 }
40
41 function waitForFinish()
42 {
43 var canvas2D = document.getElementById("c");
44 var offscreenCanvas = canvas2D.transferControlToOffscreen();
45 var worker = makeWorker(document.getElementById("myWorker").textContent);
46 worker.postMessage(offscreenCanvas, [offscreenCanvas]);
47 }
48 </script>
49 </head>
50 <body onload="main()">
51 <div style="position:relative; width:350px; height:350px; background-color:white ">
52 </div>
53 <div id="container" style="position:absolute; top:0px; left:0px">
54 <canvas id="c" width="320" height="320" class="nomargin"></canvas>
55 </div>
56 </body>
57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698