Bug 1386747 - Put the scroll thumb's animation id in the scroll data for APZ. r?ethlin
MozReview-Commit-ID: AXqXjU8oycv
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -6322,16 +6322,17 @@ nsDisplayOwnLayer::nsDisplayOwnLayer(nsD
uint32_t aFlags, ViewID aScrollTarget,
const ScrollThumbData& aThumbData,
bool aForceActive)
: nsDisplayWrapList(aBuilder, aFrame, aList, aActiveScrolledRoot)
, mFlags(aFlags)
, mScrollTarget(aScrollTarget)
, mThumbData(aThumbData)
, mForceActive(aForceActive)
+ , mWrAnimationId(0)
{
MOZ_COUNT_CTOR(nsDisplayOwnLayer);
// For scroll thumb layers, override the AGR to be the thumb's AGR rather
// than the AGR for mFrame (which is the slider frame).
if (IsScrollThumbLayer()) {
if (nsIFrame* thumbFrame = nsBox::GetChildXULBox(mFrame)) {
mAnimatedGeometryRoot = aBuilder->FindAnimatedGeometryRootFor(thumbFrame);
@@ -6416,23 +6417,23 @@ nsDisplayOwnLayer::CreateWebRenderComman
float appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
LayerRect bounds = ViewAs<LayerPixel>(LayoutDeviceRect::FromAppUnits(visibleRect, appUnitsPerDevPixel),
PixelCastJustification::WebRenderHasUnitResolution);
LayerPoint origin = bounds.TopLeft();
RefPtr<WebRenderAnimationData> animationData = aManager->CreateOrRecycleWebRenderUserData<WebRenderAnimationData>(this);
AnimationInfo& animationInfo = animationData->GetAnimationInfo();
animationInfo.EnsureAnimationsId();
- uint64_t animationsId = animationInfo.GetCompositorAnimationsId();
+ mWrAnimationId = animationInfo.GetCompositorAnimationsId();
StackingContextHelper sc(aSc,
aBuilder,
bounds,
origin,
- animationsId,
+ mWrAnimationId,
nullptr,
nullptr);
nsDisplayWrapList::CreateWebRenderCommands(aBuilder, sc,
aParentCommands, aManager, aDisplayListBuilder);
return true;
}
@@ -6440,16 +6441,17 @@ bool
nsDisplayOwnLayer::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
mozilla::layers::WebRenderLayerScrollData* aLayerData)
{
bool ret = false;
if (IsScrollThumbLayer()) {
ret = true;
if (aLayerData) {
aLayerData->SetScrollThumbData(mThumbData);
+ aLayerData->SetScrollbarAnimationId(mWrAnimationId);
aLayerData->SetScrollbarTargetContainerId(mScrollTarget);
}
}
if (mFlags & SCROLLBAR_CONTAINER) {
ret = true;
if (aLayerData) {
aLayerData->SetIsScrollbarContainer();
aLayerData->SetScrollbarTargetContainerId(mScrollTarget);
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -4175,16 +4175,17 @@ protected:
uint32_t mFlags;
ViewID mScrollTarget;
// If this nsDisplayOwnLayer represents a scroll thumb layer, mThumbData
// stores information about the scroll thumb. Otherwise, mThumbData will be
// default-constructed (in particular with mDirection == ScrollDirection::NONE)
// and can be ignored.
ScrollThumbData mThumbData;
bool mForceActive;
+ uint64_t mWrAnimationId;
};
/**
* A display item for subdocuments. This is more or less the same as nsDisplayOwnLayer,
* except that it always populates the FrameMetrics instance on the ContainerLayer it
* builds.
*/
class nsDisplaySubDocument : public nsDisplayOwnLayer {