| 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'; | |
| 6 | |
| 7 /** | 5 /** |
| 8 * Command queue is the only way to modify images. | 6 * Command queue is the only way to modify images. |
| 9 * Supports undo/redo. | 7 * Supports undo/redo. |
| 10 * Command execution is asynchronous (callback-based). | 8 * Command execution is asynchronous (callback-based). |
| 11 * | 9 * |
| 12 * @param {Document} document Document to create canvases in. | 10 * @param {Document} document Document to create canvases in. |
| 13 * @param {HTMLCanvasElement} canvas The canvas with the original image. | 11 * @param {HTMLCanvasElement} canvas The canvas with the original image. |
| 14 * @param {function(function())} saveFunction Function to save the image. | 12 * @param {function(function())} saveFunction Function to save the image. |
| 15 * @constructor | 13 * @constructor |
| 16 */ | 14 */ |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 442 |
| 445 function onProgressInvisible(updatedRow, rowCount) { | 443 function onProgressInvisible(updatedRow, rowCount) { |
| 446 if (updatedRow == rowCount) { | 444 if (updatedRow == rowCount) { |
| 447 callback(result); | 445 callback(result); |
| 448 } | 446 } |
| 449 } | 447 } |
| 450 | 448 |
| 451 filter.applyByStrips(result, srcCanvas, this.filter_, | 449 filter.applyByStrips(result, srcCanvas, this.filter_, |
| 452 uiContext.imageView ? onProgressVisible : onProgressInvisible); | 450 uiContext.imageView ? onProgressVisible : onProgressInvisible); |
| 453 }; | 451 }; |
| OLD | NEW |