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_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 5 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 void UnrefImage(const DrawImage& image) override; | 135 void UnrefImage(const DrawImage& image) override; |
136 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override; | 136 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override; |
137 void DrawWithImageFinished(const DrawImage& image, | 137 void DrawWithImageFinished(const DrawImage& image, |
138 const DecodedDrawImage& decoded_image) override; | 138 const DecodedDrawImage& decoded_image) override; |
139 void ReduceCacheUsage() override; | 139 void ReduceCacheUsage() override; |
140 // Software doesn't keep outstanding images pinned, so this is a no-op. | 140 // Software doesn't keep outstanding images pinned, so this is a no-op. |
141 void SetShouldAggressivelyFreeResources( | 141 void SetShouldAggressivelyFreeResources( |
142 bool aggressively_free_resources) override {} | 142 bool aggressively_free_resources) override {} |
143 void ClearCache() override; | 143 void ClearCache() override; |
144 size_t GetMaximumMemoryLimitBytes() const override; | 144 size_t GetMaximumMemoryLimitBytes() const override; |
| 145 void NotifyImageUnused(uint32_t skimage_id) override; |
145 | 146 |
146 // Decode the given image and store it in the cache. This is only called by an | 147 // Decode the given image and store it in the cache. This is only called by an |
147 // image decode task from a worker thread. | 148 // image decode task from a worker thread. |
148 void DecodeImage(const ImageKey& key, | 149 void DecodeImage(const ImageKey& key, |
149 const DrawImage& image, | 150 const DrawImage& image, |
150 DecodeTaskType task_type); | 151 DecodeTaskType task_type); |
151 | 152 |
152 void RemovePendingTask(const ImageKey& key, DecodeTaskType task_type); | 153 void RemovePendingTask(const ImageKey& key, DecodeTaskType task_type); |
153 | 154 |
154 // MemoryDumpProvider overrides. | 155 // MemoryDumpProvider overrides. |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 ResourceFormat format_; | 325 ResourceFormat format_; |
325 size_t max_items_in_cache_; | 326 size_t max_items_in_cache_; |
326 | 327 |
327 // Used to uniquely identify DecodedImages for memory traces. | 328 // Used to uniquely identify DecodedImages for memory traces. |
328 base::AtomicSequenceNumber next_tracing_id_; | 329 base::AtomicSequenceNumber next_tracing_id_; |
329 }; | 330 }; |
330 | 331 |
331 } // namespace cc | 332 } // namespace cc |
332 | 333 |
333 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 334 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
OLD | NEW |