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..685da4fa414323709b41bc3e08ec8960050ff70a 100644 |
| --- a/ui/file_manager/gallery/js/gallery_item.js |
| +++ b/ui/file_manager/gallery/js/gallery_item.js |
| @@ -440,3 +440,23 @@ 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} |
| + */ |
| +GalleryItem.HEAVY_RENDERING_THRESHOLD_PIXELS = 4e3 * 3e3; |
|
fukino
2017/01/13 02:50:33
nit: prefer 4000 * 3000 for easier read.
yamaguchi
2017/01/13 12:25:39
Done.
|
| + |
| +/** |
| + * Whether the image requires long rendering time. |
| + * |
| + * @return {boolean} |
| + */ |
| +GalleryItem.prototype.requireLongRenderingTime = function() { |
| + var numPixels = this.metadataItem_.imageHeight * |
|
oka
2017/01/13 04:23:19
I think imageHeight can be undefined. Maybe it's b
yamaguchi
2017/01/13 12:25:39
Done.
|
| + this.metadataItem_.imageWidth; |
| + return numPixels > GalleryItem.HEAVY_RENDERING_THRESHOLD_PIXELS; |
| +}; |