| 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 41fa5e5a2ffd6158f1b6e13370cc69f961b1f879..1085040a1cf1e09017ffda29a7aba7229caa899e 100644
|
| --- a/content/common/gpu/gpu_command_buffer_stub.cc
|
| +++ b/content/common/gpu/gpu_command_buffer_stub.cc
|
| @@ -59,9 +59,6 @@ GpuCommandBufferStub::GpuCommandBufferStub(
|
| route_id_(route_id),
|
| software_(software),
|
| last_flush_count_(0),
|
| - allocation_(GpuMemoryAllocation::INVALID_RESOURCE_SIZE,
|
| - GpuMemoryAllocation::kHasFrontbuffer |
|
| - GpuMemoryAllocation::kHasBackbuffer),
|
| parent_stub_for_initialization_(),
|
| parent_texture_for_initialization_(0),
|
| watchdog_(watchdog) {
|
| @@ -578,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::OnSetClientHasMemoryAllocationChangedCallback(
|
| @@ -643,16 +633,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)
|
|
|