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 | 4 |
5 // Namespace object for the utilities. | 5 // Namespace object for the utilities. |
6 var ImageUtil = {}; | 6 var ImageUtil = {}; |
7 | 7 |
8 /** | 8 /** |
9 * Performance trace. | 9 * Performance trace. |
10 */ | 10 */ |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 * @private | 460 * @private |
461 */ | 461 */ |
462 this.entry_ = null; | 462 this.entry_ = null; |
463 }; | 463 }; |
464 | 464 |
465 /** | 465 /** |
466 * Loads an image. | 466 * Loads an image. |
467 * TODO(mtomasz): Simplify, or even get rid of this class and merge with the | 467 * TODO(mtomasz): Simplify, or even get rid of this class and merge with the |
468 * ThumbnaiLoader class. | 468 * ThumbnaiLoader class. |
469 * | 469 * |
470 * @param {!Gallery.Item} item Item representing the image to be loaded. | 470 * @param {!GalleryItem} item Item representing the image to be loaded. |
471 * @param {function(!HTMLCanvasElement, string=)} callback Callback to be | 471 * @param {function(!HTMLCanvasElement, string=)} callback Callback to be |
472 * called when loaded. The second optional argument is an error identifier. | 472 * called when loaded. The second optional argument is an error identifier. |
473 * @param {number=} opt_delay Load delay in milliseconds, useful to let the | 473 * @param {number=} opt_delay Load delay in milliseconds, useful to let the |
474 * animations play out before the computation heavy image loading starts. | 474 * animations play out before the computation heavy image loading starts. |
475 */ | 475 */ |
476 ImageUtil.ImageLoader.prototype.load = function(item, callback, opt_delay) { | 476 ImageUtil.ImageLoader.prototype.load = function(item, callback, opt_delay) { |
477 var entry = item.getEntry(); | 477 var entry = item.getEntry(); |
478 | 478 |
479 this.cancel(); | 479 this.cancel(); |
480 this.entry_ = entry; | 480 this.entry_ = entry; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 ImageUtil.getMetricName = function(name) { | 730 ImageUtil.getMetricName = function(name) { |
731 return 'PhotoEditor.' + name; | 731 return 'PhotoEditor.' + name; |
732 }; | 732 }; |
733 | 733 |
734 /** | 734 /** |
735 * Used for metrics reporting, keep in sync with the histogram description. | 735 * Used for metrics reporting, keep in sync with the histogram description. |
736 * @type {Array<string>} | 736 * @type {Array<string>} |
737 * @const | 737 * @const |
738 */ | 738 */ |
739 ImageUtil.FILE_TYPES = ['jpg', 'png', 'gif', 'bmp', 'webp']; | 739 ImageUtil.FILE_TYPES = ['jpg', 'png', 'gif', 'bmp', 'webp']; |
OLD | NEW |