DescriptionAllow ui::Compositor to defer commits during tab-switch
Do this by using a ui::CompositorLock. For Mac, we don't care about making
sure that the compositor doesn't hang waiting for renderer frames (because
the browser compositor doesn't draw the UI), so disable the lock timeout.
Also, re-create the browser compositor immediately after the tab is made
visible. This way, if the DelegatedFrameHost has an un-evicted old frame,
then that frame will be displayed immediately (and if not, the compositor
will remain locked until a new frame is swapped in).
Background:
When we switched the ui::Compositor to use the scheduler (done
in https://codereview.chromium.org/638653003), we started hitting
issues where unexpected frames would flash on Mac during tab-switch.
The reason for this is that, prior to the change, calling
SetRootLayer(null) on the ui::Compositor would prevent it from drawing
any new frames.
The Mac was relying on this behavior to prevent transient frames from
appearing. The transient frames appear during tab-switch on Mac because
the compositor takes damage (as its root layer is changed) and also
because the compositor is resized (among potentially other things).
These frames do not actually appear on-screen (there are mechanisms
to prevent this), but they waste valuable time during tab-switch (the
browser allows only 50 msec for a new frame to appear on-screen before
it flashes white, and this extra unused frame causes us to miss the
deadline).
With this patch, the frequency of the white flash during tab-switch is
reduced substantially.
BUG=463988
Committed: https://crrev.com/00e438cd22c5e2f26d003c15c0a1621aa24acd0c
Cr-Commit-Position: refs/heads/master@{#320241}
Patch Set 1 #
Total comments: 1
Patch Set 2 : Use DeferCommits instead #
Total comments: 6
Patch Set 3 : Use compositor lock instead #Patch Set 4 : Cleaned up version #
Total comments: 9
Patch Set 5 : Incorporate review feedback #
Messages
Total messages: 16 (2 generated)
|