| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 SoftwareImageDecodeCache(ResourceFormat format, | 123 SoftwareImageDecodeCache(ResourceFormat format, |
| 124 size_t locked_memory_limit_bytes); | 124 size_t locked_memory_limit_bytes); |
| 125 ~SoftwareImageDecodeCache() override; | 125 ~SoftwareImageDecodeCache() override; |
| 126 | 126 |
| 127 // ImageDecodeCache overrides. | 127 // ImageDecodeCache overrides. |
| 128 bool GetTaskForImageAndRef(const DrawImage& image, | 128 bool GetTaskForImageAndRef(const DrawImage& image, |
| 129 const TracingInfo& tracing_info, | 129 const TracingInfo& tracing_info, |
| 130 scoped_refptr<TileTask>* task) override; | 130 scoped_refptr<TileTask>* task) override; |
| 131 bool GetOutOfRasterDecodeTaskForImageAndRef( | 131 bool GetOutOfRasterDecodeTaskForImageAndRef( |
| 132 const DrawImage& image, | 132 const DrawImage& image, |
| 133 ImageDecodeType decode_type, |
| 133 scoped_refptr<TileTask>* task) override; | 134 scoped_refptr<TileTask>* task) override; |
| 134 void UnrefImage(const DrawImage& image) override; | 135 void UnrefImage(const DrawImage& image) override; |
| 135 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override; | 136 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override; |
| 136 void DrawWithImageFinished(const DrawImage& image, | 137 void DrawWithImageFinished(const DrawImage& image, |
| 137 const DecodedDrawImage& decoded_image) override; | 138 const DecodedDrawImage& decoded_image) override; |
| 138 void ReduceCacheUsage() override; | 139 void ReduceCacheUsage() override; |
| 139 // 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. |
| 140 void SetShouldAggressivelyFreeResources( | 141 void SetShouldAggressivelyFreeResources( |
| 141 bool aggressively_free_resources) override {} | 142 bool aggressively_free_resources) override {} |
| 142 void ClearCache() override; | 143 void ClearCache() override; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 ResourceFormat format_; | 324 ResourceFormat format_; |
| 324 size_t max_items_in_cache_; | 325 size_t max_items_in_cache_; |
| 325 | 326 |
| 326 // Used to uniquely identify DecodedImages for memory traces. | 327 // Used to uniquely identify DecodedImages for memory traces. |
| 327 base::AtomicSequenceNumber next_tracing_id_; | 328 base::AtomicSequenceNumber next_tracing_id_; |
| 328 }; | 329 }; |
| 329 | 330 |
| 330 } // namespace cc | 331 } // namespace cc |
| 331 | 332 |
| 332 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 333 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
| OLD | NEW |