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

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

Issue 1268383003: Sync compositor: Ignore command buffer memory callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't touch remove Created 5 years, 4 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 cb827258a5fdf8c271bc0d3eb73874d9a5bc7fe4..ba9f0ebfbed6a6f75196c29a7bf89da933557773 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -105,9 +105,6 @@ bool ContextProviderCommandBuffer::BindToCurrentThread() {
context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str());
lost_context_callback_proxy_.reset(new LostContextCallbackProxy(this));
- context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
- base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged,
- base::Unretained(this)));
return true;
}
@@ -241,6 +238,13 @@ void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback(
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/browser/android/in_process/synchronous_compositor_factory_impl.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698