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

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: split raf-stall fix 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 b5392270f199015d5d2d6ce148fbd7162eb69d01..e563b6061453b039c23b1da569c2ab93c2ef7679 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -384,25 +384,27 @@ void GpuCommandBufferStub::SwapBuffersCallback() {
void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped(
uint64 swap_buffers_count) {
- TRACE_EVENT0("gpu",
- "GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped");
-
- // 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();
+ TRACE_EVENT1("gpu",
+ "GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped",
+ "frame", swap_buffers_count);
+ OnSwapBuffers();
scheduler_->set_acknowledged_swap_buffers_count(swap_buffers_count);
-
- for(uint64 i = 0; i < delta; i++)
- OnSwapBuffers();
-
// 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