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

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

Issue 1187883011: Adding 2D canvas benchmark for setting font and measuring text (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/runner.js"></script>
5 <script>
6
7 var canvas = document.createElement("canvas");
8 var ctx = canvas.getContext("2d");
9 var font1 = "bold 15px Arial";
10 var font2 = "italic 20pt Calibri";
11
12 function doTest() {
13 ctx.font = font1;
14 ctx.measureText("a");
15 ctx.font = font2;
16 ctx.measureText("b");
17 }
18
19 // Warm up the caches
20 doTest();
21
22 PerfTestRunner.measureRunsPerSecond({
23 description: "Measures performance of setting the current font and measuring text on a canvas.",
24 run: doTest
25 });
26 </script>
27 </body>
28 </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