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

Unified Diff: ui/file_manager/gallery/js/image_editor/viewport.js

Issue 382143004: Remove repaint callbacks from Viewport. (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 side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/gallery/js/image_editor/viewport.js
diff --git a/ui/file_manager/gallery/js/image_editor/viewport.js b/ui/file_manager/gallery/js/image_editor/viewport.js
index 1c41bdc082ee4e94399ff0906bd01efa56571f5f..4e5adfc96b63da8e5c911a5961049edf2eae03b1 100644
--- a/ui/file_manager/gallery/js/image_editor/viewport.js
+++ b/ui/file_manager/gallery/js/image_editor/viewport.js
@@ -35,7 +35,6 @@ function Viewport() {
this.generation_ = 0;
- this.repaintCallbacks_ = [];
this.update();
}
@@ -180,15 +179,10 @@ Viewport.prototype.createOffsetSetter = function(
self.setOffset(
originalOffsetX + (x - originalX) / scale,
originalOffsetY + (y - originalY) / scale);
- self.repaint();
}
};
};
-/*
- * Access to the current viewport state.
- */
-
/**
* @return {Rect} The image bounds in image coordinates.
*/
@@ -220,7 +214,7 @@ Viewport.prototype.getScreenClipped = function() {
Viewport.prototype.getCacheGeneration = function() { return this.generation_; };
/**
- * Called on event view port state change (even if repaint has not been called).
+ * Called on event view port state change.
*/
Viewport.prototype.invalidateCaches = function() { this.generation_++; };
@@ -231,10 +225,6 @@ Viewport.prototype.getImageBoundsOnScreen = function() {
return this.imageOnScreen_;
};
-/*
- * Conversion between the screen and image coordinate spaces.
- */
-
/**
* @param {number} size Size in screen coordinates.
* @return {number} Size in image coordinates.
@@ -424,22 +414,6 @@ Viewport.prototype.update = function() {
};
/**
- * @param {function} callback Repaint callback.
- */
-Viewport.prototype.addRepaintCallback = function(callback) {
- this.repaintCallbacks_.push(callback);
-};
-
-/**
- * Repaint all clients.
- */
-Viewport.prototype.repaint = function() {
- this.update();
- for (var i = 0; i != this.repaintCallbacks_.length; i++)
- this.repaintCallbacks_[i]();
-};
-
-/**
* Obtains CSS transformation for the screen image.
* @return {string} Transformation description.
*/

Powered by Google App Engine
This is Rietveld 408576698