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/paint/draw_image.h" | 9 #include "cc/paint/draw_image.h" |
10 #include "cc/tiles/decoded_draw_image.h" | 10 #include "cc/tiles/decoded_draw_image.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // memory. This is called periodically from the compositor thread. | 89 // memory. This is called periodically from the compositor thread. |
90 virtual void ReduceCacheUsage() = 0; | 90 virtual void ReduceCacheUsage() = 0; |
91 | 91 |
92 // This function informs the cache that we are hidden and should not be | 92 // This function informs the cache that we are hidden and should not be |
93 // retaining cached resources longer than needed. | 93 // retaining cached resources longer than needed. |
94 virtual void SetShouldAggressivelyFreeResources( | 94 virtual void SetShouldAggressivelyFreeResources( |
95 bool aggressively_free_resources) = 0; | 95 bool aggressively_free_resources) = 0; |
96 | 96 |
97 // Clears all elements from the cache. | 97 // Clears all elements from the cache. |
98 virtual void ClearCache() = 0; | 98 virtual void ClearCache() = 0; |
| 99 |
| 100 // Returns the maximum amount of memory we would be able to lock. This ignores |
| 101 // any temporary states, such as throttled, and return the maximum possible |
| 102 // memory. It is used as an esimate of whether an image can fit into the |
| 103 // locked budget before creating a task. |
| 104 virtual size_t GetMaximumMemoryLimitBytes() const = 0; |
99 }; | 105 }; |
100 | 106 |
101 } // namespace cc | 107 } // namespace cc |
102 | 108 |
103 #endif // CC_TILES_IMAGE_DECODE_CACHE_H_ | 109 #endif // CC_TILES_IMAGE_DECODE_CACHE_H_ |
OLD | NEW |