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

Side by Side Diff: third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html

Issue 2400233002: Tweaks to canvas perf tests to make them stay on the GPU (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-webgl-to-hw-accelerated-canvas-2d.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../resources/runner.js"></script> 4 <script src="../resources/runner.js"></script>
5 <script src="resources/canvas_runner.js"></script> 5 <script src="resources/canvas_runner.js"></script>
6 <script> 6 <script>
7 var sourceCanvas2D = document.createElement("canvas"); 7 var sourceCanvas2D = document.createElement("canvas");
8 var sourceCtx2D = sourceCanvas2D.getContext("2d"); 8 var sourceCtx2D = sourceCanvas2D.getContext("2d");
9 var destCanvas2D = document.createElement("canvas"); 9 var destCanvas2D = document.createElement("canvas");
10 var destCtx2D = destCanvas2D.getContext("2d"); 10 var destCtx2D = destCanvas2D.getContext("2d");
11 var dummyCanvas2D = document.createElement("canvas"); 11 var dummyCanvas2D = document.createElement("canvas");
12 var dummyCtx2D = dummyCanvas2D.getContext("2d"); 12 var dummyCtx2D = dummyCanvas2D.getContext("2d");
13 13
14 dummyCanvas2D.width = 1;
15 dummyCanvas2D.height = 1;
16
17 function setSize(sourceWidth, sourceHeight, destWidth, destHeight) { 14 function setSize(sourceWidth, sourceHeight, destWidth, destHeight) {
18 sourceCanvas2D.width = sourceWidth; 15 sourceCanvas2D.width = sourceWidth;
19 sourceCanvas2D.height = sourceHeight; 16 sourceCanvas2D.height = sourceHeight;
20 destCanvas2D.width = destWidth; 17 destCanvas2D.width = destWidth;
21 destCanvas2D.height = destHeight; 18 destCanvas2D.height = destHeight;
19 dummyCanvas2D.width = destWidth;
20 dummyCanvas2D.height = destHeight;
22 } 21 }
23 22
24 function rand(range) { 23 function rand(range) {
25 return Math.floor(Math.random() * range); 24 return Math.floor(Math.random() * range);
26 } 25 }
27 26
28 function fillCanvas(ctx2d, canvas2d) { 27 function fillCanvas(ctx2d, canvas2d) {
29 ctx2d.fillStyle = "rgba(" + rand(255) + "," + rand(255) + "," + rand(255) + "," + rand(255) + ")"; 28 ctx2d.fillStyle = "rgba(" + rand(255) + "," + rand(255) + "," + rand(255) + "," + rand(255) + ")";
30 ctx2d.fillRect(0, 0, canvas2d.width, canvas2d.height); 29 ctx2d.fillRect(0, 0, canvas2d.width, canvas2d.height);
31 } 30 }
(...skipping 18 matching lines...) Expand all
50 fillCanvas(sourceCtx2D, sourceCanvas2D); 49 fillCanvas(sourceCtx2D, sourceCanvas2D);
51 CanvasRunner.start({ 50 CanvasRunner.start({
52 description: "This bench test checks the speed on drawing dynamic 2d Can vas(1024x1024) to HW accelerated Canvas2D(1024x1024).", 51 description: "This bench test checks the speed on drawing dynamic 2d Can vas(1024x1024) to HW accelerated Canvas2D(1024x1024).",
53 doRun: doRun, 52 doRun: doRun,
54 ensureComplete: ensureComplete}); 53 ensureComplete: ensureComplete});
55 } 54 }
56 55
57 </script> 56 </script>
58 </body> 57 </body>
59 </html> 58 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-webgl-to-hw-accelerated-canvas-2d.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698