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

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

Issue 2130953002: WebView: Immediately ack and return resources for fallback ticks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@displaywebview
Patch Set: bosthing: . 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b5b7ee9c00ce59354d8c9f551efbaa55428db4d5..7919e83ab878b30f6e8019809ec86b2974d74fd5 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -197,6 +197,15 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
DCHECK(CalledOnValidThread());
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);
+ return;
+ }
+
cc::CompositorFrame swap_frame;
if (in_software_draw_) {
@@ -220,13 +229,13 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
delegated_surface_id_, std::move(frame), base::Bind(&NoOpDrawCallback));
display_->DrawAndSwap();
} else {
+ // For hardware draws we send the whole frame to the client so it can draw
+ // the content in it.
swap_frame = std::move(frame);
}
- if (!fallback_tick_running_) {
- sync_client_->SwapBuffers(output_surface_id_, std::move(swap_frame));
- DeliverMessages();
- }
+ sync_client_->SwapBuffers(output_surface_id_, std::move(swap_frame));
+ DeliverMessages();
client_->DidSwapBuffers();
did_swap_ = true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698