Index: cc/test/test_delegating_output_surface.cc |
diff --git a/cc/test/test_delegating_output_surface.cc b/cc/test/test_delegating_output_surface.cc |
index 64a15fde20b2342dd5d5784f86ef0d09b8a96123..9536801436b91ffde8d164f3a00a788dd9bc5afb 100644 |
--- a/cc/test/test_delegating_output_surface.cc |
+++ b/cc/test/test_delegating_output_surface.cc |
@@ -110,17 +110,28 @@ void TestDelegatingOutputSurface::SwapBuffers(CompositorFrame frame) { |
frame.delegated_frame_data->render_pass_list.back()->output_rect.size(); |
display_->Resize(frame_size); |
+ bool synchronous = !display_->has_scheduler(); |
+ |
surface_factory_->SubmitCompositorFrame( |
delegated_surface_id_, std::move(frame), |
base::Bind(&TestDelegatingOutputSurface::DrawCallback, |
- weak_ptrs_.GetWeakPtr())); |
+ weak_ptrs_.GetWeakPtr(), synchronous)); |
if (!display_->has_scheduler()) |
display_->DrawAndSwap(); |
} |
-void TestDelegatingOutputSurface::DrawCallback() { |
- client_->DidSwapBuffersComplete(); |
+void TestDelegatingOutputSurface::DrawCallback(bool synchronous) { |
+ // This is the frame ack to unthrottle the next frame, not actually a notice |
+ // that drawing is done. |
+ if (synchronous) { |
+ // For synchronous draws, this must be posted to a new stack because we are |
+ // still the original call to SwapBuffers, and we want to leave that before |
+ // saying that it is done. |
+ OutputSurface::PostSwapBuffersComplete(); |
+ } else { |
+ client_->DidSwapBuffersComplete(); |
+ } |
} |
void TestDelegatingOutputSurface::ForceReclaimResources() { |