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

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

Issue 1370683003: Gallery: resize image data to overlay canvas size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove blank line. Created 5 years, 3 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
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/image_editor/image_view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/image_editor/image_adjust.js
diff --git a/ui/file_manager/gallery/js/image_editor/image_adjust.js b/ui/file_manager/gallery/js/image_editor/image_adjust.js
index 7d79e0470a1e8b7af2bf8d866c0ee7fb70923a52..5592c61fb9eaa16ec7ea7df251aa5805bc1bdb46 100644
--- a/ui/file_manager/gallery/js/image_editor/image_adjust.js
+++ b/ui/file_manager/gallery/js/image_editor/image_adjust.js
@@ -45,15 +45,14 @@ ImageEditor.Mode.Adjust = function(name, title) {
this.canvas_ = null;
/**
- * @type {ImageData}
- * @private
+ * @private {ImageData}
*/
this.previewImageData_ = null;
/**
- * @type {ImageData}
+ * @private {ImageData}
*/
- this.originalImageData = null;
+ this.originalImageData_ = null;
};
ImageEditor.Mode.Adjust.prototype = {__proto__: ImageEditor.Mode.prototype};
@@ -133,8 +132,10 @@ ImageEditor.Mode.Adjust.prototype.updatePreviewImage_ = function(options) {
this.canvas_ = this.getImageView().createOverlayCanvas();
this.getImageView().setupDeviceBuffer(this.canvas_);
- this.originalImageData = this.getImageView().copyScreenImageData();
- this.previewImageData_ = this.getImageView().copyScreenImageData();
+ this.originalImageData_ = this.getImageView().getScreenImageDataWith(
+ this.canvas_.width, this.canvas_.height);
+ this.previewImageData_ = this.getImageView().getScreenImageDataWith(
+ this.canvas_.width, this.canvas_.height);
isPreviewImageInvalidated = true;
} else {
@@ -144,11 +145,11 @@ ImageEditor.Mode.Adjust.prototype.updatePreviewImage_ = function(options) {
// Update preview image with applying filter.
if (isPreviewImageInvalidated) {
- assert(this.originalImageData);
+ assert(this.originalImageData_);
assert(this.previewImageData_);
ImageUtil.trace.resetTimer('preview');
- this.filter_(this.previewImageData_, this.originalImageData, 0, 0);
+ this.filter_(this.previewImageData_, this.originalImageData_, 0, 0);
ImageUtil.trace.reportTimer('preview');
this.canvas_.getContext('2d').putImageData(this.previewImageData_, 0, 0);
« no previous file with comments | « no previous file | ui/file_manager/gallery/js/image_editor/image_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698