| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 void ClearCache() override; |
| 128 size_t GetMaximumMemoryLimitBytes() const override; | 128 size_t GetMaximumMemoryLimitBytes() const override; |
| 129 void NotifyImageUnused(uint32_t skimage_id) override; |
| 129 | 130 |
| 130 // MemoryDumpProvider overrides. | 131 // MemoryDumpProvider overrides. |
| 131 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 132 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 132 base::trace_event::ProcessMemoryDump* pmd) override; | 133 base::trace_event::ProcessMemoryDump* pmd) override; |
| 133 | 134 |
| 134 // base::MemoryCoordinatorClient overrides. | 135 // base::MemoryCoordinatorClient overrides. |
| 135 void OnMemoryStateChange(base::MemoryState state) override; | 136 void OnMemoryStateChange(base::MemoryState state) override; |
| 136 void OnPurgeMemory() override; | 137 void OnPurgeMemory() override; |
| 137 | 138 |
| 138 // Called by Decode / Upload tasks. | 139 // Called by Decode / Upload tasks. |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 375 |
| 375 // We can't release GPU backed SkImages without holding the context lock, | 376 // We can't release GPU backed SkImages without holding the context lock, |
| 376 // so we add them to this list and defer deletion until the next time the lock | 377 // so we add them to this list and defer deletion until the next time the lock |
| 377 // is held. | 378 // is held. |
| 378 std::vector<sk_sp<SkImage>> images_pending_deletion_; | 379 std::vector<sk_sp<SkImage>> images_pending_deletion_; |
| 379 }; | 380 }; |
| 380 | 381 |
| 381 } // namespace cc | 382 } // namespace cc |
| 382 | 383 |
| 383 #endif // CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ | 384 #endif // CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ |
| OLD | NEW |