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

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: 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..e4409285f7a08eb841bc9d679a5540fbb8394857 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -43,15 +43,19 @@ ContextProviderCommandBuffer::Create(
if (!context3d)
return NULL;
- return new ContextProviderCommandBuffer(context3d.Pass(), type);
+ const bool enable_memory_allocation_callback = true;
+ return new ContextProviderCommandBuffer(context3d.Pass(), type,
+ enable_memory_allocation_callback);
}
ContextProviderCommandBuffer::ContextProviderCommandBuffer(
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context3d,
- CommandBufferContextType type)
+ CommandBufferContextType type,
+ bool enable_memory_allocation_callback)
: context3d_(context3d.Pass()),
context_type_(type),
debug_name_(CommandBufferContextTypeToString(type)),
+ enable_memory_allocation_callback_(enable_memory_allocation_callback),
destroyed_(false) {
DCHECK(main_thread_checker_.CalledOnValidThread());
DCHECK(context3d_);
@@ -105,9 +109,12 @@ 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)));
+
+ if (enable_memory_allocation_callback_) {
+ context3d_->GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(
+ base::Bind(&ContextProviderCommandBuffer::OnMemoryAllocationChanged,
+ base::Unretained(this)));
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698