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

Unified Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 2713553013: Revert of Getting rid of immediate ack in DelegatedFrameHost (Closed)
Patch Set: Created 3 years, 10 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/browser/renderer_host/delegated_frame_host.cc
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
index 85b3e38a93e768b549e804b022326d62d3dc9550..3539e0a3c70ef9e0804132f549bb8b508e6fddfd 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -442,6 +442,7 @@
surface_returned_resources_.clear();
last_compositor_frame_sink_id_ = compositor_frame_sink_id;
}
+ bool skip_frame = false;
pending_delegated_ack_count_++;
background_color_ = frame.metadata.root_background_color;
@@ -460,13 +461,25 @@
allocated_new_local_surface_id = true;
}
- frame.metadata.latency_info.insert(frame.metadata.latency_info.end(),
- skipped_latency_info_list_.begin(),
- skipped_latency_info_list_.end());
- skipped_latency_info_list_.clear();
-
- auto ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn,
- AsWeakPtr(), compositor_frame_sink_id);
+ gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP();
+ if (desired_size != frame_size_in_dip && !desired_size.IsEmpty()) {
+ skip_frame = true;
+ skipped_latency_info_list_.insert(skipped_latency_info_list_.end(),
+ frame.metadata.latency_info.begin(),
+ frame.metadata.latency_info.end());
+ frame.metadata.latency_info.clear();
+ } else {
+ frame.metadata.latency_info.insert(frame.metadata.latency_info.end(),
+ skipped_latency_info_list_.begin(),
+ skipped_latency_info_list_.end());
+ skipped_latency_info_list_.clear();
+ }
+
+ cc::SurfaceFactory::DrawCallback ack_callback;
+ if (!skip_frame) {
+ ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn, AsWeakPtr(),
+ compositor_frame_sink_id);
+ }
surface_factory_->SubmitCompositorFrame(local_surface_id_, std::move(frame),
ack_callback);
if (allocated_new_local_surface_id) {
@@ -491,7 +504,12 @@
damage_rect_in_dip);
}
- if (compositor_)
+ if (skip_frame) {
+ SendReclaimCompositorResources(compositor_frame_sink_id,
+ true /* is_swap_ack */);
+ }
+
+ if (compositor_ && !skip_frame)
can_lock_compositor_ = NO_PENDING_COMMIT;
if (local_surface_id_.is_valid()) {
« 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