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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * The overlay displaying the image. | 8 * The overlay displaying the image. |
9 * | 9 * |
10 * @param {HTMLElement} container The container element. | 10 * @param {HTMLElement} container The container element. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 this.displayedContentGeneration_ = this.contentGeneration_; | 119 this.displayedContentGeneration_ = this.contentGeneration_; |
120 | 120 |
121 ImageUtil.trace.resetTimer('paint'); | 121 ImageUtil.trace.resetTimer('paint'); |
122 this.paintDeviceRect(this.viewport_.getDeviceClipped(), | 122 this.paintDeviceRect(this.viewport_.getDeviceClipped(), |
123 this.contentCanvas_, this.viewport_.getImageClipped()); | 123 this.contentCanvas_, this.viewport_.getImageClipped()); |
124 ImageUtil.trace.reportTimer('paint'); | 124 ImageUtil.trace.reportTimer('paint'); |
125 } | 125 } |
126 }; | 126 }; |
127 | 127 |
128 /** | 128 /** |
| 129 * Applies the viewport change that does not affect the screen cache size (zoom |
| 130 * change or offset change) with animation. |
| 131 */ |
| 132 ImageView.prototype.applyViewportChange = function() { |
| 133 this.setTransform( |
| 134 this.screenImage_, |
| 135 new ImageView.Effect.None(), |
| 136 ImageView.Effect.DEFAULT_DURATION); |
| 137 }; |
| 138 |
| 139 /** |
129 * @return {number} The cache generation. | 140 * @return {number} The cache generation. |
130 */ | 141 */ |
131 ImageView.prototype.getCacheGeneration = function() { | 142 ImageView.prototype.getCacheGeneration = function() { |
132 return this.contentGeneration_; | 143 return this.contentGeneration_; |
133 }; | 144 }; |
134 | 145 |
135 /** | 146 /** |
136 * Invalidates the caches to force redrawing the screen canvas. | 147 * Invalidates the caches to force redrawing the screen canvas. |
137 */ | 148 */ |
138 ImageView.prototype.invalidateCaches = function() { | 149 ImageView.prototype.invalidateCaches = function() { |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 }; | 962 }; |
952 | 963 |
953 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; | 964 ImageView.Effect.Rotate.prototype = { __proto__: ImageView.Effect.prototype }; |
954 | 965 |
955 /** | 966 /** |
956 * @override | 967 * @override |
957 */ | 968 */ |
958 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { | 969 ImageView.Effect.Rotate.prototype.transform = function(element, viewport) { |
959 return viewport.getInverseTransformForRotatedImage(this.orientation_); | 970 return viewport.getInverseTransformForRotatedImage(this.orientation_); |
960 }; | 971 }; |
OLD | NEW |