Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: cc/tiles/gpu_image_decode_cache.h

Issue 2648323005: memory coordinator: Add MemoryCoordinatorClient::OnPurgeMemory() (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void ReduceCacheUsage() override; 123 void ReduceCacheUsage() override;
124 void SetShouldAggressivelyFreeResources( 124 void SetShouldAggressivelyFreeResources(
125 bool aggressively_free_resources) override; 125 bool aggressively_free_resources) override;
126 126
127 // MemoryDumpProvider overrides. 127 // MemoryDumpProvider overrides.
128 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 128 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
129 base::trace_event::ProcessMemoryDump* pmd) override; 129 base::trace_event::ProcessMemoryDump* pmd) override;
130 130
131 // base::MemoryCoordinatorClient overrides. 131 // base::MemoryCoordinatorClient overrides.
132 void OnMemoryStateChange(base::MemoryState state) override; 132 void OnMemoryStateChange(base::MemoryState state) override;
133 void OnPurgeMemory() override;
133 134
134 // Called by Decode / Upload tasks. 135 // Called by Decode / Upload tasks.
135 void DecodeImage(const DrawImage& image); 136 void DecodeImage(const DrawImage& image);
136 void UploadImage(const DrawImage& image); 137 void UploadImage(const DrawImage& image);
137 138
138 // Called by Decode / Upload tasks when tasks are finished. 139 // Called by Decode / Upload tasks when tasks are finished.
139 void OnImageDecodeTaskCompleted(const DrawImage& image, 140 void OnImageDecodeTaskCompleted(const DrawImage& image,
140 DecodeTaskType task_type); 141 DecodeTaskType task_type);
141 void OnImageUploadTaskCompleted(const DrawImage& image); 142 void OnImageUploadTaskCompleted(const DrawImage& image);
142 143
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 343
343 // We can't release GPU backed SkImages without holding the context lock, 344 // We can't release GPU backed SkImages without holding the context lock,
344 // so we add them to this list and defer deletion until the next time the lock 345 // so we add them to this list and defer deletion until the next time the lock
345 // is held. 346 // is held.
346 std::vector<sk_sp<SkImage>> images_pending_deletion_; 347 std::vector<sk_sp<SkImage>> images_pending_deletion_;
347 }; 348 };
348 349
349 } // namespace cc 350 } // namespace cc
350 351
351 #endif // CC_TILES_GPU_IMAGE_DECODE_CACHE_H_ 352 #endif // CC_TILES_GPU_IMAGE_DECODE_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698