Index: content/common/gpu/gpu_command_buffer_stub.cc |
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc |
index 047fb955513453222d38d3dbeee731286f90d63b..8c5862a132f4391969c87601cdf46c2003c1595e 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -54,7 +54,6 @@ GpuCommandBufferStub::GpuCommandBufferStub( |
route_id_(route_id), |
software_(software), |
last_flush_count_(0), |
- allocation_(GpuMemoryAllocation::INVALID_RESOURCE_SIZE, true, true), |
parent_stub_for_initialization_(), |
parent_texture_for_initialization_(0), |
watchdog_(watchdog) { |
@@ -576,20 +575,13 @@ void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { |
void GpuCommandBufferStub::OnDiscardBackbuffer() { |
if (!surface_) |
return; |
- if (allocation_.suggest_have_frontbuffer) |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); |
- else |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_NONE); |
+ surface_->SetBackbufferAllocation(false); |
} |
void GpuCommandBufferStub::OnEnsureBackbuffer() { |
if (!surface_) |
return; |
- // TODO(mmocny): Support backbuffer without frontbuffer. |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
+ surface_->SetBackbufferAllocation(true); |
} |
void GpuCommandBufferStub::SendConsoleMessage( |
@@ -630,16 +622,12 @@ const GpuCommandBufferStubBase::SurfaceState& |
return *surface_state_.get(); |
} |
-void GpuCommandBufferStub::SendMemoryAllocationToProxy( |
- const GpuMemoryAllocation& allocation) { |
- Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); |
-} |
- |
void GpuCommandBufferStub::SetMemoryAllocation( |
const GpuMemoryAllocation& allocation) { |
- allocation_ = allocation; |
- |
- SendMemoryAllocationToProxy(allocation); |
+ Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); |
+ if (!surface_) |
+ return; |
+ surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); |
} |
#endif // defined(ENABLE_GPU) |