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 96ca0ea68ab85ff030ddaac2a1a4a1494614602e..5d4f818f1430644c2ef6f31230116a9f72524bc5 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -123,6 +123,10 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) { |
OnDestroyVideoDecoder) |
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetSurfaceVisible, |
OnSetSurfaceVisible) |
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateBackbuffer, |
+ OnCreateBackbuffer) |
+ IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyBackbuffer, |
+ OnDestroyBackbuffer) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP() |
@@ -563,15 +567,29 @@ void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { |
} |
void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { |
- if (visible) |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
DCHECK(surface_state_.get()); |
surface_state_->visible = visible; |
surface_state_->last_used_time = base::TimeTicks::Now(); |
channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage(); |
} |
+void GpuCommandBufferStub::OnCreateBackbuffer() { |
+ printf(" [%i - %p] %s\n", getpid(), this, __PRETTY_FUNCTION__); |
mmocny
2012/03/15 19:11:43
printfs will be removed..
|
+ DCHECK(surface_); |
+ surface_->SetBufferAllocation( |
+ gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
mmocny
2012/03/15 19:11:43
I will decouple front/back buffer management, but
|
+} |
+ |
+void GpuCommandBufferStub::OnDestroyBackbuffer() { |
+ printf(" [%i - %p] %s\n", getpid(), this, __PRETTY_FUNCTION__); |
+ DCHECK(surface_); |
+ // TODO(mmocny): Decouple frontbuffer drop from backbuffer drop. |
+ surface_->SetBufferAllocation( |
+ (allocation_.suggest_have_frontbuffer) ? |
mmocny
2012/03/15 19:11:43
Ditto here for decoupling. As is, we wait for ren
|
+ gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY : |
+ gfx::GLSurface::BUFFER_ALLOCATION_NONE); |
+} |
+ |
void GpuCommandBufferStub::SendConsoleMessage( |
int32 id, |
const std::string& message) { |
@@ -622,18 +640,6 @@ void GpuCommandBufferStub::SetMemoryAllocation( |
allocation_ = allocation; |
SendMemoryAllocationToProxy(allocation); |
- |
- if (!surface_) |
- return; |
- if (allocation.has_frontbuffer && allocation.has_backbuffer) |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); |
- else if (allocation.has_frontbuffer) |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); |
- else |
- surface_->SetBufferAllocation( |
- gfx::GLSurface::BUFFER_ALLOCATION_NONE); |
} |
#endif // defined(ENABLE_GPU) |