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

Side by Side Diff: PerformanceTests/Canvas/setFontAndMeasureTextSingleFont.html

Issue 1212813004: Adding a benchmark that measures the performance of using a single font for measuring text (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updated desc Created 5 years, 6 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 | Annotate | Revision Log
« 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 6
7 var canvas = document.createElement("canvas"); 7 var canvas = document.createElement("canvas");
8 var ctx = canvas.getContext("2d"); 8 var ctx = canvas.getContext("2d");
9 var font1 = "bold 15px Arial"; 9 var font1 = "bold 15px Arial";
10 var font2 = "italic 20pt Calibri";
11 10
12 function doTest() { 11 function doTest() {
13 ctx.font = font1; 12 ctx.font = font1;
14 ctx.measureText("a"); 13 ctx.measureText("a");
15 ctx.font = font2;
16 ctx.measureText("b");
17 } 14 }
18 15
19 // Warm up the caches 16 // Warm up the caches
20 doTest(); 17 doTest();
21 18
22 PerfTestRunner.measureRunsPerSecond({ 19 PerfTestRunner.measureRunsPerSecond({
23 description: "Measures performance of setting the current font and measuring text on a canvas.", 20 description: "Measures performance of setting the current font and measuring text using the same font over and over.",
24 run: doTest 21 run: doTest
25 }); 22 });
26 </script> 23 </script>
27 </body> 24 </body>
28 </html> 25 </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