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 b5392270f199015d5d2d6ce148fbd7162eb69d01..e9d30a78c3494406b06e1e47efddaddbe781adc0 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -395,14 +395,25 @@ void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped( |
scheduler_->set_acknowledged_swap_buffers_count(swap_buffers_count); |
- for(uint64 i = 0; i < delta; i++) |
+ for(uint64 i = 0; i < delta; i++) { |
OnSwapBuffers(); |
- // Wake up the GpuScheduler to start doing work again. |
- scheduler_->SetScheduled(true); |
+ // Wake up the GpuScheduler to start doing work again. |
+ scheduler_->SetScheduled(true); |
jbates
2011/06/07 16:47:52
This was a bug that would allow the scheduled_coun
|
+ } |
} |
#endif // defined(OS_MACOSX) |
+void GpuCommandBufferStub::CommandBufferWasDestroyed() { |
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::CommandBufferWasDestroyed"); |
+ while (!scheduler_->IsScheduled()) |
+ scheduler_->SetScheduled(true); |
+ // Handle all deferred messages now, because the stub route is about to be |
+ // removed by the GpuChannel. The PostTask handling may not work if the route |
+ // is already removed. |
+ HandleDeferredMessages(); |
+} |
+ |
void GpuCommandBufferStub::ResizeCallback(gfx::Size size) { |
if (handle_ == gfx::kNullPluginWindow) { |
scheduler_->decoder()->ResizeOffscreenFrameBuffer(size); |