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 * @constructor | 10 * @constructor |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 * @return {ImageView.LoadTarget} Load target. | 143 * @return {ImageView.LoadTarget} Load target. |
144 */ | 144 */ |
145 ImageView.getLoadTarget = function(item, effect) { | 145 ImageView.getLoadTarget = function(item, effect) { |
146 if (item.contentImage) | 146 if (item.contentImage) |
147 return ImageView.LoadTarget.CACHED_MAIN_IMAGE; | 147 return ImageView.LoadTarget.CACHED_MAIN_IMAGE; |
148 if (item.screenImage) | 148 if (item.screenImage) |
149 return ImageView.LoadTarget.CACHED_THUMBNAIL; | 149 return ImageView.LoadTarget.CACHED_THUMBNAIL; |
150 | 150 |
151 // Only show thumbnails if there is no effect or the effect is Slide. | 151 // Only show thumbnails if there is no effect or the effect is Slide. |
152 var metadata = item.getMetadata(); | 152 var metadata = item.getMetadata(); |
| 153 var thumbnailLoader = new ThumbnailLoader( |
| 154 item.getEntry(), ThumbnailLoader.LoaderType.CANVAS, item.getMetadata()); |
153 if ((effect instanceof ImageView.Effect.None || | 155 if ((effect instanceof ImageView.Effect.None || |
154 effect instanceof ImageView.Effect.Slide) && | 156 effect instanceof ImageView.Effect.Slide) && |
155 ThumbnailLoader.hasThumbnailInMetadata(metadata)) { | 157 thumbnailLoader.getLoadTarget() !== |
| 158 ThumbnailLoader.LoadTarget.FILE_ENTRY) { |
156 return ImageView.LoadTarget.THUMBNAIL; | 159 return ImageView.LoadTarget.THUMBNAIL; |
157 } | 160 } |
158 | 161 |
159 return ImageView.LoadTarget.MAIN_IMAGE; | 162 return ImageView.LoadTarget.MAIN_IMAGE; |
160 }; | 163 }; |
161 | 164 |
162 ImageView.prototype = {__proto__: ImageBuffer.Overlay.prototype}; | 165 ImageView.prototype = {__proto__: ImageBuffer.Overlay.prototype}; |
163 | 166 |
164 /** | 167 /** |
165 * @override | 168 * @override |
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 }; | 974 }; |
972 | 975 |
973 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; | 976 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; |
974 | 977 |
975 /** | 978 /** |
976 * @override | 979 * @override |
977 */ | 980 */ |
978 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { | 981 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { |
979 return viewport.getInverseTransformForRotatedImage(this.orientation_); | 982 return viewport.getInverseTransformForRotatedImage(this.orientation_); |
980 }; | 983 }; |
OLD | NEW |