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

Unified Diff: tools/perf/page_sets/tough_canvas_cases/canvas-font-cycler.html

Issue 1202313002: Adding a canvas telemetry test that uses a large font set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « tools/perf/page_sets/tough_canvas_cases.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/tough_canvas_cases/canvas-font-cycler.html
diff --git a/tools/perf/page_sets/tough_canvas_cases/canvas-font-cycler.html b/tools/perf/page_sets/tough_canvas_cases/canvas-font-cycler.html
new file mode 100644
index 0000000000000000000000000000000000000000..1b1c91b2ca704d4ea6e05b719e41f41696ad1300
--- /dev/null
+++ b/tools/perf/page_sets/tough_canvas_cases/canvas-font-cycler.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<canvas id='c'></canvas>
+<script>
+var fontNameList = ["Palatino Linotype", "Georgia", "Times New Roman", "Arial", "Arial Black", "cursive", "Impact", "Tahoma", "Helvetica", "Verdana", "Geneva", "sans-serif", "Courier", "Monaco"]
+var fontStyleList = ["", "italic", "oblique"];
+var fontWeightList = ["", "bold", "bolder", "lighter"];
+var fontSizeList = ["10pt", "15pt", "20pt", "small", "large", "15px", "20mm"];
+
+var canvas = document.getElementById("c");
+var ctx = canvas.getContext("2d");
+
+function doFrame() {
+ var fontString;
+ canvas.width = canvas.width;
+ fontNameList.forEach(function(fontName) {
+ fontStyleList.forEach(function(fontStyle) {
+ fontWeightList.forEach(function(fontWeight) {
+ fontSizeList.forEach(function(fontSize) {
+ ctx.font = fontStyle + " " + fontWeight + " " + fontSize + " " + fontName;
+ // Use the font to make sure the font is completely resolved (has no pending lazy inits)
+ ctx.fillText("Test", 0, 50);
+ });
+ });
+ });
+ });
+ requestAnimationFrame(doFrame);
+}
+requestAnimationFrame(doFrame);
+</script>
+</body>
+</html>
« no previous file with comments | « tools/perf/page_sets/tough_canvas_cases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698