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 +6 −4 Original line number Diff line number Diff line Loading @@ -2484,6 +2484,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 +2493,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 +2537,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 +2589,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/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 layout/painting/nsDisplayList.cpp +144 −137 File changed.Preview size limit exceeded, changes collapsed. Show changes 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 +6 −4 Original line number Diff line number Diff line Loading @@ -2484,6 +2484,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 +2493,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 +2537,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 +2589,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/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
layout/painting/nsDisplayList.cpp +144 −137 File changed.Preview size limit exceeded, changes collapsed. Show changes