Loading gfx/layers/wr/DisplayItemCache.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,12 @@ Maybe<uint16_t> DisplayItemCache::CanReuseItem( return Nothing(); } if (mSuppressed) { slot.mOccupied = false; slotIndex = Nothing(); return Nothing(); } if (!(aSpaceAndClip == slot.mSpaceAndClip)) { // Spatial id and clip id can change between display lists, if items that // generate them change their order. Loading gfx/layers/wr/DisplayItemCache.h +3 −3 Original line number Diff line number Diff line Loading @@ -100,9 +100,9 @@ class DisplayItemCache final { /** * Suppress display item caching. This doesn't clear any existing cached * items or change the underlying capacity, it just makes IsEnabled() return * false. It is not meant to be flipped in the middle of a display list build, * but rather set before the display list build starts to suppress use of the * cache for that display list build. * false. * It will also make CanReuseItem return false for the duration of the * suppression. */ bool SetSuppressed(bool aSuppressed) { if (aSuppressed == mSuppressed) { Loading gfx/layers/wr/WebRenderCommandBuilder.cpp +14 −7 Original line number Diff line number Diff line Loading @@ -1694,7 +1694,8 @@ void WebRenderCommandBuilder::CreateWebRenderCommands( void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList( nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem, nsDisplayListBuilder* aDisplayListBuilder, const StackingContextHelper& aSc, wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources) { wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources, bool aNewClipList) { if (mDoGrouping) { MOZ_RELEASE_ASSERT( aWrappingItem, Loading @@ -1715,7 +1716,9 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList( } mDumpIndent++; if (aNewClipList) { mClipManager.BeginList(aSc); } bool apzEnabled = mManager->AsyncPanZoomEnabled(); Loading Loading @@ -1912,8 +1915,10 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList( } mDumpIndent--; if (aNewClipList) { mClipManager.EndList(aSc); } } void WebRenderCommandBuilder::PushOverrideForASR( const ActiveScrolledRoot* aASR, const wr::WrSpatialId& aSpatialId) { Loading Loading @@ -2484,6 +2489,8 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( nsPoint maskOffset = aMaskItem->ToReferenceFrame() - bounds.TopLeft(); bool shouldHandleOpacity = aBuilder.GetInheritedOpacity() != 1.0f; nsRect dirtyRect; // If this mask item is being painted for the first time, some members of // WebRenderMaskData are still default initialized. This is intentional. Loading @@ -2491,7 +2498,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( !itemRect.IsEqualInterior(maskData->mItemRect) || !(aMaskItem->Frame()->StyleSVGReset()->mMask == maskData->mMaskStyle) || maskOffset != maskData->mMaskOffset || !sameScale || aMaskItem->ShouldHandleOpacity() != maskData->mShouldHandleOpacity) { shouldHandleOpacity != maskData->mShouldHandleOpacity) { IntSize size = itemRect.Size().ToUnknownSize(); if (!Factory::AllowedSurfaceSize(size)) { Loading Loading @@ -2535,8 +2542,8 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( .PreScale(scale.width, scale.height)); bool maskPainted = false; bool maskIsComplete = aMaskItem->PaintMask(aDisplayListBuilder, context, &maskPainted); bool maskIsComplete = aMaskItem->PaintMask( aDisplayListBuilder, context, shouldHandleOpacity, &maskPainted); if (!maskPainted) { return Nothing(); } Loading Loading @@ -2587,7 +2594,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( maskData->mMaskOffset = maskOffset; maskData->mScale = scale; maskData->mMaskStyle = aMaskItem->Frame()->StyleSVGReset()->mMask; maskData->mShouldHandleOpacity = aMaskItem->ShouldHandleOpacity(); maskData->mShouldHandleOpacity = shouldHandleOpacity; } } Loading gfx/layers/wr/WebRenderCommandBuilder.h +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class WebRenderCommandBuilder final { nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem, nsDisplayListBuilder* aDisplayListBuilder, const StackingContextHelper& aSc, wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources); wr::IpcResourceUpdateQueue& aResources, bool aNewClipList = true); // aWrappingItem has to be non-null. void DoGroupingForDisplayList(nsDisplayList* aDisplayList, Loading gfx/webrender_bindings/WebRenderAPI.h +12 −0 Original line number Diff line number Diff line Loading @@ -684,6 +684,17 @@ class DisplayListBuilder final { mClipChainLeaf = aClipRect; } // Used for opacity flattening. When we flatten away an opacity item, // we push the opacity value onto the builder. // Descendant items should pull the inherited opacity during // their CreateWebRenderCommands implementation. This can only happen if all // descendant items reported supporting this functionality, via // nsDisplayItem::CanApplyOpacity. float GetInheritedOpacity() { return mInheritedOpacity; } void SetInheritedOpacity(float aOpacity) { mInheritedOpacity = aOpacity; } layers::DisplayItemCache* GetDisplayItemCache() { return mDisplayItemCache; } // A chain of RAII objects, each holding a (ASR, ViewID, SideBits) tuple of // data. The topmost object is pointed to by the mActiveFixedPosTracker // pointer in the wr::DisplayListBuilder. Loading Loading @@ -750,6 +761,7 @@ class DisplayListBuilder final { layers::DisplayItemCache* mDisplayItemCache; Maybe<uint16_t> mCurrentCacheSlot; float mInheritedOpacity = 1.0f; friend class WebRenderAPI; friend class SpaceAndClipChainHelper; Loading Loading
gfx/layers/wr/DisplayItemCache.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,12 @@ Maybe<uint16_t> DisplayItemCache::CanReuseItem( return Nothing(); } if (mSuppressed) { slot.mOccupied = false; slotIndex = Nothing(); return Nothing(); } if (!(aSpaceAndClip == slot.mSpaceAndClip)) { // Spatial id and clip id can change between display lists, if items that // generate them change their order. Loading
gfx/layers/wr/DisplayItemCache.h +3 −3 Original line number Diff line number Diff line Loading @@ -100,9 +100,9 @@ class DisplayItemCache final { /** * Suppress display item caching. This doesn't clear any existing cached * items or change the underlying capacity, it just makes IsEnabled() return * false. It is not meant to be flipped in the middle of a display list build, * but rather set before the display list build starts to suppress use of the * cache for that display list build. * false. * It will also make CanReuseItem return false for the duration of the * suppression. */ bool SetSuppressed(bool aSuppressed) { if (aSuppressed == mSuppressed) { Loading
gfx/layers/wr/WebRenderCommandBuilder.cpp +14 −7 Original line number Diff line number Diff line Loading @@ -1694,7 +1694,8 @@ void WebRenderCommandBuilder::CreateWebRenderCommands( void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList( nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem, nsDisplayListBuilder* aDisplayListBuilder, const StackingContextHelper& aSc, wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources) { wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources, bool aNewClipList) { if (mDoGrouping) { MOZ_RELEASE_ASSERT( aWrappingItem, Loading @@ -1715,7 +1716,9 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList( } mDumpIndent++; if (aNewClipList) { mClipManager.BeginList(aSc); } bool apzEnabled = mManager->AsyncPanZoomEnabled(); Loading Loading @@ -1912,8 +1915,10 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList( } mDumpIndent--; if (aNewClipList) { mClipManager.EndList(aSc); } } void WebRenderCommandBuilder::PushOverrideForASR( const ActiveScrolledRoot* aASR, const wr::WrSpatialId& aSpatialId) { Loading Loading @@ -2484,6 +2489,8 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( nsPoint maskOffset = aMaskItem->ToReferenceFrame() - bounds.TopLeft(); bool shouldHandleOpacity = aBuilder.GetInheritedOpacity() != 1.0f; nsRect dirtyRect; // If this mask item is being painted for the first time, some members of // WebRenderMaskData are still default initialized. This is intentional. Loading @@ -2491,7 +2498,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( !itemRect.IsEqualInterior(maskData->mItemRect) || !(aMaskItem->Frame()->StyleSVGReset()->mMask == maskData->mMaskStyle) || maskOffset != maskData->mMaskOffset || !sameScale || aMaskItem->ShouldHandleOpacity() != maskData->mShouldHandleOpacity) { shouldHandleOpacity != maskData->mShouldHandleOpacity) { IntSize size = itemRect.Size().ToUnknownSize(); if (!Factory::AllowedSurfaceSize(size)) { Loading Loading @@ -2535,8 +2542,8 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( .PreScale(scale.width, scale.height)); bool maskPainted = false; bool maskIsComplete = aMaskItem->PaintMask(aDisplayListBuilder, context, &maskPainted); bool maskIsComplete = aMaskItem->PaintMask( aDisplayListBuilder, context, shouldHandleOpacity, &maskPainted); if (!maskPainted) { return Nothing(); } Loading Loading @@ -2587,7 +2594,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage( maskData->mMaskOffset = maskOffset; maskData->mScale = scale; maskData->mMaskStyle = aMaskItem->Frame()->StyleSVGReset()->mMask; maskData->mShouldHandleOpacity = aMaskItem->ShouldHandleOpacity(); maskData->mShouldHandleOpacity = shouldHandleOpacity; } } Loading
gfx/layers/wr/WebRenderCommandBuilder.h +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class WebRenderCommandBuilder final { nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem, nsDisplayListBuilder* aDisplayListBuilder, const StackingContextHelper& aSc, wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources); wr::IpcResourceUpdateQueue& aResources, bool aNewClipList = true); // aWrappingItem has to be non-null. void DoGroupingForDisplayList(nsDisplayList* aDisplayList, Loading
gfx/webrender_bindings/WebRenderAPI.h +12 −0 Original line number Diff line number Diff line Loading @@ -684,6 +684,17 @@ class DisplayListBuilder final { mClipChainLeaf = aClipRect; } // Used for opacity flattening. When we flatten away an opacity item, // we push the opacity value onto the builder. // Descendant items should pull the inherited opacity during // their CreateWebRenderCommands implementation. This can only happen if all // descendant items reported supporting this functionality, via // nsDisplayItem::CanApplyOpacity. float GetInheritedOpacity() { return mInheritedOpacity; } void SetInheritedOpacity(float aOpacity) { mInheritedOpacity = aOpacity; } layers::DisplayItemCache* GetDisplayItemCache() { return mDisplayItemCache; } // A chain of RAII objects, each holding a (ASR, ViewID, SideBits) tuple of // data. The topmost object is pointed to by the mActiveFixedPosTracker // pointer in the wr::DisplayListBuilder. Loading Loading @@ -750,6 +761,7 @@ class DisplayListBuilder final { layers::DisplayItemCache* mDisplayItemCache; Maybe<uint16_t> mCurrentCacheSlot; float mInheritedOpacity = 1.0f; friend class WebRenderAPI; friend class SpaceAndClipChainHelper; Loading