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

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: 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 d42d3de65465ee231350c2fd9707443b45a3fe9b..2d3b60921979154b2e7d7247a727c13ee04c2512 100644
--- a/content/renderer/android/synchronous_compositor_output_surface.cc
+++ b/content/renderer/android/synchronous_compositor_output_surface.cc
@@ -197,6 +197,17 @@ void SynchronousCompositorOutputSurface::SwapBuffers(
DCHECK(CalledOnValidThread());
DCHECK(sync_client_);
+ client_->DidSwapBuffers();
boliu 2016/07/07 21:30:31 sync_client_->SwapBuffers sends the reply of the s
+
+ if (fallback_tick_running_) {
+ client_->DidSwapBuffersComplete();
+ cc::ReturnedResourceArray return_resources;
+ cc::TransferableResource::ReturnResources(
+ frame.delegated_frame_data->resource_list, &return_resources);
+ ReturnResources(return_resources);
boliu 2016/07/07 21:30:31 again, can we skip this and just DCHECK there are
danakj 2016/07/07 22:08:34 DCHECKing empty, but still sending back the ack to
+ return;
+ }
+
cc::CompositorFrame swap_frame;
if (in_software_draw_) {
@@ -220,14 +231,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();
- }
- client_->DidSwapBuffers();
+ sync_client_->SwapBuffers(output_surface_id_, std::move(swap_frame));
+ DeliverMessages();
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