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

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

Issue 9702081: Splitting GpuMemoryAllocation into two parts: for renderer and browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/command_buffer_proxy.cc
diff --git a/content/common/gpu/client/command_buffer_proxy.cc b/content/common/gpu/client/command_buffer_proxy.cc
index 25bee42417b3d7f4611dc7f458b14dd4a388895b..d4e1121a0bdd33baf78ccc8a605afd9c37e84269 100644
--- a/content/common/gpu/client/command_buffer_proxy.cc
+++ b/content/common/gpu/client/command_buffer_proxy.cc
@@ -98,14 +98,20 @@ void CommandBufferProxy::OnConsoleMessage(
}
void CommandBufferProxy::SetMemoryAllocationChangedCallback(
- const base::Callback<void(const GpuMemoryAllocation&)>& callback) {
+ const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
+ callback) {
memory_allocation_changed_callback_ = callback;
}
void CommandBufferProxy::OnSetMemoryAllocation(
- const GpuMemoryAllocation& allocation) {
+ const GpuMemoryAllocationForRenderer& allocation) {
if (!memory_allocation_changed_callback_.is_null())
memory_allocation_changed_callback_.Run(allocation);
+
+ if (allocation.suggest_have_backbuffer)
mmocny 2012/03/15 19:11:43 Send right away for now, but should be done via Gr
+ Send(new GpuCommandBufferMsg_CreateBackbuffer(route_id_));
+ else
+ Send(new GpuCommandBufferMsg_DestroyBackbuffer(route_id_));
}
void CommandBufferProxy::SetChannelErrorCallback(
@@ -363,7 +369,13 @@ bool CommandBufferProxy::SetSurfaceVisible(bool visible) {
if (last_state_.error != gpu::error::kNoError)
return false;
- return Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible));
+ bool ret = Send(new GpuCommandBufferMsg_SetSurfaceVisible(
+ route_id_, visible));
+ if (visible)
+ Send(new GpuCommandBufferMsg_CreateBackbuffer(route_id_));
+ else
+ Send(new GpuCommandBufferMsg_DestroyBackbuffer(route_id_));
+ return ret;
}
bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer,

Powered by Google App Engine
This is Rietveld 408576698