Bug 1268009 - If APZ is force-disabled, disable paint skipping even for apz-originated scrolls. r=kats
MozReview-Commit-ID: 2HgM5XiTcgA
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2738,35 +2738,39 @@ ScrollFrameHelper::ScrollToImpl(nsPoint
nsLayoutUtils::GetHighResolutionDisplayPort(content, &displayPort);
displayPort.MoveBy(-mScrolledFrame->GetPosition());
PAINT_SKIP_LOG("New scrollpos %s usingDP %d dpEqual %d scrollableByApz %d plugins %d\n",
Stringify(CSSPoint::FromAppUnits(GetScrollPosition())).c_str(),
usingDisplayPort, displayPort.IsEqualEdges(oldDisplayPort),
mScrollableByAPZ, HasPluginFrames());
if (usingDisplayPort && displayPort.IsEqualEdges(oldDisplayPort)) {
- if (LastScrollOrigin() == nsGkAtoms::apz) {
- schedulePaint = false;
- PAINT_SKIP_LOG("Skipping due to APZ scroll\n");
- } else if (mScrollableByAPZ && !HasPluginFrames()) {
- nsIWidget* widget = presContext->GetNearestWidget();
- LayerManager* manager = widget ? widget->GetLayerManager() : nullptr;
- if (manager) {
- mozilla::layers::FrameMetrics::ViewID id;
- DebugOnly<bool> success = nsLayoutUtils::FindIDFor(content, &id);
- MOZ_ASSERT(success); // we have a displayport, we better have an ID
-
- // Schedule an empty transaction to carry over the scroll offset update,
- // instead of a full transaction. This empty transaction might still get
- // squashed into a full transaction if something happens to trigger one.
+ bool haveScrollLinkedEffects = content->GetComposedDoc()->HasScrollLinkedEffect();
+ bool apzDisabled = haveScrollLinkedEffects && gfxPrefs::APZDisableForScrollLinkedEffects();
+ if (!apzDisabled) {
+ if (LastScrollOrigin() == nsGkAtoms::apz) {
schedulePaint = false;
- manager->SetPendingScrollUpdateForNextTransaction(id,
- { mScrollGeneration, CSSPoint::FromAppUnits(GetScrollPosition()) });
- mOuter->SchedulePaint(nsIFrame::PAINT_COMPOSITE_ONLY);
- PAINT_SKIP_LOG("Skipping due to APZ-forwarded main-thread scroll\n");
+ PAINT_SKIP_LOG("Skipping due to APZ scroll\n");
+ } else if (mScrollableByAPZ && !HasPluginFrames()) {
+ nsIWidget* widget = presContext->GetNearestWidget();
+ LayerManager* manager = widget ? widget->GetLayerManager() : nullptr;
+ if (manager) {
+ mozilla::layers::FrameMetrics::ViewID id;
+ DebugOnly<bool> success = nsLayoutUtils::FindIDFor(content, &id);
+ MOZ_ASSERT(success); // we have a displayport, we better have an ID
+
+ // Schedule an empty transaction to carry over the scroll offset update,
+ // instead of a full transaction. This empty transaction might still get
+ // squashed into a full transaction if something happens to trigger one.
+ schedulePaint = false;
+ manager->SetPendingScrollUpdateForNextTransaction(id,
+ { mScrollGeneration, CSSPoint::FromAppUnits(GetScrollPosition()) });
+ mOuter->SchedulePaint(nsIFrame::PAINT_COMPOSITE_ONLY);
+ PAINT_SKIP_LOG("Skipping due to APZ-forwarded main-thread scroll\n");
+ }
}
}
}
}
if (schedulePaint) {
mOuter->SchedulePaint();