Commit 7fd6959f authored by miletus@chromium.org's avatar miletus@chromium.org

Reschedule COMPOSITE_EVENTUALLY instead of COMPOSITE_IMMEDIATELY if we miss a browser frame

If we miss a browser frame, reschedule a new COMPOSITE_EVENTUALL, there will be
high latency/jank before the next composite happens, but this will keep the
browser compositor and renderer compositor in sync (low latency mode). While if
we COMPOSITOR_IMMEDIATELY, it could make the browser compositor always one frame
behind renderer compositor (high latency mode).

BUG=379264
TEST=record a trace for the following test:
     scroll on a simple page, first with top control hidden, then transit into showing the
     top control.
     With COMPOSITE_IMMEDIATELY, the latency graph shows that the scroll latency jumps up
     at the point of transition and stays at high latency mode.
     With COMPOSITE_EVENTUALL, the latency graph shows that the scroll latency jumps up
     at the point of transition but comes back to normal after.

Review URL: https://codereview.chromium.org/310873002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274640 0039d316-1c4b-4281-b951-d872f2087c98
parent 56cfb5d7
...@@ -700,9 +700,11 @@ void CompositorImpl::OnVSync(base::TimeTicks frame_time, ...@@ -700,9 +700,11 @@ void CompositorImpl::OnVSync(base::TimeTicks frame_time,
last_vsync_ = frame_time; last_vsync_ = frame_time;
if (WillCompositeThisFrame()) { if (WillCompositeThisFrame()) {
// We somehow missed the last vsync interval, so reschedule immediately. // We somehow missed the last vsync interval, so reschedule for deadline.
// We cannot schedule immediately, or will get us out-of-phase with new
// renderer frames.
CancelComposite(); CancelComposite();
composite_on_vsync_trigger_ = COMPOSITE_IMMEDIATELY; composite_on_vsync_trigger_ = COMPOSITE_EVENTUALLY;
} else { } else {
current_composite_task_.reset(); current_composite_task_.reset();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment