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

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

Issue 1493013002: cc: Force commit on the frame after a copy request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments Created 5 years 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 | « content/browser/compositor/delegated_frame_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/delegated_frame_host.cc
diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc
index 2650a769a64747ad24708362e4ebd647ad9a26a8..39643295ffe688c211e0d9f04210b7a44f23d0eb 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -70,6 +70,7 @@ DelegatedFrameHost::DelegatedFrameHost(DelegatedFrameHostClient* client)
last_output_surface_id_(0),
pending_delegated_ack_count_(0),
skipped_frames_(false),
+ force_commit_for_next_frame_(false),
current_scale_factor_(1.f),
can_lock_compositor_(YES_CAN_LOCK),
delegated_frame_evictor_(new DelegatedFrameEvictor(this)) {
@@ -349,6 +350,11 @@ void DelegatedFrameHost::SwapDelegatedFrame(
gfx::Rect damage_rect_in_dip =
gfx::ConvertRectToDIP(frame_device_scale_factor, damage_rect);
+ if (compositor_ && force_commit_for_next_frame_) {
+ force_commit_for_next_frame_ = false;
+ compositor_->ScheduleDraw();
+ }
+
if (ShouldSkipFrame(frame_size_in_dip)) {
cc::CompositorFrameAck ack;
cc::TransferableResource::ReturnResources(frame_data->resource_list,
@@ -469,6 +475,7 @@ void DelegatedFrameHost::SwapDelegatedFrame(
}
released_front_lock_ = NULL;
current_frame_size_in_dip_ = frame_size_in_dip;
+
CheckResizeLock();
if (!damage_rect_in_dip.IsEmpty())
@@ -1033,6 +1040,8 @@ void DelegatedFrameHost::RequestCopyOfOutput(
request_copy_of_output_callback_for_testing_.Run(request.Pass());
else
client_->DelegatedFrameHostGetLayer()->RequestCopyOfOutput(request.Pass());
+
+ force_commit_for_next_frame_ = true;
miu 2015/12/02 20:32:57 Idea: Should you also call compositor_->ScheduleDr
ccameron 2015/12/02 23:03:22 That would seem like a separate bug if we're not g
miu 2015/12/03 00:23:41 Acknowledged.
}
void DelegatedFrameHost::UnlockResources() {
« no previous file with comments | « content/browser/compositor/delegated_frame_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698