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

Unified Diff: gpu/command_buffer/client/mapped_memory.cc

Issue 8369010: Add GLES2Implemention::FreeUnusedSharedMemory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.h ('k') | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/mapped_memory.cc
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index 689b576b9d8b49631746817e3e6a180b3ad8c750..461343e25a0f8a012c64be04ea0f4877fbf8feba 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -88,6 +88,21 @@ void MappedMemoryManager::FreePendingToken(void* pointer, int32 token) {
GPU_NOTREACHED();
}
+void MappedMemoryManager::FreeUnused() {
+ CommandBuffer* cmd_buf = helper_->command_buffer();
+ MemoryChunkVector::iterator iter = chunks_.begin();
+ while (iter != chunks_.end()) {
+ MemoryChunk* chunk = *iter;
+ chunk->FreeUnused();
+ if (!chunk->InUse()) {
+ cmd_buf->DestroyTransferBuffer(chunk->shm_id());
+ iter = chunks_.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+}
+
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.h ('k') | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698