Chromium Code Reviews| Index: ui/file_manager/gallery/js/gallery_item.js |
| diff --git a/ui/file_manager/gallery/js/gallery_item.js b/ui/file_manager/gallery/js/gallery_item.js |
| index 53c12eb474c56363269ab51e0ff33d58bf7abd98..3f9d7cf57753ee6953b562e73fc7427d3e297901 100644 |
| --- a/ui/file_manager/gallery/js/gallery_item.js |
| +++ b/ui/file_manager/gallery/js/gallery_item.js |
| @@ -440,3 +440,28 @@ GalleryItem.prototype.rename = function(displayName) { |
| this.entry_ = entry; |
| }.bind(this)); |
| }; |
| + |
| +/** |
| + * The threshold size of an image in pixels, which we always use thumbnail |
| + * image for slide-in animation above this. This is a hack to avoid an UI |
| + * unresponsiveness when switching between images. |
| + * @type {number} |
| + * @const |
| + * @private |
|
yamaguchi
2017/01/13 12:25:39
Changed to private & const
oka
2017/01/16 02:23:39
Nit: add a trailing _ if it's private?
yamaguchi
2017/01/16 11:36:20
Now I found we don't use @private for this kind of
|
| + */ |
| +GalleryItem.HEAVY_RENDERING_THRESHOLD_PIXELS = 4000 * 3000; |
| + |
| +/** |
| + * Whether the image requires long rendering time. |
| + * |
| + * @return {boolean} |
| + */ |
| +GalleryItem.prototype.requireLongRenderingTime = function() { |
| + // Check for undefined values. |
| + if (!this.metadataItem_ || |
| + !this.metadataItem_.imageHeight || !this.metadataItem_.imageWidth) |
| + return false; |
| + var numPixels = this.metadataItem_.imageHeight * |
| + this.metadataItem_.imageWidth; |
| + return numPixels > GalleryItem.HEAVY_RENDERING_THRESHOLD_PIXELS; |
| +}; |