From a131671571032731bfe16e0fc281a693cdf69572 Mon Sep 17 00:00:00 2001 From: Miko Mynttinen Date: Tue, 5 Nov 2019 15:09:53 +0000 Subject: [PATCH] Bug 1554499 - Add missing CalculatePerFrameIndex implementations r=mattwoodrow Depends on D37804 Differential Revision: https://phabricator.services.mozilla.com/D50185 --HG-- extra : moz-landing-system : lando --- layout/painting/nsDisplayList.h | 41 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index 128b36856598..59ae62943f10 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -4417,6 +4417,21 @@ class nsDisplaySolidColor : public nsDisplaySolidColorBase { } } + /** + * If we have multiple SolidColor items in a single frame's + * display list, aIndex should be used as their unique + * identifier. Note this mapping remains stable even if the + * dirty rect changes. + */ + // Should have an identical argument signature to the above ctor + static uint16_t CalculatePerFrameIndex(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, + const nsRect& aBounds, nscolor aColor, + uint16_t aIndex = 0, + bool aCanBeReused = true) { + return aIndex; + } + #ifdef NS_BUILD_REFCNT_LOGGING ~nsDisplaySolidColor() override { MOZ_COUNT_DTOR(nsDisplaySolidColor); } #endif @@ -4449,13 +4464,6 @@ class nsDisplaySolidColor : public nsDisplaySolidColorBase { void SetOverrideZIndex(int32_t aZIndex) { mOverrideZIndex = mozilla::Some(aZIndex); } - /** - * If we have multiple SolidColor items in a single frame's - * display list, mIndex should be used as their unique - * identifier. Note this mapping remains stable even if the - * dirty rect changes. - */ - uint16_t CalculatePerFrameKey() const override { return mIndex; } private: nsRect mBounds; @@ -5466,6 +5474,12 @@ class nsDisplayWrapList : public nsDisplayHitTestInfoItem { mListPtr = &mList; } + // Should have an identical argument signature to the above ctor + static uint16_t CalculatePerFrameIndex(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame) { + return 0; + } + nsDisplayWrapList() = delete; /** @@ -6165,8 +6179,9 @@ class nsDisplayOwnLayer : public nsDisplayWrapList { const ActiveScrolledRoot* aActiveScrolledRoot, nsDisplayOwnLayerFlags aFlags = nsDisplayOwnLayerFlags::None, const ScrollbarData& aScrollbarData = ScrollbarData{}, - bool aForceActive = true, bool aClearClipChain = false) { - return 0; + bool aForceActive = true, bool aClearClipChain = false, + uint16_t aIndex = 0) { + return aIndex; } nsDisplayOwnLayer(nsDisplayListBuilder* aBuilder, @@ -6207,8 +6222,6 @@ class nsDisplayOwnLayer : public nsDisplayWrapList { return false; } - uint16_t CalculatePerFrameKey() const override { return mIndex; } - bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override { return false; } @@ -6944,6 +6957,12 @@ class nsDisplayBackdropFilters : public nsDisplayWrapList { MOZ_COUNT_CTOR(nsDisplayBackdropFilters); } + static uint16_t CalculatePerFrameIndex(nsDisplayListBuilder* aBuilder, + nsIFrame* aFrame, nsDisplayList* aList, + const nsRect& aBackdropRect) { + return 0; + } + #ifdef NS_BUILD_REFCNT_LOGGING ~nsDisplayBackdropFilters() override { MOZ_COUNT_DTOR(nsDisplayBackdropFilters);