| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 'use strict'; | 4 'use strict'; |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * Creates a sample canvas. | 7 * Creates a sample canvas. |
| 8 * @return {HTMLCanvasElement} | 8 * @return {HTMLCanvasElement} |
| 9 */ | 9 */ |
| 10 function getSampleCanvas() { | 10 function getSampleCanvas() { |
| 11 var canvas = document.createElement('canvas'); | 11 var canvas = |
| 12 /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); |
| 12 canvas.width = 1920; | 13 canvas.width = 1920; |
| 13 canvas.height = 1080; | 14 canvas.height = 1080; |
| 14 | 15 |
| 15 var ctx = canvas.getContext('2d'); | 16 var ctx = canvas.getContext('2d'); |
| 16 ctx.fillStyle = '#000000'; | 17 ctx.fillStyle = '#000000'; |
| 17 for (var i = 0; i < 10; i++) { | 18 for (var i = 0; i < 10; i++) { |
| 18 ctx.fillRect(i * 30, i * 30, 20, 20); | 19 ctx.fillRect(i * 30, i * 30, 20, 20); |
| 19 } | 20 } |
| 20 | 21 |
| 21 return canvas; | 22 return canvas; |
| 22 } | 23 } |
| OLD | NEW |