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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PerformanceTests/Canvas/setFontAndMeasureText.html
diff --git a/PerformanceTests/Canvas/setFontAndMeasureText.html b/PerformanceTests/Canvas/setFontAndMeasureText.html
new file mode 100644
index 0000000000000000000000000000000000000000..9212cc0e22bc3276d18fff57867fe6334fb5520f
--- /dev/null
+++ b/PerformanceTests/Canvas/setFontAndMeasureText.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/runner.js"></script>
+<script>
+
+var canvas = document.createElement("canvas");
+var ctx = canvas.getContext("2d");
+var font1 = "bold 15px Arial";
+var font2 = "italic 20pt Calibri";
+
+function doTest() {
+ ctx.font = font1;
+ ctx.measureText("a");
+ ctx.font = font2;
+ ctx.measureText("b");
+}
+
+// Warm up the caches
+doTest();
+
+PerfTestRunner.measureRunsPerSecond({
+ description: "Measures performance of setting the current font and measuring text on a canvas.",
+ run: doTest
+});
+</script>
+</body>
+</html>
« 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