OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CC_TILES_IMAGE_CONTROLLER_H_ | 5 #ifndef CC_TILES_IMAGE_CONTROLLER_H_ |
6 #define CC_TILES_IMAGE_CONTROLLER_H_ | 6 #define CC_TILES_IMAGE_CONTROLLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // Virtual for testing. | 49 // Virtual for testing. |
50 virtual void UnlockImageDecode(ImageDecodeRequestId id); | 50 virtual void UnlockImageDecode(ImageDecodeRequestId id); |
51 | 51 |
52 // This function requests that the given image be decoded and locked. Once the | 52 // This function requests that the given image be decoded and locked. Once the |
53 // callback has been issued, it is passed an ID, which should be used to | 53 // callback has been issued, it is passed an ID, which should be used to |
54 // unlock this image. It is up to the caller to ensure that the image is later | 54 // unlock this image. It is up to the caller to ensure that the image is later |
55 // unlocked using UnlockImageDecode. | 55 // unlocked using UnlockImageDecode. |
56 // Virtual for testing. | 56 // Virtual for testing. |
57 virtual ImageDecodeRequestId QueueImageDecode( | 57 virtual ImageDecodeRequestId QueueImageDecode( |
58 sk_sp<const SkImage> image, | 58 const DrawImage& draw_image, |
59 const ImageDecodedCallback& callback); | 59 const ImageDecodedCallback& callback); |
60 size_t image_cache_max_limit_bytes() const { | 60 size_t image_cache_max_limit_bytes() const { |
61 return image_cache_max_limit_bytes_; | 61 return image_cache_max_limit_bytes_; |
62 } | 62 } |
63 | 63 |
64 void SetMaxImageCacheLimitBytesForTesting(size_t bytes) { | 64 void SetMaxImageCacheLimitBytesForTesting(size_t bytes) { |
65 image_cache_max_limit_bytes_ = bytes; | 65 image_cache_max_limit_bytes_ = bytes; |
66 } | 66 } |
67 | 67 |
68 protected: | 68 protected: |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 std::vector<ImageDecodeRequest> orphaned_decode_requests_; | 122 std::vector<ImageDecodeRequest> orphaned_decode_requests_; |
123 | 123 |
124 base::WeakPtrFactory<ImageController> weak_ptr_factory_; | 124 base::WeakPtrFactory<ImageController> weak_ptr_factory_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(ImageController); | 126 DISALLOW_COPY_AND_ASSIGN(ImageController); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace cc | 129 } // namespace cc |
130 | 130 |
131 #endif // CC_TILES_IMAGE_CONTROLLER_H_ | 131 #endif // CC_TILES_IMAGE_CONTROLLER_H_ |
OLD | NEW |