| 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 /** | 5 /** |
| 6 * The overlay displaying the image. | 6 * The overlay displaying the image. |
| 7 * | 7 * |
| 8 * @param {!HTMLElement} container The container element. | 8 * @param {!HTMLElement} container The container element. |
| 9 * @param {!Viewport} viewport The viewport. | 9 * @param {!Viewport} viewport The viewport. |
| 10 * @param {!MetadataModel} metadataModel | 10 * @param {!MetadataModel} metadataModel |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Obtains prefered load type from GalleryItem. | 134 * Obtains prefered load type from GalleryItem. |
| 135 * | 135 * |
| 136 * @param {!GalleryItem} item | 136 * @param {!GalleryItem} item |
| 137 * @param {!ImageView.Effect} effect | 137 * @param {!ImageView.Effect} effect |
| 138 * @return {ImageView.LoadTarget} Load target. | 138 * @return {ImageView.LoadTarget} Load target. |
| 139 */ | 139 */ |
| 140 ImageView.getLoadTarget = function(item, effect) { | 140 ImageView.getLoadTarget = function(item, effect) { |
| 141 if (item.contentImage) | 141 if (item.contentImage && !item.requireLongRenderingTime()) |
| 142 return ImageView.LoadTarget.CACHED_MAIN_IMAGE; | 142 return ImageView.LoadTarget.CACHED_MAIN_IMAGE; |
| 143 | 143 |
| 144 // Only show thumbnails if there is no effect or the effect is Slide or | 144 // Only show thumbnails if there is no effect or the effect is Slide or |
| 145 // ZoomToScreen. | 145 // ZoomToScreen. |
| 146 var thumbnailLoader = new ThumbnailLoader( | 146 var thumbnailLoader = new ThumbnailLoader( |
| 147 item.getEntry(), | 147 item.getEntry(), |
| 148 ThumbnailLoader.LoaderType.CANVAS, | 148 ThumbnailLoader.LoaderType.CANVAS, |
| 149 item.getThumbnailMetadataItem()); | 149 item.getThumbnailMetadataItem()); |
| 150 if ((effect instanceof ImageView.Effect.None || | 150 if ((effect instanceof ImageView.Effect.None || |
| 151 effect instanceof ImageView.Effect.Slide || | 151 effect instanceof ImageView.Effect.Slide || |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 | 966 |
| 967 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; | 967 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; |
| 968 | 968 |
| 969 /** | 969 /** |
| 970 * @override | 970 * @override |
| 971 */ | 971 */ |
| 972 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { | 972 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { |
| 973 return viewport.getRotatingTransformation( | 973 return viewport.getRotatingTransformation( |
| 974 element.width, element.height, this.orientation_ ? -1 : 1); | 974 element.width, element.height, this.orientation_ ? -1 : 1); |
| 975 }; | 975 }; |
| OLD | NEW |