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

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

Issue 2416953002: Improve gpu pixel tests for OffscreenCanvas 2d (Closed)
Patch Set: point to the correct bug Created 4 years, 2 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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 2
3 <!-- READ BEFORE UPDATING: 3 <!-- READ BEFORE UPDATING:
4 If this test is updated make sure to increment the "revision" value of the 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 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. 6 that the baseline images are regenerated on the next run.
7 --> 7 -->
8 8
9 <html> 9 <html>
10 <head> 10 <head>
11 <title>OffscreenCanvas 2d commit flow on worker thread: blue square on white bac kground.</title> 11 <title>OffscreenCanvas 2d commit flow on worker thread: Four-color square on whi te background.</title>
12 <style type="text/css"> 12 <style type="text/css">
13 .nomargin { 13 .nomargin {
14 margin: 0px auto; 14 margin: 0px auto;
15 } 15 }
16 </style> 16 </style>
17 <script id="myWorker" type="text/worker"> 17 <script id="myWorker" type="text/worker">
18 self.onmessage = function(e) { 18 self.onmessage = function(e) {
19 var transferredCanvas = e.data; 19 var transferredCanvas = e.data;
20 var offscreen2d = transferredCanvas.getContext("2d"); 20 var offscreen2d = transferredCanvas.getContext("2d");
21 offscreen2d.fillStyle = "red";
22 offscreen2d.fillRect(0, 0, 100, 100);
23 offscreen2d.fillStyle = "green";
24 offscreen2d.fillRect(100, 0, 200, 100);
xidachen 2016/10/13 17:07:51 Same as the other file.
xlai (Olivia) 2016/10/13 18:48:24 Done.
21 offscreen2d.fillStyle = "blue"; 25 offscreen2d.fillStyle = "blue";
22 offscreen2d.fillRect(0, 0, transferredCanvas.width, transferredCanvas.height ); 26 offscreen2d.fillRect(0, 100, 100, 200);
27 offscreen2d.fillStyle = "black";
28 offscreen2d.fillRect(100, 100, 200, 200);
23 offscreen2d.commit(); 29 offscreen2d.commit();
24 self.postMessage(""); 30 self.postMessage("");
25 }; 31 };
26 </script> 32 </script>
27 <script> 33 <script>
28 var g_swapsBeforeAck = 15; 34 var g_swapsBeforeAck = 15;
29 35
30 function makeWorker(script) 36 function makeWorker(script)
31 { 37 {
32 var blob = new Blob([script]); 38 var blob = new Blob([script]);
(...skipping 18 matching lines...) Expand all
51 var offscreenCanvas = canvas2D.transferControlToOffscreen(); 57 var offscreenCanvas = canvas2D.transferControlToOffscreen();
52 var worker = makeWorker(document.getElementById("myWorker").textContent); 58 var worker = makeWorker(document.getElementById("myWorker").textContent);
53 worker.postMessage(offscreenCanvas, [offscreenCanvas]); 59 worker.postMessage(offscreenCanvas, [offscreenCanvas]);
54 worker.onmessage = function (e) { 60 worker.onmessage = function (e) {
55 waitForFinish(); 61 waitForFinish();
56 }; 62 };
57 } 63 }
58 </script> 64 </script>
59 </head> 65 </head>
60 <body onload="main()"> 66 <body onload="main()">
61 <div style="position:relative; width:350px; height:350px; background-color:white "> 67 <div style="position:relative; width:300px; height:300px; background-color:white ">
62 </div> 68 </div>
63 <div id="container" style="position:absolute; top:0px; left:0px"> 69 <div id="container" style="position:absolute; top:0px; left:0px">
64 <canvas id="c" width="320" height="320" class="nomargin"></canvas> 70 <canvas id="c" width="200" height="200" class="nomargin"></canvas>
65 </div> 71 </div>
66 </body> 72 </body>
67 </html> 73 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698