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

Side by Side Diff: third_party/WebKit/PerformanceTests/Canvas/putImageData.html

Issue 2190523003: Fixing regression in putImageData blink perf test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cp Created 4 years, 4 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 | no next file » | 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> 5 <script>
6
7 var canvas2D = document.createElement("canvas"); 6 var canvas2D = document.createElement("canvas");
8 var ctx2D = canvas2D.getContext("2d"); 7 var ctx2D = canvas2D.getContext("2d");
9 var imageData = null; 8 canvas2D.width = canvas2D.height = 1024;
10 9 var imageData = new ImageData(canvas2D.width, canvas2D.height);
11 function setSize(width, height) {
12 canvas2D.width = width;
13 canvas2D.height = height;
14 }
15
16 function rand(range) {
17 return Math.floor(Math.random() * range);
18 }
19
20 function fillCanvas(ctx2d, canvas2d) {
21 ctx2d.fillStyle = "rgba(" + rand(255) + "," + rand(255) + "," + rand(255) + "," + rand(255) + ")";
22 ctx2d.fillRect(0, 0, canvas2d.width, canvas2d.height);
23 }
24 10
25 function putImageDataToCanvas2D() { 11 function putImageDataToCanvas2D() {
26 ctx2D.putImageData(imageData, 0, 0); 12 ctx2D.putImageData(imageData, 0, 0);
27 } 13 }
28 14
29 setSize(1024, 1024);
30 fillCanvas(ctx2D, canvas2D);
31 imageData = ctx2D.getImageData(0, 0, canvas2D.width, canvas2D.height);
32
33 PerfTestRunner.measureRunsPerSecond({run: putImageDataToCanvas2D, description: " This bench test checks the speed on putting ImageData to Canvas2D(1024x1024)."}) ; 15 PerfTestRunner.measureRunsPerSecond({run: putImageDataToCanvas2D, description: " This bench test checks the speed on putting ImageData to Canvas2D(1024x1024)."}) ;
34 16
35 </script> 17 </script>
36 </body> 18 </body>
37 </html> 19 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698