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

Side by Side Diff: cc/raster/staging_buffer_pool.cc

Issue 2819803002: Reorganize GUIDs for GPU memory buffers (Closed)
Patch Set: Address on reviews Created 3 years, 8 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
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "cc/raster/staging_buffer_pool.h" 5 #include "cc/raster/staging_buffer_pool.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/memory_coordinator_client_registry.h" 9 #include "base/memory/memory_coordinator_client_registry.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 buffer_dump->AddScalar(MemoryAllocatorDump::kNameSize, 107 buffer_dump->AddScalar(MemoryAllocatorDump::kNameSize,
108 MemoryAllocatorDump::kUnitsBytes, 108 MemoryAllocatorDump::kUnitsBytes,
109 buffer_size_in_bytes); 109 buffer_size_in_bytes);
110 buffer_dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes, 110 buffer_dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes,
111 in_free_list ? buffer_size_in_bytes : 0); 111 in_free_list ? buffer_size_in_bytes : 0);
112 112
113 // Emit an ownership edge towards a global allocator dump node. 113 // Emit an ownership edge towards a global allocator dump node.
114 const uint64_t tracing_process_id = 114 const uint64_t tracing_process_id =
115 base::trace_event::MemoryDumpManager::GetInstance() 115 base::trace_event::MemoryDumpManager::GetInstance()
116 ->GetTracingProcessId(); 116 ->GetTracingProcessId();
117 MemoryAllocatorDumpGuid shared_buffer_guid = 117 auto shared_buffer_guid =
118 gfx::GetGpuMemoryBufferGUIDForTracing(tracing_process_id, buffer_id); 118 gpu_memory_buffer->GetGUIDForTracing(tracing_process_id);
119 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); 119 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid);
120 120
121 // By creating an edge with a higher |importance| (w.r.t. browser-side dumps) 121 // By creating an edge with a higher |importance| (w.r.t. browser-side dumps)
122 // the tracing UI will account the effective size of the buffer to the child. 122 // the tracing UI will account the effective size of the buffer to the child.
123 const int kImportance = 2; 123 const int kImportance = 2;
124 pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance); 124 pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance);
125 } 125 }
126 126
127 StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner, 127 StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner,
128 ContextProvider* worker_context_provider, 128 ContextProvider* worker_context_provider,
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 } 432 }
433 } 433 }
434 434
435 void StagingBufferPool::OnPurgeMemory() { 435 void StagingBufferPool::OnPurgeMemory() {
436 base::AutoLock lock(lock_); 436 base::AutoLock lock(lock_);
437 // Release all buffers, regardless of how recently they were used. 437 // Release all buffers, regardless of how recently they were used.
438 ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max()); 438 ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
439 } 439 }
440 440
441 } // namespace cc 441 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698