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

Unified Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 1324413003: Move gpu memory calculations to Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment + android_arm64_dbg_recipe bot issue. Created 5 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
Index: content/common/gpu/client/context_provider_command_buffer.cc
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
index f7b2c855e1076780bd63ea4f7b494d0486c35d85..c215dba22f4e2ec5ba33214e8f2ce9273d54ff34 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -63,11 +63,8 @@ ContextProviderCommandBuffer::~ContextProviderCommandBuffer() {
base::AutoLock lock(main_thread_lock_);
// Destroy references to the context3d_ before leaking it.
- if (context3d_->GetCommandBufferProxy()) {
+ if (context3d_->GetCommandBufferProxy())
context3d_->GetCommandBufferProxy()->SetLock(nullptr);
- context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
- CommandBufferProxyImpl::MemoryAllocationChangedCallback());
- }
lost_context_callback_proxy_.reset();
}
@@ -193,16 +190,6 @@ void ContextProviderCommandBuffer::OnLostContext() {
gr_context_->OnLostContext();
}
-void ContextProviderCommandBuffer::OnMemoryAllocationChanged(
- const gpu::MemoryAllocation& allocation) {
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- if (memory_policy_changed_callback_.is_null())
- return;
-
- memory_policy_changed_callback_.Run(cc::ManagedMemoryPolicy(allocation));
-}
-
void ContextProviderCommandBuffer::InitializeCapabilities() {
Capabilities caps;
caps.gpu = context3d_->GetImplementation()->capabilities();
@@ -230,19 +217,4 @@ void ContextProviderCommandBuffer::SetLostContextCallback(
lost_context_callback_ = lost_context_callback;
}
-void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback(
- const MemoryPolicyChangedCallback& memory_policy_changed_callback) {
- DCHECK(context_thread_checker_.CalledOnValidThread());
- DCHECK(memory_policy_changed_callback_.is_null() ||
- memory_policy_changed_callback.is_null());
- memory_policy_changed_callback_ = memory_policy_changed_callback;
-
- if (!memory_policy_changed_callback_.is_null()) {
- DCHECK(context3d_->GetCommandBufferProxy());
- context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
- base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged,
- base::Unretained(this)));
- }
-}
-
} // namespace content
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698