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_GPU_IMAGE_DECODE_CACHE_H_ | 5 #ifndef CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ |
6 #define CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ | 6 #define CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 bool GetOutOfRasterDecodeTaskForImageAndRef( | 117 bool GetOutOfRasterDecodeTaskForImageAndRef( |
118 const DrawImage& image, | 118 const DrawImage& image, |
119 scoped_refptr<TileTask>* task) override; | 119 scoped_refptr<TileTask>* task) override; |
120 void UnrefImage(const DrawImage& image) override; | 120 void UnrefImage(const DrawImage& image) override; |
121 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& draw_image) override; | 121 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& draw_image) override; |
122 void DrawWithImageFinished(const DrawImage& image, | 122 void DrawWithImageFinished(const DrawImage& image, |
123 const DecodedDrawImage& decoded_image) override; | 123 const DecodedDrawImage& decoded_image) override; |
124 void ReduceCacheUsage() override; | 124 void ReduceCacheUsage() override; |
125 void SetShouldAggressivelyFreeResources( | 125 void SetShouldAggressivelyFreeResources( |
126 bool aggressively_free_resources) override; | 126 bool aggressively_free_resources) override; |
| 127 void ClearCache() override; |
127 | 128 |
128 // MemoryDumpProvider overrides. | 129 // MemoryDumpProvider overrides. |
129 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 130 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
130 base::trace_event::ProcessMemoryDump* pmd) override; | 131 base::trace_event::ProcessMemoryDump* pmd) override; |
131 | 132 |
132 // base::MemoryCoordinatorClient overrides. | 133 // base::MemoryCoordinatorClient overrides. |
133 void OnMemoryStateChange(base::MemoryState state) override; | 134 void OnMemoryStateChange(base::MemoryState state) override; |
134 void OnPurgeMemory() override; | 135 void OnPurgeMemory() override; |
135 | 136 |
136 // Called by Decode / Upload tasks. | 137 // Called by Decode / Upload tasks. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 349 |
349 // We can't release GPU backed SkImages without holding the context lock, | 350 // We can't release GPU backed SkImages without holding the context lock, |
350 // so we add them to this list and defer deletion until the next time the lock | 351 // so we add them to this list and defer deletion until the next time the lock |
351 // is held. | 352 // is held. |
352 std::vector<sk_sp<SkImage>> images_pending_deletion_; | 353 std::vector<sk_sp<SkImage>> images_pending_deletion_; |
353 }; | 354 }; |
354 | 355 |
355 } // namespace cc | 356 } // namespace cc |
356 | 357 |
357 #endif // CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ | 358 #endif // CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ |
OLD | NEW |