Bug 1447193 - Unsuppress display ports immediately after the tab switch has completed. r=dthayer

We suppress the displayport when requesting a tab or warming it, in order to reduce
the amount of work that the content process needs to do to paint it (we paint just
the displayport area and nothing around it). Afterwards, we unsuppress the displayport
so that we can paint the surrounding areas when scrolling. We normally do this
unsuppression in destroy(), but with tab warming, that unsuppression can happen
after a few seconds (after the tab warming eviction timeout).

This results in users seeing checkerboarding sometimes, where the tab they're looking
at is still suppressing its displayport and waiting for the timeout to complete.

This patch updates the AsyncTabSwitcher to unsuppress the displayport for a tab as
soon as the tab has been switched to, instead of waiting for the timeout.

Out of an abundance of caution, we still unsuppress displayports for tabs that
never get to enter the STATE_LOADED state, although that really should never
happen.

MozReview-Commit-ID: 5qIVguSMsnr

--HG--
extra : rebase_source : 90c0d617ac3d43a8d4513e864ba2f0a3228a5582
This commit is contained in:
Mike Conley 2018-03-23 16:10:17 -04:00
Родитель f3ee89b953
Коммит f0500e5bda
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1009,6 +1009,13 @@ class AsyncTabSwitcher {
if (this.switchInProgress && this.requestedTab &&
(this.getTabState(this.requestedTab) == this.STATE_LOADED ||
this.requestedTab === this.blankTab)) {
let browser = this.requestedTab.linkedBrowser;
let { tabParent } = browser.frameLoader;
if (tabParent && this.activeSuppressDisplayport.has(tabParent)) {
tabParent.suppressDisplayport(false);
this.activeSuppressDisplayport.delete(tabParent);
}
// After this point the tab has switched from the content thread's point of view.
// The changes will be visible after the next refresh driver tick + composite.
let time = TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_TOTAL_E10S_MS", this.window);