| 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>
|
|
|