Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: ui/file_manager/gallery/js/image_editor/image_view.js

Issue 395083002: Gallery: Add animation when zooming pictures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/image_editor/viewport.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/image_editor/viewport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698