зеркало из https://github.com/mozilla/gecko-dev.git
Bug 978248 - Tile-align display ports on first paint. r=tn
This commit is contained in:
Родитель
727f428eaa
Коммит
100f888505
|
@ -143,20 +143,21 @@ APZCCallbackHelper::UpdateRootFrame(nsIDOMWindowUtils* aUtils,
|
||||||
bool scrollUpdated = false;
|
bool scrollUpdated = false;
|
||||||
CSSPoint actualScrollOffset = ScrollFrameTo(sf, aMetrics.mScrollOffset, scrollUpdated);
|
CSSPoint actualScrollOffset = ScrollFrameTo(sf, aMetrics.mScrollOffset, scrollUpdated);
|
||||||
|
|
||||||
if (scrollUpdated) {
|
if (!scrollUpdated) {
|
||||||
// Correct the display port due to the difference between mScrollOffset and the
|
// For whatever reason we couldn't update the scroll offset on the scroll frame,
|
||||||
// actual scroll offset, possibly align it to tile boundaries (if tiled layers are
|
// which means the data APZ used for its displayport calculation is stale. Fall
|
||||||
// enabled), and clamp it to the scrollable rect.
|
// back to a sane default behaviour. Note that we don't tile-align the recentered
|
||||||
MaybeAlignAndClampDisplayPort(aMetrics, actualScrollOffset);
|
// displayport because tile-alignment depends on the scroll position, and the
|
||||||
} else {
|
// scroll position here is out of our control. See bug 966507 comment 21 for a
|
||||||
// For whatever reason we couldn't update the scroll offset on the scroll frame,
|
// more detailed explanation.
|
||||||
// which means the data APZ used for its displayport calculation is stale. Fall
|
RecenterDisplayPort(aMetrics);
|
||||||
// back to a sane default behaviour. Note that we don't tile-align the recentered
|
|
||||||
// displayport because tile-alignment depends on the scroll position, and the
|
|
||||||
// scroll position here is out of our control. See bug 966507 comment 21 for a
|
|
||||||
// more detailed explanation.
|
|
||||||
RecenterDisplayPort(aMetrics);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Correct the display port due to the difference between mScrollOffset and the
|
||||||
|
// actual scroll offset, possibly align it to tile boundaries (if tiled layers are
|
||||||
|
// enabled), and clamp it to the scrollable rect.
|
||||||
|
MaybeAlignAndClampDisplayPort(aMetrics, actualScrollOffset);
|
||||||
|
|
||||||
aMetrics.mScrollOffset = actualScrollOffset;
|
aMetrics.mScrollOffset = actualScrollOffset;
|
||||||
|
|
||||||
// The mZoom variable on the frame metrics stores the CSS-to-screen scale for this
|
// The mZoom variable on the frame metrics stores the CSS-to-screen scale for this
|
||||||
|
@ -214,11 +215,10 @@ APZCCallbackHelper::UpdateSubFrame(nsIContent* aContent,
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aContent);
|
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aContent);
|
||||||
if (element) {
|
if (element) {
|
||||||
if (scrollUpdated) {
|
if (!scrollUpdated) {
|
||||||
MaybeAlignAndClampDisplayPort(aMetrics, actualScrollOffset);
|
|
||||||
} else {
|
|
||||||
RecenterDisplayPort(aMetrics);
|
RecenterDisplayPort(aMetrics);
|
||||||
}
|
}
|
||||||
|
MaybeAlignAndClampDisplayPort(aMetrics, actualScrollOffset);
|
||||||
utils->SetDisplayPortForElement(aMetrics.mDisplayPort.x,
|
utils->SetDisplayPortForElement(aMetrics.mDisplayPort.x,
|
||||||
aMetrics.mDisplayPort.y,
|
aMetrics.mDisplayPort.y,
|
||||||
aMetrics.mDisplayPort.width,
|
aMetrics.mDisplayPort.width,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче