Chromium Code Reviews| 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 /** | 5 /** |
| 6 * Object representing an image item (a photo). | 6 * Object representing an image item (a photo). |
| 7 * | 7 * |
| 8 * @param {!FileEntry} entry Image entry. | 8 * @param {!FileEntry} entry Image entry. |
| 9 * @param {!EntryLocation} locationInfo Entry location information. | 9 * @param {!EntryLocation} locationInfo Entry location information. |
| 10 * @param {!Object} metadata Metadata for the entry. | 10 * @param {!Object} metadata Metadata for the entry. |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 * @const | 39 * @const |
| 40 */ | 40 */ |
| 41 this.metadataCache_ = metadataCache; | 41 this.metadataCache_ = metadataCache; |
| 42 | 42 |
| 43 // TODO(yawano): Change this.contentImage and this.screenImage to private | 43 // TODO(yawano): Change this.contentImage and this.screenImage to private |
| 44 // fields and provide utility methods for them (e.g. revokeFullImageCache). | 44 // fields and provide utility methods for them (e.g. revokeFullImageCache). |
| 45 /** | 45 /** |
| 46 * The content cache is used for prefetching the next image when going through | 46 * The content cache is used for prefetching the next image when going through |
| 47 * the images sequentially. The real life photos can be large (18Mpix = 72Mb | 47 * the images sequentially. The real life photos can be large (18Mpix = 72Mb |
| 48 * pixel array) so we want only the minimum amount of caching. | 48 * pixel array) so we want only the minimum amount of caching. |
| 49 * @type {HTMLCanvasElement} | 49 * @type {(HTMLCanvasElement|Image)} |
|
fukino
2014/12/10 02:54:19
You can use HTMLImageElement instead of Image.
Cou
yawano
2014/12/10 06:02:49
Done.
| |
| 50 */ | 50 */ |
| 51 this.contentImage = null; | 51 this.contentImage = null; |
| 52 | 52 |
| 53 /** | 53 /** |
| 54 * We reuse previously generated screen-scale images so that going back to a | 54 * We reuse previously generated screen-scale images so that going back to a |
| 55 * recently loaded image looks instant even if the image is not in the content | 55 * recently loaded image looks instant even if the image is not in the content |
| 56 * cache any more. Screen-scale images are small (~1Mpix) so we can afford to | 56 * cache any more. Screen-scale images are small (~1Mpix) so we can afford to |
| 57 * cache more of them. | 57 * cache more of them. |
| 58 * @type {HTMLCanvasElement} | 58 * @type {HTMLCanvasElement} |
| 59 */ | 59 */ |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 return Promise.reject(str('GALLERY_FILE_EXISTS')); | 354 return Promise.reject(str('GALLERY_FILE_EXISTS')); |
| 355 }, function() { | 355 }, function() { |
| 356 return new Promise( | 356 return new Promise( |
| 357 this.entry_.moveTo.bind(this.entry_, parentDirectory, newFileName)); | 357 this.entry_.moveTo.bind(this.entry_, parentDirectory, newFileName)); |
| 358 }.bind(this)); | 358 }.bind(this)); |
| 359 }.bind(this)); | 359 }.bind(this)); |
| 360 }.bind(this)).then(function(entry) { | 360 }.bind(this)).then(function(entry) { |
| 361 this.entry_ = entry; | 361 this.entry_ = entry; |
| 362 }.bind(this)); | 362 }.bind(this)); |
| 363 }; | 363 }; |
| OLD | NEW |