OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DECODE_CACHE_H_ | 5 #ifndef CC_TILES_IMAGE_DECODE_CACHE_H_ |
6 #define CC_TILES_IMAGE_DECODE_CACHE_H_ | 6 #define CC_TILES_IMAGE_DECODE_CACHE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/base/devtools_instrumentation.h" | 9 #include "cc/base/devtools_instrumentation.h" |
10 #include "cc/paint/draw_image.h" | 10 #include "cc/paint/draw_image.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 bool aggressively_free_resources) = 0; | 117 bool aggressively_free_resources) = 0; |
118 | 118 |
119 // Clears all elements from the cache. | 119 // Clears all elements from the cache. |
120 virtual void ClearCache() = 0; | 120 virtual void ClearCache() = 0; |
121 | 121 |
122 // Returns the maximum amount of memory we would be able to lock. This ignores | 122 // Returns the maximum amount of memory we would be able to lock. This ignores |
123 // any temporary states, such as throttled, and return the maximum possible | 123 // any temporary states, such as throttled, and return the maximum possible |
124 // memory. It is used as an esimate of whether an image can fit into the | 124 // memory. It is used as an esimate of whether an image can fit into the |
125 // locked budget before creating a task. | 125 // locked budget before creating a task. |
126 virtual size_t GetMaximumMemoryLimitBytes() const = 0; | 126 virtual size_t GetMaximumMemoryLimitBytes() const = 0; |
| 127 |
| 128 // Indicate to the cache that the image is no longer going |
| 129 // to be used. This means it can be deleted altogether. If the |
| 130 // image is locked, then the cache can do its best to clean it |
| 131 // up later. |
| 132 virtual void NotifyImageUnused(uint32_t skimage_id) = 0; |
127 }; | 133 }; |
128 | 134 |
129 } // namespace cc | 135 } // namespace cc |
130 | 136 |
131 #endif // CC_TILES_IMAGE_DECODE_CACHE_H_ | 137 #endif // CC_TILES_IMAGE_DECODE_CACHE_H_ |
OLD | NEW |