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

Unified Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 2143263002: cc: Remove OutputSurfaceClient::DidSwapBuffers(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removedidswap: fix-webview-swap 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
Index: content/renderer/android/synchronous_compositor_output_surface.cc
diff --git a/content/renderer/android/synchronous_compositor_output_surface.cc b/content/renderer/android/synchronous_compositor_output_surface.cc
index 7919e83ab878b30f6e8019809ec86b2974d74fd5..f0445322b2bc0712c4c348b2cd9b1ffab4f8b39c 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -198,11 +198,10 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
DCHECK(sync_client_);
if (fallback_tick_running_) {
- client_->DidSwapBuffers();
- client_->DidSwapBuffersComplete();
DCHECK(frame.delegated_frame_data->resource_list.empty());
cc::ReturnedResourceArray return_resources;
ReturnResources(return_resources);
+ did_swap_ = true;
return;
}
@@ -236,7 +235,6 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
sync_client_->SwapBuffers(output_surface_id_, std::move(swap_frame));
DeliverMessages();
- client_->DidSwapBuffers();
did_swap_ = true;
}
@@ -333,8 +331,12 @@ void SynchronousCompositorOutputSurface::InvokeComposite(
did_swap_ = false;
client_->OnDraw(adjusted_transform, viewport, clip, in_software_draw_);
- if (did_swap_)
+ if (did_swap_) {
+ // This must happen after unwinding the stack and leaving the compositor.
+ // Usually it is a separate task but we just defer it until OnDraw completes
+ // instead.
client_->DidSwapBuffersComplete();
+ }
}
void SynchronousCompositorOutputSurface::OnReclaimResources(
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/renderer/gpu/compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698