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

Unified Diff: cc/test/test_delegating_output_surface.cc

Issue 2183333003: cc: Post the missed BeginFrame to a new stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: post-swapcomplete: comment Created 4 years, 5 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
« no previous file with comments | « cc/test/test_delegating_output_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « cc/test/test_delegating_output_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698