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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 6993043: Fix the mac hangup when force-compositing-mode is enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 6 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/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 6b780be93b4d7bd3a48f69c4beaac0320fe65e88..a677337a6100e5720b6b136a7bda239c40262398 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -393,25 +393,35 @@ void GpuCommandBufferStub::SwapBuffersCallback() {
void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped(
uint64 swap_buffers_count) {
- TRACE_EVENT0("gpu",
- "GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped");
+ TRACE_EVENT1("gpu",
+ "GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped",
+ "frame", swap_buffers_count);
// Multiple swapbuffers may get consolidated together into a single
// AcceleratedSurfaceBuffersSwapped call. Since OnSwapBuffers expects to be
// called one time for every swap, make up the difference here.
uint64 delta = swap_buffers_count -
scheduler_->acknowledged_swap_buffers_count();
-
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);
+ }
}
#endif // defined(OS_MACOSX)
+void GpuCommandBufferStub::CommandBufferWasDestroyed() {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::CommandBufferWasDestroyed");
+ // In case the renderer is currently blocked waiting for a sync reply from
+ // the stub, this method allows us to cleanup and unblock pending messages.
+ while (!scheduler_->IsScheduled())
+ scheduler_->SetScheduled(true);
+ // Handle any deferred messages now that the scheduler is scheduled.
+ HandleDeferredMessages();
+}
+
void GpuCommandBufferStub::ResizeCallback(gfx::Size size) {
if (handle_ == gfx::kNullPluginWindow) {
scheduler_->decoder()->ResizeOffscreenFrameBuffer(size);

Powered by Google App Engine
This is Rietveld 408576698