Bug 1531796 - Call NotifyApzTransaction() for skipped paints, too. r=rhunt,kats

We need to do this separately in the WR and non-WR codepaths for picking up
scroll updates for skipped paints.

Differential Revision: https://phabricator.services.mozilla.com/D29061

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-04-27 05:06:23 +00:00
Родитель 31a6a91d20
Коммит 50a070b645
4 изменённых файлов: 25 добавлений и 1 удалений

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

@ -616,10 +616,12 @@ void Layer::ApplyPendingUpdatesForThisTransaction() {
for (size_t i = 0; i < mScrollMetadata.Length(); i++) { for (size_t i = 0; i < mScrollMetadata.Length(); i++) {
FrameMetrics& fm = mScrollMetadata[i].GetMetrics(); FrameMetrics& fm = mScrollMetadata[i].GetMetrics();
ScrollableLayerGuid::ViewID scrollId = fm.GetScrollId();
Maybe<ScrollUpdateInfo> update = Maybe<ScrollUpdateInfo> update =
Manager()->GetPendingScrollInfoUpdate(fm.GetScrollId()); Manager()->GetPendingScrollInfoUpdate(scrollId);
if (update) { if (update) {
fm.UpdatePendingScrollInfo(update.value()); fm.UpdatePendingScrollInfo(update.value());
nsLayoutUtils::NotifyPaintSkipTransaction(scrollId);
Mutated(); Mutated();
} }
} }

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

@ -248,6 +248,9 @@ bool WebRenderLayerManager::EndEmptyTransaction(EndTransactionFlags aFlags) {
updates->mLargeShmems); updates->mLargeShmems);
} }
updates->mScrollUpdates = std::move(mPendingScrollUpdates[renderRoot]); updates->mScrollUpdates = std::move(mPendingScrollUpdates[renderRoot]);
for (const auto& entry : updates->mScrollUpdates) {
nsLayoutUtils::NotifyPaintSkipTransaction(/*scroll id=*/entry.first);
}
} }
} }

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

@ -1388,6 +1388,13 @@ void nsLayoutUtils::RemoveDisplayPort(nsIContent* aContent) {
aContent->DeleteProperty(nsGkAtoms::DisplayPortMargins); aContent->DeleteProperty(nsGkAtoms::DisplayPortMargins);
} }
void nsLayoutUtils::NotifyPaintSkipTransaction(ViewID aScrollId) {
if (nsIScrollableFrame* scrollFrame =
nsLayoutUtils::FindScrollableFrameFor(aScrollId)) {
scrollFrame->NotifyApzTransaction();
}
}
nsContainerFrame* nsLayoutUtils::LastContinuationWithChild( nsContainerFrame* nsLayoutUtils::LastContinuationWithChild(
nsContainerFrame* aFrame) { nsContainerFrame* aFrame) {
MOZ_ASSERT(aFrame, "NULL frame pointer"); MOZ_ASSERT(aFrame, "NULL frame pointer");

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

@ -321,6 +321,18 @@ class nsLayoutUtils {
*/ */
static void RemoveDisplayPort(nsIContent* aContent); static void RemoveDisplayPort(nsIContent* aContent);
/**
* Notify the scroll frame with the given scroll id that its scroll offset
* is being sent to APZ as part of a paint-skip transaction.
*
* Normally, this notification happens during painting, after calls to
* ComputeScrollMetadata(). During paint-skipping that code is skipped,
* but it's still important for the scroll frame to be notified for
* correctness of relative scroll updates, so the code that sends the
* empty paint-skip transaction needs to call this.
*/
static void NotifyPaintSkipTransaction(ViewID aScrollId);
/** /**
* Use heuristics to figure out the child list that * Use heuristics to figure out the child list that
* aChildFrame is currently in. * aChildFrame is currently in.