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

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

Issue 2866973003: Fix global dumps to be dumped only when shared memory is actually used
Patch Set: Remove change for GpuMemoryBuffer Created 3 years, 7 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 | gpu/command_buffer/client/cmd_buffer_helper.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 auto shared_buffer_guid = 117 auto shared_buffer_guid =
118 gpu_memory_buffer->GetGUIDForTracing(tracing_process_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
122 // the tracing UI will account the effective size of the buffer to the child. 122 // dumps). the tracing UI will account the effective size of the buffer to
123 // the child.
123 const int kImportance = 2; 124 const int kImportance = 2;
124 pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance); 125 pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance);
125 } 126 }
126 127
127 StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner, 128 StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner,
128 ContextProvider* worker_context_provider, 129 ContextProvider* worker_context_provider,
129 ResourceProvider* resource_provider, 130 ResourceProvider* resource_provider,
130 bool use_partial_raster, 131 bool use_partial_raster,
131 int max_staging_buffer_usage_in_bytes) 132 int max_staging_buffer_usage_in_bytes)
132 : task_runner_(task_runner), 133 : task_runner_(task_runner),
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 434 }
434 } 435 }
435 436
436 void StagingBufferPool::OnPurgeMemory() { 437 void StagingBufferPool::OnPurgeMemory() {
437 base::AutoLock lock(lock_); 438 base::AutoLock lock(lock_);
438 // Release all buffers, regardless of how recently they were used. 439 // Release all buffers, regardless of how recently they were used.
439 ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max()); 440 ReleaseBuffersNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
440 } 441 }
441 442
442 } // namespace cc 443 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/cmd_buffer_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698