Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / Canvas / getImageData.html
blobf4680aabd6571ac6f7d6b7ceecb44a03fb44b683
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/runner.js"></script>
5 <script>
7 var canvas2D = document.createElement("canvas");
8 var ctx2D = canvas2D.getContext("2d");
10 function setSize(width, height) {
11 canvas2D.width = width;
12 canvas2D.height = height;
15 function rand(range) {
16 return Math.floor(Math.random() * range);
19 function fillCanvas(ctx2d, canvas2d) {
20 ctx2d.fillStyle = "rgba(" + rand(255) + "," + rand(255) + "," + rand(255) + "," + rand(255) + ")";
21 ctx2d.fillRect(0, 0, canvas2d.width, canvas2d.height);
24 function getImageDataFromCanvas2D() {
25 ctx2D.getImageData(0, 0, canvas2D.width, canvas2D.height);
28 setSize(1024, 1024);
29 fillCanvas(ctx2D, canvas2D);
31 PerfTestRunner.measureRunsPerSecond({run: getImageDataFromCanvas2D, description: "This bench test checks the speed on getting ImageData from Canvas2D(1024x1024)."});
33 </script>
34 </body>
35 </html>