Backed out 10 changesets (bug 1714138, bug 1542929, bug 1728232, bug 1729236, bug 1728258, bug 1728251, bug 1728050) for causing bug 1424348 a=backout
Backed out changeset c5b71e6ce0e5 (bug 1729236) Backed out changeset c6bcc4ed3d2e (bug 1729236) Backed out changeset 7e292895282a (bug 1729236) Backed out changeset d9ddd915e0c2 (bug 1714138) Backed out changeset 82b98d2f0dcf (bug 1728258) Backed out changeset 9a84a36b9dc4 (bug 1542929) Backed out changeset 96be978630ff (bug 1728251) Backed out changeset d7a8bf19d849 (bug 1728251) Backed out changeset cce0c53b439f (bug 1728232) Backed out changeset 3afd6aee7849 (bug 1728050)
This commit is contained in:
@@ -274,8 +274,8 @@ Maybe<wr::WrSpatialId> ClipManager::DefineScrollLayers(
|
|||||||
DefineScrollLayers(aASR->mParent, aItem);
|
DefineScrollLayers(aASR->mParent, aItem);
|
||||||
|
|
||||||
Maybe<ScrollMetadata> metadata =
|
Maybe<ScrollMetadata> metadata =
|
||||||
aASR->mScrollableFrame->ComputeScrollMetadata(mManager, aItem->Frame(),
|
aASR->mScrollableFrame->ComputeScrollMetadata(mManager,
|
||||||
aItem->ToReferenceFrame());
|
aItem->ReferenceFrame());
|
||||||
if (!metadata) {
|
if (!metadata) {
|
||||||
MOZ_ASSERT_UNREACHABLE("Expected scroll metadata to be available!");
|
MOZ_ASSERT_UNREACHABLE("Expected scroll metadata to be available!");
|
||||||
return ancestorSpace;
|
return ancestorSpace;
|
||||||
@@ -289,8 +289,7 @@ Maybe<wr::WrSpatialId> ClipManager::DefineScrollLayers(
|
|||||||
|
|
||||||
nsIScrollableFrame* scrollableFrame = aASR->mScrollableFrame;
|
nsIScrollableFrame* scrollableFrame = aASR->mScrollableFrame;
|
||||||
nsIFrame* scrollFrame = do_QueryFrame(scrollableFrame);
|
nsIFrame* scrollFrame = do_QueryFrame(scrollableFrame);
|
||||||
nsPoint offset = scrollFrame->GetOffsetToCrossDoc(aItem->Frame()) +
|
nsPoint offset = scrollFrame->GetOffsetToCrossDoc(aItem->ReferenceFrame());
|
||||||
aItem->ToReferenceFrame();
|
|
||||||
float auPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
|
float auPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
|
||||||
nsRect scrollPort = scrollableFrame->GetScrollPortRect() + offset;
|
nsRect scrollPort = scrollableFrame->GetScrollPortRect() + offset;
|
||||||
LayoutDeviceRect clipBounds =
|
LayoutDeviceRect clipBounds =
|
||||||
|
|||||||
@@ -180,12 +180,6 @@ Maybe<uint16_t> DisplayItemCache::CanReuseItem(
|
|||||||
return Nothing();
|
return Nothing();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSuppressed) {
|
|
||||||
slot.mOccupied = false;
|
|
||||||
slotIndex = Nothing();
|
|
||||||
return Nothing();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(aSpaceAndClip == slot.mSpaceAndClip)) {
|
if (!(aSpaceAndClip == slot.mSpaceAndClip)) {
|
||||||
// Spatial id and clip id can change between display lists, if items that
|
// Spatial id and clip id can change between display lists, if items that
|
||||||
// generate them change their order.
|
// generate them change their order.
|
||||||
|
|||||||
@@ -100,9 +100,9 @@ class DisplayItemCache final {
|
|||||||
/**
|
/**
|
||||||
* Suppress display item caching. This doesn't clear any existing cached
|
* Suppress display item caching. This doesn't clear any existing cached
|
||||||
* items or change the underlying capacity, it just makes IsEnabled() return
|
* items or change the underlying capacity, it just makes IsEnabled() return
|
||||||
* false.
|
* false. It is not meant to be flipped in the middle of a display list build,
|
||||||
* It will also make CanReuseItem return false for the duration of the
|
* but rather set before the display list build starts to suppress use of the
|
||||||
* suppression.
|
* cache for that display list build.
|
||||||
*/
|
*/
|
||||||
bool SetSuppressed(bool aSuppressed) {
|
bool SetSuppressed(bool aSuppressed) {
|
||||||
if (aSuppressed == mSuppressed) {
|
if (aSuppressed == mSuppressed) {
|
||||||
|
|||||||
@@ -1694,8 +1694,7 @@ void WebRenderCommandBuilder::CreateWebRenderCommands(
|
|||||||
void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
|
void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
|
||||||
nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem,
|
nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem,
|
||||||
nsDisplayListBuilder* aDisplayListBuilder, const StackingContextHelper& aSc,
|
nsDisplayListBuilder* aDisplayListBuilder, const StackingContextHelper& aSc,
|
||||||
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources) {
|
||||||
bool aNewClipList) {
|
|
||||||
if (mDoGrouping) {
|
if (mDoGrouping) {
|
||||||
MOZ_RELEASE_ASSERT(
|
MOZ_RELEASE_ASSERT(
|
||||||
aWrappingItem,
|
aWrappingItem,
|
||||||
@@ -1716,9 +1715,7 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
|
|||||||
}
|
}
|
||||||
|
|
||||||
mDumpIndent++;
|
mDumpIndent++;
|
||||||
if (aNewClipList) {
|
mClipManager.BeginList(aSc);
|
||||||
mClipManager.BeginList(aSc);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool apzEnabled = mManager->AsyncPanZoomEnabled();
|
bool apzEnabled = mManager->AsyncPanZoomEnabled();
|
||||||
|
|
||||||
@@ -1915,9 +1912,7 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
|
|||||||
}
|
}
|
||||||
|
|
||||||
mDumpIndent--;
|
mDumpIndent--;
|
||||||
if (aNewClipList) {
|
mClipManager.EndList(aSc);
|
||||||
mClipManager.EndList(aSc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRenderCommandBuilder::PushOverrideForASR(
|
void WebRenderCommandBuilder::PushOverrideForASR(
|
||||||
@@ -2489,8 +2484,6 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
|
|||||||
|
|
||||||
nsPoint maskOffset = aMaskItem->ToReferenceFrame() - bounds.TopLeft();
|
nsPoint maskOffset = aMaskItem->ToReferenceFrame() - bounds.TopLeft();
|
||||||
|
|
||||||
bool shouldHandleOpacity = aBuilder.GetInheritedOpacity() != 1.0f;
|
|
||||||
|
|
||||||
nsRect dirtyRect;
|
nsRect dirtyRect;
|
||||||
// If this mask item is being painted for the first time, some members of
|
// If this mask item is being painted for the first time, some members of
|
||||||
// WebRenderMaskData are still default initialized. This is intentional.
|
// WebRenderMaskData are still default initialized. This is intentional.
|
||||||
@@ -2498,7 +2491,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
|
|||||||
!itemRect.IsEqualInterior(maskData->mItemRect) ||
|
!itemRect.IsEqualInterior(maskData->mItemRect) ||
|
||||||
!(aMaskItem->Frame()->StyleSVGReset()->mMask == maskData->mMaskStyle) ||
|
!(aMaskItem->Frame()->StyleSVGReset()->mMask == maskData->mMaskStyle) ||
|
||||||
maskOffset != maskData->mMaskOffset || !sameScale ||
|
maskOffset != maskData->mMaskOffset || !sameScale ||
|
||||||
shouldHandleOpacity != maskData->mShouldHandleOpacity) {
|
aMaskItem->ShouldHandleOpacity() != maskData->mShouldHandleOpacity) {
|
||||||
IntSize size = itemRect.Size().ToUnknownSize();
|
IntSize size = itemRect.Size().ToUnknownSize();
|
||||||
|
|
||||||
if (!Factory::AllowedSurfaceSize(size)) {
|
if (!Factory::AllowedSurfaceSize(size)) {
|
||||||
@@ -2542,8 +2535,8 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
|
|||||||
.PreScale(scale.width, scale.height));
|
.PreScale(scale.width, scale.height));
|
||||||
|
|
||||||
bool maskPainted = false;
|
bool maskPainted = false;
|
||||||
bool maskIsComplete = aMaskItem->PaintMask(
|
bool maskIsComplete =
|
||||||
aDisplayListBuilder, context, shouldHandleOpacity, &maskPainted);
|
aMaskItem->PaintMask(aDisplayListBuilder, context, &maskPainted);
|
||||||
if (!maskPainted) {
|
if (!maskPainted) {
|
||||||
return Nothing();
|
return Nothing();
|
||||||
}
|
}
|
||||||
@@ -2594,7 +2587,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
|
|||||||
maskData->mMaskOffset = maskOffset;
|
maskData->mMaskOffset = maskOffset;
|
||||||
maskData->mScale = scale;
|
maskData->mScale = scale;
|
||||||
maskData->mMaskStyle = aMaskItem->Frame()->StyleSVGReset()->mMask;
|
maskData->mMaskStyle = aMaskItem->Frame()->StyleSVGReset()->mMask;
|
||||||
maskData->mShouldHandleOpacity = shouldHandleOpacity;
|
maskData->mShouldHandleOpacity = aMaskItem->ShouldHandleOpacity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class WebRenderCommandBuilder final {
|
|||||||
nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem,
|
nsDisplayList* aDisplayList, nsDisplayItem* aWrappingItem,
|
||||||
nsDisplayListBuilder* aDisplayListBuilder,
|
nsDisplayListBuilder* aDisplayListBuilder,
|
||||||
const StackingContextHelper& aSc, wr::DisplayListBuilder& aBuilder,
|
const StackingContextHelper& aSc, wr::DisplayListBuilder& aBuilder,
|
||||||
wr::IpcResourceUpdateQueue& aResources, bool aNewClipList = true);
|
wr::IpcResourceUpdateQueue& aResources);
|
||||||
|
|
||||||
// aWrappingItem has to be non-null.
|
// aWrappingItem has to be non-null.
|
||||||
void DoGroupingForDisplayList(nsDisplayList* aDisplayList,
|
void DoGroupingForDisplayList(nsDisplayList* aDisplayList,
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ void WebRenderLayerScrollData::Initialize(
|
|||||||
mScrollIds.AppendElement(index.ref());
|
mScrollIds.AppendElement(index.ref());
|
||||||
} else {
|
} else {
|
||||||
Maybe<ScrollMetadata> metadata =
|
Maybe<ScrollMetadata> metadata =
|
||||||
asr->mScrollableFrame->ComputeScrollMetadata(
|
asr->mScrollableFrame->ComputeScrollMetadata(aOwner.GetManager(),
|
||||||
aOwner.GetManager(), aItem->Frame(), aItem->ToReferenceFrame());
|
aItem->ReferenceFrame());
|
||||||
aOwner.GetBuilder()->AddScrollFrameToNotify(asr->mScrollableFrame);
|
aOwner.GetBuilder()->AddScrollFrameToNotify(asr->mScrollableFrame);
|
||||||
if (metadata) {
|
if (metadata) {
|
||||||
MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId);
|
MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId);
|
||||||
|
|||||||
@@ -684,17 +684,6 @@ class DisplayListBuilder final {
|
|||||||
mClipChainLeaf = aClipRect;
|
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
|
// A chain of RAII objects, each holding a (ASR, ViewID, SideBits) tuple of
|
||||||
// data. The topmost object is pointed to by the mActiveFixedPosTracker
|
// data. The topmost object is pointed to by the mActiveFixedPosTracker
|
||||||
// pointer in the wr::DisplayListBuilder.
|
// pointer in the wr::DisplayListBuilder.
|
||||||
@@ -761,7 +750,6 @@ class DisplayListBuilder final {
|
|||||||
|
|
||||||
layers::DisplayItemCache* mDisplayItemCache;
|
layers::DisplayItemCache* mDisplayItemCache;
|
||||||
Maybe<uint16_t> mCurrentCacheSlot;
|
Maybe<uint16_t> mCurrentCacheSlot;
|
||||||
float mInheritedOpacity = 1.0f;
|
|
||||||
|
|
||||||
friend class WebRenderAPI;
|
friend class WebRenderAPI;
|
||||||
friend class SpaceAndClipChainHelper;
|
friend class SpaceAndClipChainHelper;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ static void PrintDisplayItemTo(nsDisplayListBuilder* aBuilder,
|
|||||||
}
|
}
|
||||||
bool snap;
|
bool snap;
|
||||||
nsRect rect = aItem->GetBounds(aBuilder, &snap);
|
nsRect rect = aItem->GetBounds(aBuilder, &snap);
|
||||||
|
nsRect layerRect = rect - (*aItem->GetAnimatedGeometryRoot())
|
||||||
|
->GetOffsetToCrossDoc(aItem->ReferenceFrame());
|
||||||
nsRect component = aItem->GetComponentAlphaBounds(aBuilder);
|
nsRect component = aItem->GetComponentAlphaBounds(aBuilder);
|
||||||
nsDisplayList* list = aItem->GetChildren();
|
nsDisplayList* list = aItem->GetChildren();
|
||||||
const DisplayItemClip& clip = aItem->GetClip();
|
const DisplayItemClip& clip = aItem->GetClip();
|
||||||
@@ -77,15 +79,19 @@ static void PrintDisplayItemTo(nsDisplayListBuilder* aBuilder,
|
|||||||
|
|
||||||
aStream << nsPrintfCString(
|
aStream << nsPrintfCString(
|
||||||
"%s p=0x%p f=0x%p(%s) key=%d %sbounds(%d,%d,%d,%d) "
|
"%s p=0x%p f=0x%p(%s) key=%d %sbounds(%d,%d,%d,%d) "
|
||||||
"componentAlpha(%d,%d,%d,%d) clip(%s) asr(%s) clipChain(%s)%s ",
|
"layerBounds(%d,%d,%d,%d) "
|
||||||
|
"componentAlpha(%d,%d,%d,%d) clip(%s) asr(%s) clipChain(%s)%s ref=0x%p "
|
||||||
|
"agr=0x%p",
|
||||||
aItem->Name(), aItem, (void*)f, NS_ConvertUTF16toUTF8(contentData).get(),
|
aItem->Name(), aItem, (void*)f, NS_ConvertUTF16toUTF8(contentData).get(),
|
||||||
aItem->GetPerFrameKey(),
|
aItem->GetPerFrameKey(),
|
||||||
(aItem->ZIndex() ? nsPrintfCString("z=%d ", aItem->ZIndex()).get() : ""),
|
(aItem->ZIndex() ? nsPrintfCString("z=%d ", aItem->ZIndex()).get() : ""),
|
||||||
rect.x, rect.y, rect.width, rect.height, component.x, component.y,
|
rect.x, rect.y, rect.width, rect.height, layerRect.x, layerRect.y,
|
||||||
|
layerRect.width, layerRect.height, component.x, component.y,
|
||||||
component.width, component.height, clip.ToString().get(),
|
component.width, component.height, clip.ToString().get(),
|
||||||
ActiveScrolledRoot::ToString(aItem->GetActiveScrolledRoot()).get(),
|
ActiveScrolledRoot::ToString(aItem->GetActiveScrolledRoot()).get(),
|
||||||
DisplayItemClipChain::ToString(aItem->GetClipChain()).get(),
|
DisplayItemClipChain::ToString(aItem->GetClipChain()).get(),
|
||||||
aItem->IsUniform(aBuilder) ? " uniform" : "");
|
aItem->IsUniform(aBuilder) ? " uniform" : "", aItem->ReferenceFrame(),
|
||||||
|
aItem->GetAnimatedGeometryRoot()->mFrame);
|
||||||
|
|
||||||
for (auto iter = opaque.RectIter(); !iter.Done(); iter.Next()) {
|
for (auto iter = opaque.RectIter(); !iter.Done(); iter.Next()) {
|
||||||
const nsRect& r = iter.Get();
|
const nsRect& r = iter.Get();
|
||||||
|
|||||||
@@ -8542,8 +8542,7 @@ bool nsLayoutUtils::CanScrollOriginClobberApz(ScrollOrigin aScrollOrigin) {
|
|||||||
/* static */
|
/* static */
|
||||||
ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
|
ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
|
||||||
const nsIFrame* aForFrame, const nsIFrame* aScrollFrame,
|
const nsIFrame* aForFrame, const nsIFrame* aScrollFrame,
|
||||||
nsIContent* aContent, const nsIFrame* aItemFrame,
|
nsIContent* aContent, const nsIFrame* aReferenceFrame,
|
||||||
const nsPoint& aOffsetToReferenceFrame,
|
|
||||||
WebRenderLayerManager* aLayerManager, ViewID aScrollParentId,
|
WebRenderLayerManager* aLayerManager, ViewID aScrollParentId,
|
||||||
const nsSize& aScrollPortSize, bool aIsRootContent) {
|
const nsSize& aScrollPortSize, bool aIsRootContent) {
|
||||||
const nsPresContext* presContext = aForFrame->PresContext();
|
const nsPresContext* presContext = aForFrame->PresContext();
|
||||||
@@ -8800,8 +8799,8 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
|
|||||||
const nsIFrame* frameForCompositionBoundsCalculation =
|
const nsIFrame* frameForCompositionBoundsCalculation =
|
||||||
aScrollFrame ? aScrollFrame : aForFrame;
|
aScrollFrame ? aScrollFrame : aForFrame;
|
||||||
nsRect compositionBounds(
|
nsRect compositionBounds(
|
||||||
frameForCompositionBoundsCalculation->GetOffsetToCrossDoc(aItemFrame) +
|
frameForCompositionBoundsCalculation->GetOffsetToCrossDoc(
|
||||||
aOffsetToReferenceFrame,
|
aReferenceFrame),
|
||||||
frameForCompositionBoundsCalculation->GetSize());
|
frameForCompositionBoundsCalculation->GetSize());
|
||||||
if (scrollableFrame) {
|
if (scrollableFrame) {
|
||||||
// If we have a scrollable frame, restrict the composition bounds to its
|
// If we have a scrollable frame, restrict the composition bounds to its
|
||||||
@@ -8957,9 +8956,9 @@ Maybe<ScrollMetadata> nsLayoutUtils::GetRootMetadata(
|
|||||||
scrollPortSize = scrollableFrame->GetScrollPortRect().Size();
|
scrollPortSize = scrollableFrame->GetScrollPortRect().Size();
|
||||||
}
|
}
|
||||||
return Some(nsLayoutUtils::ComputeScrollMetadata(
|
return Some(nsLayoutUtils::ComputeScrollMetadata(
|
||||||
frame, rootScrollFrame, content, frame,
|
frame, rootScrollFrame, content, aBuilder->FindReferenceFrameFor(frame),
|
||||||
aBuilder->ToReferenceFrame(frame), aLayerManager,
|
aLayerManager, ScrollableLayerGuid::NULL_SCROLL_ID, scrollPortSize,
|
||||||
ScrollableLayerGuid::NULL_SCROLL_ID, scrollPortSize, isRootContent));
|
isRootContent));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Nothing();
|
return Nothing();
|
||||||
|
|||||||
@@ -2760,8 +2760,7 @@ class nsLayoutUtils {
|
|||||||
|
|
||||||
static ScrollMetadata ComputeScrollMetadata(
|
static ScrollMetadata ComputeScrollMetadata(
|
||||||
const nsIFrame* aForFrame, const nsIFrame* aScrollFrame,
|
const nsIFrame* aForFrame, const nsIFrame* aScrollFrame,
|
||||||
nsIContent* aContent, const nsIFrame* aItemFrame,
|
nsIContent* aContent, const nsIFrame* aReferenceFrame,
|
||||||
const nsPoint& aOffsetToReferenceFrame,
|
|
||||||
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
||||||
ViewID aScrollParentId, const nsSize& aScrollPortSize, bool aIsRoot);
|
ViewID aScrollParentId, const nsSize& aScrollPortSize, bool aIsRoot);
|
||||||
|
|
||||||
|
|||||||
@@ -287,9 +287,8 @@ bool nsDisplayButtonBoxShadowOuter::CreateWebRenderCommands(
|
|||||||
LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel);
|
LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel);
|
||||||
wr::LayoutRect deviceBoxRect = wr::ToLayoutRect(deviceBox);
|
wr::LayoutRect deviceBoxRect = wr::ToLayoutRect(deviceBox);
|
||||||
|
|
||||||
bool dummy;
|
LayoutDeviceRect clipRect =
|
||||||
LayoutDeviceRect clipRect = LayoutDeviceRect::FromAppUnits(
|
LayoutDeviceRect::FromAppUnits(GetPaintRect(), appUnitsPerDevPixel);
|
||||||
GetBounds(aDisplayListBuilder, &dummy), appUnitsPerDevPixel);
|
|
||||||
wr::LayoutRect deviceClipRect = wr::ToLayoutRect(clipRect);
|
wr::LayoutRect deviceClipRect = wr::ToLayoutRect(clipRect);
|
||||||
|
|
||||||
bool hasBorderRadius;
|
bool hasBorderRadius;
|
||||||
@@ -512,11 +511,10 @@ bool nsDisplayButtonForeground::CreateWebRenderCommands(
|
|||||||
nsDisplayListBuilder* aDisplayListBuilder) {
|
nsDisplayListBuilder* aDisplayListBuilder) {
|
||||||
Maybe<nsCSSBorderRenderer> br;
|
Maybe<nsCSSBorderRenderer> br;
|
||||||
bool borderIsEmpty = false;
|
bool borderIsEmpty = false;
|
||||||
bool dummy;
|
|
||||||
nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||||
br = mBFR->CreateInnerFocusBorderRenderer(
|
br = mBFR->CreateInnerFocusBorderRenderer(aDisplayListBuilder,
|
||||||
aDisplayListBuilder, mFrame->PresContext(), nullptr,
|
mFrame->PresContext(), nullptr,
|
||||||
GetBounds(aDisplayListBuilder, &dummy), r, &borderIsEmpty);
|
GetPaintRect(), r, &borderIsEmpty);
|
||||||
|
|
||||||
if (!br) {
|
if (!br) {
|
||||||
return borderIsEmpty;
|
return borderIsEmpty;
|
||||||
|
|||||||
@@ -166,15 +166,14 @@ class nsDisplayListFocus : public nsPaintedDisplayItem {
|
|||||||
// the nsSelectsAreaFrame
|
// the nsSelectsAreaFrame
|
||||||
nsListControlFrame* listFrame = GetEnclosingListFrame(Frame());
|
nsListControlFrame* listFrame = GetEnclosingListFrame(Frame());
|
||||||
return listFrame->InkOverflowRectRelativeToSelf() +
|
return listFrame->InkOverflowRectRelativeToSelf() +
|
||||||
listFrame->GetOffsetToCrossDoc(Frame()) + ToReferenceFrame();
|
listFrame->GetOffsetToCrossDoc(ReferenceFrame());
|
||||||
}
|
}
|
||||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||||
gfxContext* aCtx) override {
|
gfxContext* aCtx) override {
|
||||||
nsListControlFrame* listFrame = GetEnclosingListFrame(Frame());
|
nsListControlFrame* listFrame = GetEnclosingListFrame(Frame());
|
||||||
// listFrame must be non-null or we wouldn't get called.
|
// listFrame must be non-null or we wouldn't get called.
|
||||||
listFrame->PaintFocus(
|
listFrame->PaintFocus(aCtx->GetDrawTarget(),
|
||||||
aCtx->GetDrawTarget(),
|
aBuilder->ToReferenceFrame(listFrame));
|
||||||
listFrame->GetOffsetToCrossDoc(Frame()) + ToReferenceFrame());
|
|
||||||
}
|
}
|
||||||
NS_DISPLAY_DECL_NAME("ListFocus", TYPE_LIST_FOCUS)
|
NS_DISPLAY_DECL_NAME("ListFocus", TYPE_LIST_FOCUS)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class TextDrawTarget : public DrawTarget {
|
|||||||
mHasUnsupportedFeatures = false;
|
mHasUnsupportedFeatures = false;
|
||||||
mHasShadows = false;
|
mHasShadows = false;
|
||||||
|
|
||||||
SetPermitSubpixelAA(true);
|
SetPermitSubpixelAA(!aItem->IsSubpixelAADisabled());
|
||||||
|
|
||||||
// Compute clip/bounds
|
// Compute clip/bounds
|
||||||
auto appUnitsPerDevPixel =
|
auto appUnitsPerDevPixel =
|
||||||
|
|||||||
@@ -209,6 +209,9 @@ static void PaintTextShadowCallback(gfxContext* aCtx, nsPoint aShadowOffset,
|
|||||||
|
|
||||||
void nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder,
|
void nsDisplayTextOverflowMarker::Paint(nsDisplayListBuilder* aBuilder,
|
||||||
gfxContext* aCtx) {
|
gfxContext* aCtx) {
|
||||||
|
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||||
|
IsSubpixelAADisabled());
|
||||||
|
|
||||||
nscolor foregroundColor =
|
nscolor foregroundColor =
|
||||||
nsLayoutUtils::GetColor(mFrame, &nsStyleText::mWebkitTextFillColor);
|
nsLayoutUtils::GetColor(mFrame, &nsStyleText::mWebkitTextFillColor);
|
||||||
|
|
||||||
|
|||||||
@@ -74,10 +74,8 @@ bool nsDisplayColumnRule::CreateWebRenderCommands(
|
|||||||
RefPtr<gfxContext> screenRefCtx = gfxContext::CreateOrNull(
|
RefPtr<gfxContext> screenRefCtx = gfxContext::CreateOrNull(
|
||||||
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get());
|
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget().get());
|
||||||
|
|
||||||
bool dummy;
|
|
||||||
static_cast<nsColumnSetFrame*>(mFrame)->CreateBorderRenderers(
|
static_cast<nsColumnSetFrame*>(mFrame)->CreateBorderRenderers(
|
||||||
mBorderRenderers, screenRefCtx, GetBounds(aDisplayListBuilder, &dummy),
|
mBorderRenderers, screenRefCtx, GetPaintRect(), ToReferenceFrame());
|
||||||
ToReferenceFrame());
|
|
||||||
|
|
||||||
if (mBorderRenderers.IsEmpty()) {
|
if (mBorderRenderers.IsEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4344,6 +4344,9 @@ nsRect ScrollFrameHelper::RestrictToRootDisplayPort(
|
|||||||
bool ScrollFrameHelper::DecideScrollableLayer(
|
bool ScrollFrameHelper::DecideScrollableLayer(
|
||||||
nsDisplayListBuilder* aBuilder, nsRect* aVisibleRect, nsRect* aDirtyRect,
|
nsDisplayListBuilder* aBuilder, nsRect* aVisibleRect, nsRect* aDirtyRect,
|
||||||
bool aSetBase, bool* aDirtyRectHasBeenOverriden) {
|
bool aSetBase, bool* aDirtyRectHasBeenOverriden) {
|
||||||
|
// Save and check if this changes so we can recompute the current agr.
|
||||||
|
bool oldWillBuildScrollableLayer = mWillBuildScrollableLayer;
|
||||||
|
|
||||||
nsIContent* content = mOuter->GetContent();
|
nsIContent* content = mOuter->GetContent();
|
||||||
// For hit testing purposes with fission we want to create a
|
// For hit testing purposes with fission we want to create a
|
||||||
// minimal display port for every scroll frame that could be active. (We only
|
// minimal display port for every scroll frame that could be active. (We only
|
||||||
@@ -4464,6 +4467,13 @@ bool ScrollFrameHelper::DecideScrollableLayer(
|
|||||||
mWillBuildScrollableLayer = usingDisplayPort ||
|
mWillBuildScrollableLayer = usingDisplayPort ||
|
||||||
nsContentUtils::HasScrollgrab(content) ||
|
nsContentUtils::HasScrollgrab(content) ||
|
||||||
mZoomableByAPZ;
|
mZoomableByAPZ;
|
||||||
|
|
||||||
|
// The cached animated geometry root for the display builder is out of
|
||||||
|
// date if we just introduced a new animated geometry root.
|
||||||
|
if (oldWillBuildScrollableLayer != mWillBuildScrollableLayer) {
|
||||||
|
aBuilder->RecomputeCurrentAnimatedGeometryRoot();
|
||||||
|
}
|
||||||
|
|
||||||
return mWillBuildScrollableLayer;
|
return mWillBuildScrollableLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4478,8 +4488,8 @@ void ScrollFrameHelper::NotifyApzTransaction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Maybe<ScrollMetadata> ScrollFrameHelper::ComputeScrollMetadata(
|
Maybe<ScrollMetadata> ScrollFrameHelper::ComputeScrollMetadata(
|
||||||
WebRenderLayerManager* aLayerManager, const nsIFrame* aItemFrame,
|
WebRenderLayerManager* aLayerManager,
|
||||||
const nsPoint& aOffsetToReferenceFrame) const {
|
const nsIFrame* aContainerReferenceFrame) const {
|
||||||
if (!mWillBuildScrollableLayer) {
|
if (!mWillBuildScrollableLayer) {
|
||||||
return Nothing();
|
return Nothing();
|
||||||
}
|
}
|
||||||
@@ -4490,9 +4500,8 @@ Maybe<ScrollMetadata> ScrollFrameHelper::ComputeScrollMetadata(
|
|||||||
MOZ_ASSERT(mScrolledFrame->GetContent());
|
MOZ_ASSERT(mScrolledFrame->GetContent());
|
||||||
|
|
||||||
return Some(nsLayoutUtils::ComputeScrollMetadata(
|
return Some(nsLayoutUtils::ComputeScrollMetadata(
|
||||||
mScrolledFrame, mOuter, mOuter->GetContent(), aItemFrame,
|
mScrolledFrame, mOuter, mOuter->GetContent(), aContainerReferenceFrame,
|
||||||
aOffsetToReferenceFrame, aLayerManager, mScrollParentID,
|
aLayerManager, mScrollParentID, mScrollPort.Size(), isRootContent));
|
||||||
mScrollPort.Size(), isRootContent));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScrollFrameHelper::IsRectNearlyVisible(const nsRect& aRect) const {
|
bool ScrollFrameHelper::IsRectNearlyVisible(const nsRect& aRect) const {
|
||||||
|
|||||||
@@ -484,8 +484,8 @@ class ScrollFrameHelper : public nsIReflowCallback {
|
|||||||
bool aApzAnimationInProgress);
|
bool aApzAnimationInProgress);
|
||||||
bool WantAsyncScroll() const;
|
bool WantAsyncScroll() const;
|
||||||
Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||||
WebRenderLayerManager* aLayerManager, const nsIFrame* aItemFrame,
|
WebRenderLayerManager* aLayerManager,
|
||||||
const nsPoint& aOffsetToReferenceFrame) const;
|
const nsIFrame* aContainerReferenceFrame) const;
|
||||||
// nsIScrollbarMediator
|
// nsIScrollbarMediator
|
||||||
void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
|
void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
|
||||||
nsIScrollbarMediator::ScrollSnapMode aSnap =
|
nsIScrollbarMediator::ScrollSnapMode aSnap =
|
||||||
@@ -1080,10 +1080,9 @@ class nsHTMLScrollFrame : public nsContainerFrame,
|
|||||||
bool WantAsyncScroll() const final { return mHelper.WantAsyncScroll(); }
|
bool WantAsyncScroll() const final { return mHelper.WantAsyncScroll(); }
|
||||||
mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||||
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
||||||
const nsIFrame* aItemFrame,
|
const nsIFrame* aContainerReferenceFrame) const final {
|
||||||
const nsPoint& aOffsetToReferenceFrame) const final {
|
return mHelper.ComputeScrollMetadata(aLayerManager,
|
||||||
return mHelper.ComputeScrollMetadata(aLayerManager, aItemFrame,
|
aContainerReferenceFrame);
|
||||||
aOffsetToReferenceFrame);
|
|
||||||
}
|
}
|
||||||
void MarkScrollbarsDirtyForReflow() const final {
|
void MarkScrollbarsDirtyForReflow() const final {
|
||||||
mHelper.MarkScrollbarsDirtyForReflow();
|
mHelper.MarkScrollbarsDirtyForReflow();
|
||||||
@@ -1558,10 +1557,9 @@ class nsXULScrollFrame final : public nsBoxFrame,
|
|||||||
bool WantAsyncScroll() const final { return mHelper.WantAsyncScroll(); }
|
bool WantAsyncScroll() const final { return mHelper.WantAsyncScroll(); }
|
||||||
mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||||
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
||||||
const nsIFrame* aItemFrame,
|
const nsIFrame* aContainerReferenceFrame) const final {
|
||||||
const nsPoint& aOffsetToReferenceFrame) const final {
|
return mHelper.ComputeScrollMetadata(aLayerManager,
|
||||||
return mHelper.ComputeScrollMetadata(aLayerManager, aItemFrame,
|
aContainerReferenceFrame);
|
||||||
aOffsetToReferenceFrame);
|
|
||||||
}
|
}
|
||||||
void MarkScrollbarsDirtyForReflow() const final {
|
void MarkScrollbarsDirtyForReflow() const final {
|
||||||
mHelper.MarkScrollbarsDirtyForReflow();
|
mHelper.MarkScrollbarsDirtyForReflow();
|
||||||
|
|||||||
@@ -476,8 +476,7 @@ class nsIScrollableFrame : public nsIScrollbarMediator {
|
|||||||
*/
|
*/
|
||||||
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||||
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
mozilla::layers::WebRenderLayerManager* aLayerManager,
|
||||||
const nsIFrame* aItemFrame,
|
const nsIFrame* aContainerReferenceFrame) const = 0;
|
||||||
const nsPoint& aOffsetToReferenceFrame) const = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark the scrollbar frames for reflow.
|
* Mark the scrollbar frames for reflow.
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ class nsDisplayHeaderFooter final : public nsPaintedDisplayItem {
|
|||||||
MOZ_ASSERT(pageFrame, "We should have an nsPageFrame");
|
MOZ_ASSERT(pageFrame, "We should have an nsPageFrame");
|
||||||
#endif
|
#endif
|
||||||
static_cast<nsPageFrame*>(mFrame)->PaintHeaderFooter(
|
static_cast<nsPageFrame*>(mFrame)->PaintHeaderFooter(
|
||||||
*aCtx, ToReferenceFrame(), false);
|
*aCtx, ToReferenceFrame(), IsSubpixelAADisabled());
|
||||||
}
|
}
|
||||||
NS_DISPLAY_DECL_NAME("HeaderFooter", TYPE_HEADER_FOOTER)
|
NS_DISPLAY_DECL_NAME("HeaderFooter", TYPE_HEADER_FOOTER)
|
||||||
|
|
||||||
|
|||||||
@@ -43,29 +43,6 @@
|
|||||||
* we would have built both in the new list if they intersected. Given that, we
|
* we would have built both in the new list if they intersected. Given that, we
|
||||||
* can align items that appear in both lists, and any items that appear between
|
* can align items that appear in both lists, and any items that appear between
|
||||||
* matched items can be inserted into the merged list in any order.
|
* matched items can be inserted into the merged list in any order.
|
||||||
*
|
|
||||||
* Frames that are a stacking context, containing blocks for position:fixed
|
|
||||||
* descendants, and don't have any continuations (see
|
|
||||||
* CanStoreDisplayListBuildingRect) trigger recursion into the algorithm with
|
|
||||||
* separate retaining decisions made.
|
|
||||||
*
|
|
||||||
* RDL defines the concept of an AnimatedGeometryRoot (AGR), the nearest
|
|
||||||
* ancestor frame which can be moved asynchronously on the compositor thread.
|
|
||||||
* These are currently nsDisplayItems which return true from CanMoveAsync
|
|
||||||
* (animated nsDisplayTransform and nsDisplayStickyPosition) and
|
|
||||||
* ActiveScrolledRoots.
|
|
||||||
*
|
|
||||||
* For each context that we run the retaining algorithm, there can only be
|
|
||||||
* mutations to one AnimatedGeometryRoot. This is because we are unable to
|
|
||||||
* reason about intersections of items that might then move relative to each
|
|
||||||
* other without RDL running again. If there are mutations to multiple
|
|
||||||
* AnimatedGeometryRoots, then we bail out and rebuild all the items in the
|
|
||||||
* context.
|
|
||||||
*
|
|
||||||
* Otherwise, when mutations are restricted to a single AGR, we pre-process the
|
|
||||||
* old display list and mark the frames for all existing (unmodified!) items
|
|
||||||
* that belong to a different AGR and ensure that we rebuild those items for
|
|
||||||
* correct sorting with the modified ones.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using mozilla::dom::Document;
|
using mozilla::dom::Document;
|
||||||
@@ -124,7 +101,8 @@ static void MarkFramesWithItemsAndImagesModified(nsDisplayList* aList) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsIFrame* SelectAGRForFrame(nsIFrame* aFrame, nsIFrame* aParentAGR) {
|
static AnimatedGeometryRoot* SelectAGRForFrame(
|
||||||
|
nsIFrame* aFrame, AnimatedGeometryRoot* aParentAGR) {
|
||||||
if (!aFrame->IsStackingContext() || !aFrame->IsFixedPosContainingBlock()) {
|
if (!aFrame->IsStackingContext() || !aFrame->IsFixedPosContainingBlock()) {
|
||||||
return aParentAGR;
|
return aParentAGR;
|
||||||
}
|
}
|
||||||
@@ -136,7 +114,7 @@ static nsIFrame* SelectAGRForFrame(nsIFrame* aFrame, nsIFrame* aParentAGR) {
|
|||||||
nsDisplayListBuilder::DisplayListBuildingData* data =
|
nsDisplayListBuilder::DisplayListBuildingData* data =
|
||||||
aFrame->GetProperty(nsDisplayListBuilder::DisplayListBuildingRect());
|
aFrame->GetProperty(nsDisplayListBuilder::DisplayListBuildingRect());
|
||||||
|
|
||||||
return data && data->mModifiedAGR ? data->mModifiedAGR : nullptr;
|
return data && data->mModifiedAGR ? data->mModifiedAGR.get() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RetainedDisplayListBuilder::AddSizeOfIncludingThis(
|
void RetainedDisplayListBuilder::AddSizeOfIncludingThis(
|
||||||
@@ -170,10 +148,9 @@ bool AnyContentAncestorModified(nsIFrame* aFrame, nsIFrame* aStopAtFrame) {
|
|||||||
// to mark, as child stacking contexts might. It would be nice if we could
|
// to mark, as child stacking contexts might. It would be nice if we could
|
||||||
// jump into those immediately rather than walking the entire thing.
|
// jump into those immediately rather than walking the entire thing.
|
||||||
bool RetainedDisplayListBuilder::PreProcessDisplayList(
|
bool RetainedDisplayListBuilder::PreProcessDisplayList(
|
||||||
RetainedDisplayList* aList, nsIFrame* aAGR, PartialUpdateResult& aUpdated,
|
RetainedDisplayList* aList, AnimatedGeometryRoot* aAGR,
|
||||||
nsIFrame* aAsyncAncestor, const ActiveScrolledRoot* aAsyncAncestorASR,
|
PartialUpdateResult& aUpdated, nsIFrame* aOuterFrame, uint32_t aCallerKey,
|
||||||
nsIFrame* aOuterFrame, uint32_t aCallerKey, uint32_t aNestingDepth,
|
uint32_t aNestingDepth, bool aKeepLinked) {
|
||||||
bool aKeepLinked) {
|
|
||||||
// The DAG merging algorithm does not have strong mechanisms in place to keep
|
// The DAG merging algorithm does not have strong mechanisms in place to keep
|
||||||
// the complexity of the resulting DAG under control. In some cases we can
|
// the complexity of the resulting DAG under control. In some cases we can
|
||||||
// build up edges very quickly. Detect those cases and force a full display
|
// build up edges very quickly. Detect those cases and force a full display
|
||||||
@@ -281,21 +258,10 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
|
|||||||
keepLinked = true;
|
keepLinked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this item's frame is an AGR (can be moved asynchronously by the
|
if (!PreProcessDisplayList(item->GetChildren(),
|
||||||
// compositor), then use that frame for descendants. Also pass the ASR
|
SelectAGRForFrame(f, aAGR), aUpdated,
|
||||||
// for that item, so that descendants can compare to see if any new
|
item->Frame(), item->GetPerFrameKey(),
|
||||||
// ASRs have been pushed since.
|
aNestingDepth + 1, keepLinked)) {
|
||||||
nsIFrame* asyncAncestor = aAsyncAncestor;
|
|
||||||
const ActiveScrolledRoot* asyncAncestorASR = aAsyncAncestorASR;
|
|
||||||
if (item->CanMoveAsync()) {
|
|
||||||
asyncAncestor = item->Frame();
|
|
||||||
asyncAncestorASR = item->GetActiveScrolledRoot();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!PreProcessDisplayList(
|
|
||||||
item->GetChildren(), SelectAGRForFrame(f, aAGR), aUpdated,
|
|
||||||
asyncAncestor, asyncAncestorASR, item->Frame(),
|
|
||||||
item->GetPerFrameKey(), aNestingDepth + 1, keepLinked)) {
|
|
||||||
MOZ_RELEASE_ASSERT(
|
MOZ_RELEASE_ASSERT(
|
||||||
!aKeepLinked,
|
!aKeepLinked,
|
||||||
"Can't early return since we need to move the out list back");
|
"Can't early return since we need to move the out list back");
|
||||||
@@ -310,20 +276,15 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
|
|||||||
// sibling of the changed thing to get correct ordering. The changed content
|
// sibling of the changed thing to get correct ordering. The changed content
|
||||||
// is a frame though, and it's hard to map that to container items in this
|
// is a frame though, and it's hard to map that to container items in this
|
||||||
// list.
|
// list.
|
||||||
// If an ancestor display item is an AGR, and our ASR matches the ASR
|
if (aAGR && item->GetAnimatedGeometryRoot()->GetAsyncAGR() != aAGR) {
|
||||||
// of that item, then there can't have been any new ASRs pushed since that
|
mBuilder.MarkFrameForDisplayIfVisible(f, mBuilder.RootReferenceFrame());
|
||||||
// item, so that item is our AGR. Otherwise, our AGR is our ASR.
|
|
||||||
nsIFrame* agrFrame = nullptr;
|
|
||||||
if (aAsyncAncestorASR == item->GetActiveScrolledRoot()) {
|
|
||||||
agrFrame = aAsyncAncestor;
|
|
||||||
} else {
|
|
||||||
MOZ_ASSERT(item->GetActiveScrolledRoot());
|
|
||||||
agrFrame =
|
|
||||||
item->GetActiveScrolledRoot()->mScrollableFrame->GetScrolledFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aAGR && agrFrame != aAGR) {
|
// TODO: This is here because we sometimes reuse the previous display list
|
||||||
mBuilder.MarkFrameForDisplayIfVisible(f, mBuilder.RootReferenceFrame());
|
// completely. For optimization, we could only restore the state for reused
|
||||||
|
// display items.
|
||||||
|
if (item->RestoreState()) {
|
||||||
|
item->InvalidateItemCacheEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're going to keep this linked list and not merge it, then mark the
|
// If we're going to keep this linked list and not merge it, then mark the
|
||||||
@@ -980,7 +941,7 @@ static bool CanStoreDisplayListBuildingRect(nsDisplayListBuilder* aBuilder,
|
|||||||
|
|
||||||
static bool ProcessFrameInternal(nsIFrame* aFrame,
|
static bool ProcessFrameInternal(nsIFrame* aFrame,
|
||||||
nsDisplayListBuilder* aBuilder,
|
nsDisplayListBuilder* aBuilder,
|
||||||
nsIFrame** aAGR, nsRect& aOverflow,
|
AnimatedGeometryRoot** aAGR, nsRect& aOverflow,
|
||||||
const nsIFrame* aStopAtFrame,
|
const nsIFrame* aStopAtFrame,
|
||||||
nsTArray<nsIFrame*>& aOutFramesWithProps,
|
nsTArray<nsIFrame*>& aOutFramesWithProps,
|
||||||
const bool aStopAtStackingContext) {
|
const bool aStopAtStackingContext) {
|
||||||
@@ -1016,7 +977,7 @@ static bool ProcessFrameInternal(nsIFrame* aFrame,
|
|||||||
|
|
||||||
// Tracking AGRs for the placeholder processing is not necessary, as the
|
// Tracking AGRs for the placeholder processing is not necessary, as the
|
||||||
// goal is to only modify the DisplayListBuildingData rect.
|
// goal is to only modify the DisplayListBuildingData rect.
|
||||||
nsIFrame* dummyAGR = nullptr;
|
AnimatedGeometryRoot* dummyAGR = nullptr;
|
||||||
|
|
||||||
// Find a common ancestor frame to handle frame continuations.
|
// Find a common ancestor frame to handle frame continuations.
|
||||||
// TODO: It might be possible to write a more specific and efficient
|
// TODO: It might be possible to write a more specific and efficient
|
||||||
@@ -1124,8 +1085,12 @@ static bool ProcessFrameInternal(nsIFrame* aFrame,
|
|||||||
// wrapper item and convert into into coordinate relative to the current
|
// wrapper item and convert into into coordinate relative to the current
|
||||||
// frame.
|
// frame.
|
||||||
nsRect previousVisible = wrapperItem->GetBuildingRectForChildren();
|
nsRect previousVisible = wrapperItem->GetBuildingRectForChildren();
|
||||||
if (wrapperItem->ReferenceFrameForChildren() != wrapperItem->Frame()) {
|
if (wrapperItem->ReferenceFrameForChildren() ==
|
||||||
|
wrapperItem->ReferenceFrame()) {
|
||||||
previousVisible -= wrapperItem->ToReferenceFrame();
|
previousVisible -= wrapperItem->ToReferenceFrame();
|
||||||
|
} else {
|
||||||
|
MOZ_ASSERT(wrapperItem->ReferenceFrameForChildren() ==
|
||||||
|
wrapperItem->Frame());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!previousVisible.Contains(aOverflow)) {
|
if (!previousVisible.Contains(aOverflow)) {
|
||||||
@@ -1158,7 +1123,7 @@ static bool ProcessFrameInternal(nsIFrame* aFrame,
|
|||||||
bool RetainedDisplayListBuilder::ProcessFrame(
|
bool RetainedDisplayListBuilder::ProcessFrame(
|
||||||
nsIFrame* aFrame, nsDisplayListBuilder* aBuilder, nsIFrame* aStopAtFrame,
|
nsIFrame* aFrame, nsDisplayListBuilder* aBuilder, nsIFrame* aStopAtFrame,
|
||||||
nsTArray<nsIFrame*>& aOutFramesWithProps, const bool aStopAtStackingContext,
|
nsTArray<nsIFrame*>& aOutFramesWithProps, const bool aStopAtStackingContext,
|
||||||
nsRect* aOutDirty, nsIFrame** aOutModifiedAGR) {
|
nsRect* aOutDirty, AnimatedGeometryRoot** aOutModifiedAGR) {
|
||||||
if (aFrame->HasOverrideDirtyRegion()) {
|
if (aFrame->HasOverrideDirtyRegion()) {
|
||||||
aOutFramesWithProps.AppendElement(aFrame);
|
aOutFramesWithProps.AppendElement(aFrame);
|
||||||
}
|
}
|
||||||
@@ -1169,7 +1134,8 @@ bool RetainedDisplayListBuilder::ProcessFrame(
|
|||||||
|
|
||||||
// TODO: There is almost certainly a faster way of doing this, probably can be
|
// TODO: There is almost certainly a faster way of doing this, probably can be
|
||||||
// combined with the ancestor walk for TransformFrameRectToAncestor.
|
// combined with the ancestor walk for TransformFrameRectToAncestor.
|
||||||
nsIFrame* agrFrame = aBuilder->FindAnimatedGeometryRootFrameFor(aFrame);
|
AnimatedGeometryRoot* agr =
|
||||||
|
aBuilder->FindAnimatedGeometryRootFor(aFrame)->GetAsyncAGR();
|
||||||
|
|
||||||
CRR_LOG("Processing frame %p with agr %p\n", aFrame, agr->mFrame);
|
CRR_LOG("Processing frame %p with agr %p\n", aFrame, agr->mFrame);
|
||||||
|
|
||||||
@@ -1191,7 +1157,7 @@ bool RetainedDisplayListBuilder::ProcessFrame(
|
|||||||
overflow.UnionRect(overflow, aBuilder->GetCaretRect());
|
overflow.UnionRect(overflow, aBuilder->GetCaretRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ProcessFrameInternal(aFrame, aBuilder, &agrFrame, overflow, aStopAtFrame,
|
if (!ProcessFrameInternal(aFrame, aBuilder, &agr, overflow, aStopAtFrame,
|
||||||
aOutFramesWithProps, aStopAtStackingContext)) {
|
aOutFramesWithProps, aStopAtStackingContext)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1205,9 +1171,9 @@ bool RetainedDisplayListBuilder::ProcessFrame(
|
|||||||
// really complex to track which items would need to be marked in
|
// really complex to track which items would need to be marked in
|
||||||
// MarkFramesForDifferentAGR.
|
// MarkFramesForDifferentAGR.
|
||||||
if (!*aOutModifiedAGR) {
|
if (!*aOutModifiedAGR) {
|
||||||
CRR_LOG("Setting %p as root stacking context AGR\n", agrFrame);
|
CRR_LOG("Setting %p as root stacking context AGR\n", agr);
|
||||||
*aOutModifiedAGR = agrFrame;
|
*aOutModifiedAGR = agr;
|
||||||
} else if (agrFrame && *aOutModifiedAGR != agrFrame) {
|
} else if (agr && *aOutModifiedAGR != agr) {
|
||||||
CRR_LOG("Found multiple AGRs in root stacking context, giving up\n");
|
CRR_LOG("Found multiple AGRs in root stacking context, giving up\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1281,7 +1247,8 @@ static void FindContainingBlocks(nsIFrame* aFrame,
|
|||||||
*/
|
*/
|
||||||
bool RetainedDisplayListBuilder::ComputeRebuildRegion(
|
bool RetainedDisplayListBuilder::ComputeRebuildRegion(
|
||||||
nsTArray<nsIFrame*>& aModifiedFrames, nsRect* aOutDirty,
|
nsTArray<nsIFrame*>& aModifiedFrames, nsRect* aOutDirty,
|
||||||
nsIFrame** aOutModifiedAGR, nsTArray<nsIFrame*>& aOutFramesWithProps) {
|
AnimatedGeometryRoot** aOutModifiedAGR,
|
||||||
|
nsTArray<nsIFrame*>& aOutFramesWithProps) {
|
||||||
CRR_LOG("Computing rebuild regions for %zu frames:\n",
|
CRR_LOG("Computing rebuild regions for %zu frames:\n",
|
||||||
aModifiedFrames.Length());
|
aModifiedFrames.Length());
|
||||||
nsTArray<nsIFrame*> extraFrames;
|
nsTArray<nsIFrame*> extraFrames;
|
||||||
@@ -1443,13 +1410,12 @@ PartialUpdateResult RetainedDisplayListBuilder::AttemptPartialUpdate(
|
|||||||
bool shouldBuildPartial = ShouldBuildPartial(modifiedFrames.Frames());
|
bool shouldBuildPartial = ShouldBuildPartial(modifiedFrames.Frames());
|
||||||
|
|
||||||
nsRect modifiedDirty;
|
nsRect modifiedDirty;
|
||||||
nsIFrame* modifiedAGR = nullptr;
|
AnimatedGeometryRoot* modifiedAGR = nullptr;
|
||||||
PartialUpdateResult result = PartialUpdateResult::NoChange;
|
PartialUpdateResult result = PartialUpdateResult::NoChange;
|
||||||
if (!shouldBuildPartial ||
|
if (!shouldBuildPartial ||
|
||||||
!ComputeRebuildRegion(modifiedFrames.Frames(), &modifiedDirty,
|
!ComputeRebuildRegion(modifiedFrames.Frames(), &modifiedDirty,
|
||||||
&modifiedAGR, framesWithProps.Frames()) ||
|
&modifiedAGR, framesWithProps.Frames()) ||
|
||||||
!PreProcessDisplayList(&mList, modifiedAGR, result,
|
!PreProcessDisplayList(&mList, modifiedAGR, result)) {
|
||||||
mBuilder.RootReferenceFrame(), nullptr)) {
|
|
||||||
mBuilder.SetPartialBuildFailed(true);
|
mBuilder.SetPartialBuildFailed(true);
|
||||||
mBuilder.LeavePresShell(mBuilder.RootReferenceFrame(), nullptr);
|
mBuilder.LeavePresShell(mBuilder.RootReferenceFrame(), nullptr);
|
||||||
mList.DeleteAll(&mBuilder);
|
mList.DeleteAll(&mBuilder);
|
||||||
|
|||||||
@@ -215,11 +215,13 @@ struct RetainedDisplayListBuilder {
|
|||||||
* aKeepLinked=true internally for sub-lists that can't be changed to keep the
|
* aKeepLinked=true internally for sub-lists that can't be changed to keep the
|
||||||
* original list structure linked for fast re-use.
|
* original list structure linked for fast re-use.
|
||||||
*/
|
*/
|
||||||
bool PreProcessDisplayList(
|
bool PreProcessDisplayList(RetainedDisplayList* aList,
|
||||||
RetainedDisplayList* aList, nsIFrame* aAGR, PartialUpdateResult& aUpdated,
|
AnimatedGeometryRoot* aAGR,
|
||||||
nsIFrame* aAsyncAncestor, const ActiveScrolledRoot* aAsyncAncestorASR,
|
PartialUpdateResult& aUpdated,
|
||||||
nsIFrame* aOuterFrame = nullptr, uint32_t aCallerKey = 0,
|
nsIFrame* aOuterFrame = nullptr,
|
||||||
uint32_t aNestingDepth = 0, bool aKeepLinked = false);
|
uint32_t aCallerKey = 0,
|
||||||
|
uint32_t aNestingDepth = 0,
|
||||||
|
bool aKeepLinked = false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merges items from aNewList into non-invalidated items from aOldList and
|
* Merges items from aNewList into non-invalidated items from aOldList and
|
||||||
@@ -239,14 +241,15 @@ struct RetainedDisplayListBuilder {
|
|||||||
nsDisplayItem* aOuterItem = nullptr);
|
nsDisplayItem* aOuterItem = nullptr);
|
||||||
|
|
||||||
bool ComputeRebuildRegion(nsTArray<nsIFrame*>& aModifiedFrames,
|
bool ComputeRebuildRegion(nsTArray<nsIFrame*>& aModifiedFrames,
|
||||||
nsRect* aOutDirty, nsIFrame** aOutModifiedAGR,
|
nsRect* aOutDirty,
|
||||||
|
AnimatedGeometryRoot** aOutModifiedAGR,
|
||||||
nsTArray<nsIFrame*>& aOutFramesWithProps);
|
nsTArray<nsIFrame*>& aOutFramesWithProps);
|
||||||
|
|
||||||
bool ProcessFrame(nsIFrame* aFrame, nsDisplayListBuilder* aBuilder,
|
bool ProcessFrame(nsIFrame* aFrame, nsDisplayListBuilder* aBuilder,
|
||||||
nsIFrame* aStopAtFrame,
|
nsIFrame* aStopAtFrame,
|
||||||
nsTArray<nsIFrame*>& aOutFramesWithProps,
|
nsTArray<nsIFrame*>& aOutFramesWithProps,
|
||||||
const bool aStopAtStackingContext, nsRect* aOutDirty,
|
const bool aStopAtStackingContext, nsRect* aOutDirty,
|
||||||
nsIFrame** aOutModifiedAGR);
|
AnimatedGeometryRoot** aOutModifiedAGR);
|
||||||
|
|
||||||
friend class MergeState;
|
friend class MergeState;
|
||||||
|
|
||||||
|
|||||||
@@ -728,13 +728,11 @@ ImgDrawResult nsCSSRendering::CreateWebRenderCommandsForBorderWithStyleBorder(
|
|||||||
flags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
|
flags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dummy;
|
|
||||||
image::ImgDrawResult result;
|
image::ImgDrawResult result;
|
||||||
Maybe<nsCSSBorderImageRenderer> bir =
|
Maybe<nsCSSBorderImageRenderer> bir =
|
||||||
nsCSSBorderImageRenderer::CreateBorderImageRenderer(
|
nsCSSBorderImageRenderer::CreateBorderImageRenderer(
|
||||||
aForFrame->PresContext(), aForFrame, aBorderArea, aStyleBorder,
|
aForFrame->PresContext(), aForFrame, aBorderArea, aStyleBorder,
|
||||||
aItem->GetBounds(aDisplayListBuilder, &dummy),
|
aItem->GetPaintRect(), aForFrame->GetSkipSides(), flags, &result);
|
||||||
aForFrame->GetSkipSides(), flags, &result);
|
|
||||||
|
|
||||||
if (!bir) {
|
if (!bir) {
|
||||||
// We aren't ready. Try to fallback to the null border image if present but
|
// We aren't ready. Try to fallback to the null border image if present but
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -152,6 +152,97 @@ enum class DisplayListArenaObjectId {
|
|||||||
* reference frame for their frame subtrees.
|
* reference frame for their frame subtrees.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a frame that is considered to have (or will have) "animated
|
||||||
|
* geometry" for itself and descendant frames.
|
||||||
|
*
|
||||||
|
* For example the scrolled frames of scrollframes which are actively being
|
||||||
|
* scrolled fall into this category. Frames with certain CSS properties that are
|
||||||
|
* being animated (e.g. 'left'/'top' etc) are also placed in this category.
|
||||||
|
* Frames with different active geometry roots are in different PaintedLayers,
|
||||||
|
* so that we can animate the geometry root by changing its transform (either on
|
||||||
|
* the main thread or in the compositor).
|
||||||
|
*
|
||||||
|
* nsDisplayListBuilder constructs a tree of these (for fast traversals) and
|
||||||
|
* assigns one for each display item.
|
||||||
|
*
|
||||||
|
* The animated geometry root for a display item is required to be a descendant
|
||||||
|
* (or equal to) the item's ReferenceFrame(), which means that we will fall back
|
||||||
|
* to returning aItem->ReferenceFrame() when we can't find another animated
|
||||||
|
* geometry root.
|
||||||
|
*
|
||||||
|
* The animated geometry root isn't strongly defined for a frame as transforms
|
||||||
|
* and background-attachment:fixed can cause it to vary between display items
|
||||||
|
* for a given frame.
|
||||||
|
*/
|
||||||
|
struct AnimatedGeometryRoot {
|
||||||
|
static already_AddRefed<AnimatedGeometryRoot> CreateAGRForFrame(
|
||||||
|
nsIFrame* aFrame, AnimatedGeometryRoot* aParent, bool aIsAsync,
|
||||||
|
bool aIsRetained) {
|
||||||
|
RefPtr<AnimatedGeometryRoot> result;
|
||||||
|
if (aIsRetained) {
|
||||||
|
result = aFrame->GetProperty(AnimatedGeometryRootCache());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
result->mParentAGR = aParent;
|
||||||
|
result->mIsAsync = aIsAsync;
|
||||||
|
} else {
|
||||||
|
result = new AnimatedGeometryRoot(aFrame, aParent, aIsAsync, aIsRetained);
|
||||||
|
}
|
||||||
|
return result.forget();
|
||||||
|
}
|
||||||
|
|
||||||
|
operator nsIFrame*() { return mFrame; }
|
||||||
|
|
||||||
|
nsIFrame* operator->() const { return mFrame; }
|
||||||
|
|
||||||
|
AnimatedGeometryRoot* GetAsyncAGR() {
|
||||||
|
AnimatedGeometryRoot* agr = this;
|
||||||
|
while (!agr->mIsAsync && agr->mParentAGR) {
|
||||||
|
agr = agr->mParentAGR;
|
||||||
|
}
|
||||||
|
return agr;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_INLINE_DECL_REFCOUNTING(AnimatedGeometryRoot)
|
||||||
|
|
||||||
|
nsIFrame* mFrame;
|
||||||
|
RefPtr<AnimatedGeometryRoot> mParentAGR;
|
||||||
|
bool mIsAsync;
|
||||||
|
bool mIsRetained;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static void DetachAGR(AnimatedGeometryRoot* aAGR) {
|
||||||
|
aAGR->mFrame = nullptr;
|
||||||
|
aAGR->mParentAGR = nullptr;
|
||||||
|
NS_RELEASE(aAGR);
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_DECLARE_FRAME_PROPERTY_WITH_DTOR(AnimatedGeometryRootCache,
|
||||||
|
AnimatedGeometryRoot, DetachAGR)
|
||||||
|
|
||||||
|
AnimatedGeometryRoot(nsIFrame* aFrame, AnimatedGeometryRoot* aParent,
|
||||||
|
bool aIsAsync, bool aIsRetained)
|
||||||
|
: mFrame(aFrame),
|
||||||
|
mParentAGR(aParent),
|
||||||
|
mIsAsync(aIsAsync),
|
||||||
|
mIsRetained(aIsRetained) {
|
||||||
|
MOZ_ASSERT(mParentAGR || mIsAsync,
|
||||||
|
"The root AGR should always be treated as an async AGR.");
|
||||||
|
if (mIsRetained) {
|
||||||
|
NS_ADDREF(this);
|
||||||
|
aFrame->SetProperty(AnimatedGeometryRootCache(), this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
~AnimatedGeometryRoot() {
|
||||||
|
if (mFrame && mIsRetained) {
|
||||||
|
mFrame->RemoveProperty(AnimatedGeometryRootCache());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An active scrolled root (ASR) is similar to an animated geometry root (AGR).
|
* An active scrolled root (ASR) is similar to an animated geometry root (AGR).
|
||||||
* The differences are:
|
* The differences are:
|
||||||
@@ -304,6 +395,13 @@ class nsDisplayListBuilder {
|
|||||||
bool mAllowAsyncAnimation;
|
bool mAllowAsyncAnimation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A frame can be in one of three states of AGR.
|
||||||
|
* AGR_NO means the frame is not an AGR for now.
|
||||||
|
* AGR_YES means the frame is an AGR for now.
|
||||||
|
*/
|
||||||
|
enum AGRState { AGR_NO, AGR_YES };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ViewID = layers::ScrollableLayerGuid::ViewID;
|
using ViewID = layers::ScrollableLayerGuid::ViewID;
|
||||||
|
|
||||||
@@ -557,6 +655,11 @@ class nsDisplayListBuilder {
|
|||||||
return mCurrentOffsetToReferenceFrame;
|
return mCurrentOffsetToReferenceFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimatedGeometryRoot* GetCurrentAnimatedGeometryRoot() { return mCurrentAGR; }
|
||||||
|
AnimatedGeometryRoot* GetRootAnimatedGeometryRoot() { return mRootAGR; }
|
||||||
|
|
||||||
|
void RecomputeCurrentAnimatedGeometryRoot();
|
||||||
|
|
||||||
void Check() { mPool.Check(); }
|
void Check() { mPool.Check(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -935,6 +1038,14 @@ class nsDisplayListBuilder {
|
|||||||
const DisplayItemClipChain* CopyWholeChain(
|
const DisplayItemClipChain* CopyWholeChain(
|
||||||
const DisplayItemClipChain* aClipChain);
|
const DisplayItemClipChain* aClipChain);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a new clip chain containing an intersection of all clips of
|
||||||
|
* |aClipChain| up to and including |aASR|.
|
||||||
|
* If there is no clip, returns nullptr.
|
||||||
|
*/
|
||||||
|
const DisplayItemClipChain* FuseClipChainUpTo(
|
||||||
|
const DisplayItemClipChain* aClipChain, const ActiveScrolledRoot* aASR);
|
||||||
|
|
||||||
const ActiveScrolledRoot* GetFilterASR() const { return mFilterASR; }
|
const ActiveScrolledRoot* GetFilterASR() const { return mFilterASR; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -975,6 +1086,8 @@ class nsDisplayListBuilder {
|
|||||||
mBuilder->mCurrentOffsetToReferenceFrame += aOffset;
|
mBuilder->mCurrentOffsetToReferenceFrame += aOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsAnimatedGeometryRoot() const { return mCurrentAGRState == AGR_YES; }
|
||||||
|
|
||||||
void RestoreBuildingInvisibleItemsValue() {
|
void RestoreBuildingInvisibleItemsValue() {
|
||||||
mBuilder->mBuildingInvisibleItems = mPrevBuildingInvisibleItems;
|
mBuilder->mBuildingInvisibleItems = mPrevBuildingInvisibleItems;
|
||||||
}
|
}
|
||||||
@@ -985,6 +1098,7 @@ class nsDisplayListBuilder {
|
|||||||
mBuilder->mCurrentOffsetToReferenceFrame = mPrevOffset;
|
mBuilder->mCurrentOffsetToReferenceFrame = mPrevOffset;
|
||||||
mBuilder->mVisibleRect = mPrevVisibleRect;
|
mBuilder->mVisibleRect = mPrevVisibleRect;
|
||||||
mBuilder->mDirtyRect = mPrevDirtyRect;
|
mBuilder->mDirtyRect = mPrevDirtyRect;
|
||||||
|
mBuilder->mCurrentAGR = mPrevAGR;
|
||||||
mBuilder->mAncestorHasApzAwareEventHandler =
|
mBuilder->mAncestorHasApzAwareEventHandler =
|
||||||
mPrevAncestorHasApzAwareEventHandler;
|
mPrevAncestorHasApzAwareEventHandler;
|
||||||
mBuilder->mBuildingInvisibleItems = mPrevBuildingInvisibleItems;
|
mBuilder->mBuildingInvisibleItems = mPrevBuildingInvisibleItems;
|
||||||
@@ -995,12 +1109,14 @@ class nsDisplayListBuilder {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
nsDisplayListBuilder* mBuilder;
|
nsDisplayListBuilder* mBuilder;
|
||||||
|
AGRState mCurrentAGRState;
|
||||||
const nsIFrame* mPrevFrame;
|
const nsIFrame* mPrevFrame;
|
||||||
const nsIFrame* mPrevReferenceFrame;
|
const nsIFrame* mPrevReferenceFrame;
|
||||||
nsPoint mPrevOffset;
|
nsPoint mPrevOffset;
|
||||||
Maybe<nsPoint> mPrevAdditionalOffset;
|
Maybe<nsPoint> mPrevAdditionalOffset;
|
||||||
nsRect mPrevVisibleRect;
|
nsRect mPrevVisibleRect;
|
||||||
nsRect mPrevDirtyRect;
|
nsRect mPrevDirtyRect;
|
||||||
|
RefPtr<AnimatedGeometryRoot> mPrevAGR;
|
||||||
gfx::CompositorHitTestInfo mPrevCompositorHitTestInfo;
|
gfx::CompositorHitTestInfo mPrevCompositorHitTestInfo;
|
||||||
bool mPrevAncestorHasApzAwareEventHandler;
|
bool mPrevAncestorHasApzAwareEventHandler;
|
||||||
bool mPrevBuildingInvisibleItems;
|
bool mPrevBuildingInvisibleItems;
|
||||||
@@ -1386,7 +1502,7 @@ class nsDisplayListBuilder {
|
|||||||
OutOfFlowDisplayData)
|
OutOfFlowDisplayData)
|
||||||
|
|
||||||
struct DisplayListBuildingData {
|
struct DisplayListBuildingData {
|
||||||
nsIFrame* mModifiedAGR = nullptr;
|
RefPtr<AnimatedGeometryRoot> mModifiedAGR = nullptr;
|
||||||
nsRect mDirtyRect;
|
nsRect mDirtyRect;
|
||||||
};
|
};
|
||||||
NS_DECLARE_FRAME_PROPERTY_DELETABLE(DisplayListBuildingRect,
|
NS_DECLARE_FRAME_PROPERTY_DELETABLE(DisplayListBuildingRect,
|
||||||
@@ -1577,6 +1693,13 @@ class nsDisplayListBuilder {
|
|||||||
return mBuildingExtraPagesForPageNum;
|
return mBuildingExtraPagesForPageNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a convenience function to ease the transition until AGRs and ASRs
|
||||||
|
* are unified.
|
||||||
|
*/
|
||||||
|
AnimatedGeometryRoot* AnimatedGeometryRootForASR(
|
||||||
|
const ActiveScrolledRoot* aASR);
|
||||||
|
|
||||||
bool HitTestIsForVisibility() const { return mVisibleThreshold.isSome(); }
|
bool HitTestIsForVisibility() const { return mVisibleThreshold.isSome(); }
|
||||||
|
|
||||||
float VisibilityThreshold() const {
|
float VisibilityThreshold() const {
|
||||||
@@ -1675,25 +1798,48 @@ class nsDisplayListBuilder {
|
|||||||
nsDisplayList* mList;
|
nsDisplayList* mList;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the nearest ancestor frame to aFrame that is considered to have
|
|
||||||
* (or will have) animated geometry. This can return aFrame.
|
|
||||||
*/
|
|
||||||
nsIFrame* FindAnimatedGeometryRootFrameFor(nsIFrame* aFrame);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
|
bool MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame, nsIFrame* aFrame,
|
||||||
const nsRect& aVisibleRect,
|
const nsRect& aVisibleRect,
|
||||||
const nsRect& aDirtyRect);
|
const nsRect& aDirtyRect);
|
||||||
|
|
||||||
friend class nsDisplayBackgroundImage;
|
|
||||||
friend struct RetainedDisplayListBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether a frame acts as an animated geometry root, optionally
|
* Returns whether a frame acts as an animated geometry root, optionally
|
||||||
* returning the next ancestor to check.
|
* returning the next ancestor to check.
|
||||||
*/
|
*/
|
||||||
bool IsAnimatedGeometryRoot(nsIFrame* aFrame, nsIFrame** aParent = nullptr);
|
AGRState IsAnimatedGeometryRoot(nsIFrame* aFrame, bool& aIsAsync,
|
||||||
|
nsIFrame** aParent = nullptr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the nearest ancestor frame to aFrame that is considered to have
|
||||||
|
* (or will have) animated geometry. This can return aFrame.
|
||||||
|
*/
|
||||||
|
nsIFrame* FindAnimatedGeometryRootFrameFor(nsIFrame* aFrame, bool& aIsAsync);
|
||||||
|
|
||||||
|
friend class nsDisplayCanvasBackgroundImage;
|
||||||
|
friend class nsDisplayBackgroundImage;
|
||||||
|
friend class nsDisplayFixedPosition;
|
||||||
|
friend class nsDisplayPerspective;
|
||||||
|
AnimatedGeometryRoot* FindAnimatedGeometryRootFor(nsDisplayItem* aItem);
|
||||||
|
|
||||||
|
friend class nsDisplayItem;
|
||||||
|
friend class nsDisplayOwnLayer;
|
||||||
|
friend struct RetainedDisplayListBuilder;
|
||||||
|
AnimatedGeometryRoot* FindAnimatedGeometryRootFor(nsIFrame* aFrame);
|
||||||
|
|
||||||
|
AnimatedGeometryRoot* WrapAGRForFrame(
|
||||||
|
nsIFrame* aAnimatedGeometryRoot, bool aIsAsync,
|
||||||
|
AnimatedGeometryRoot* aParent = nullptr);
|
||||||
|
|
||||||
|
nsTHashMap<nsIFrame*, RefPtr<AnimatedGeometryRoot>>
|
||||||
|
mFrameToAnimatedGeometryRootMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the current frame to the AGR budget if possible and remember
|
||||||
|
* the outcome. Subsequent calls will return the same value as
|
||||||
|
* returned here.
|
||||||
|
*/
|
||||||
|
bool AddToAGRBudget(nsIFrame* aFrame);
|
||||||
|
|
||||||
struct PresShellState {
|
struct PresShellState {
|
||||||
PresShell* mPresShell;
|
PresShell* mPresShell;
|
||||||
@@ -1757,6 +1903,9 @@ class nsDisplayListBuilder {
|
|||||||
|
|
||||||
Maybe<nsPoint> mAdditionalOffset;
|
Maybe<nsPoint> mAdditionalOffset;
|
||||||
|
|
||||||
|
RefPtr<AnimatedGeometryRoot> mRootAGR;
|
||||||
|
RefPtr<AnimatedGeometryRoot> mCurrentAGR;
|
||||||
|
|
||||||
// will-change budget tracker
|
// will-change budget tracker
|
||||||
typedef uint32_t DocumentWillChangeBudget;
|
typedef uint32_t DocumentWillChangeBudget;
|
||||||
nsTHashMap<nsPtrHashKey<const nsPresContext>, DocumentWillChangeBudget>
|
nsTHashMap<nsPtrHashKey<const nsPresContext>, DocumentWillChangeBudget>
|
||||||
@@ -1769,6 +1918,11 @@ class nsDisplayListBuilder {
|
|||||||
|
|
||||||
uint8_t mBuildingExtraPagesForPageNum;
|
uint8_t mBuildingExtraPagesForPageNum;
|
||||||
|
|
||||||
|
// Area of animated geometry root budget already allocated
|
||||||
|
uint32_t mUsedAGRBudget;
|
||||||
|
// Set of frames already counted in budget
|
||||||
|
nsTHashSet<nsIFrame*> mAGRBudgetSet;
|
||||||
|
|
||||||
nsTHashMap<nsPtrHashKey<dom::RemoteBrowser>, dom::EffectsInfo>
|
nsTHashMap<nsPtrHashKey<dom::RemoteBrowser>, dom::EffectsInfo>
|
||||||
mEffectsUpdates;
|
mEffectsUpdates;
|
||||||
|
|
||||||
@@ -2028,7 +2182,6 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
public:
|
public:
|
||||||
using Layer = layers::Layer;
|
using Layer = layers::Layer;
|
||||||
using LayerManager = layers::LayerManager;
|
using LayerManager = layers::LayerManager;
|
||||||
using WebRenderLayerManager = layers::WebRenderLayerManager;
|
|
||||||
using StackingContextHelper = layers::StackingContextHelper;
|
using StackingContextHelper = layers::StackingContextHelper;
|
||||||
using ViewID = layers::ScrollableLayerGuid::ViewID;
|
using ViewID = layers::ScrollableLayerGuid::ViewID;
|
||||||
|
|
||||||
@@ -2211,12 +2364,6 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
|
|
||||||
virtual bool CreatesStackingContextHelper() { return false; }
|
virtual bool CreatesStackingContextHelper() { return false; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if this item can be moved asynchronously on the compositor,
|
|
||||||
* see RetainedDisplayListBuilder.cpp comments.
|
|
||||||
*/
|
|
||||||
virtual bool CanMoveAsync() { return false; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// This is never instantiated directly (it has pure virtual methods), so no
|
// This is never instantiated directly (it has pure virtual methods), so no
|
||||||
// need to count constructors and destructors.
|
// need to count constructors and destructors.
|
||||||
@@ -2236,14 +2383,20 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
mExtraPageForPageNum(aOther.mExtraPageForPageNum),
|
mExtraPageForPageNum(aOther.mExtraPageForPageNum),
|
||||||
mPerFrameIndex(aOther.mPerFrameIndex),
|
mPerFrameIndex(aOther.mPerFrameIndex),
|
||||||
mBuildingRect(aOther.mBuildingRect),
|
mBuildingRect(aOther.mBuildingRect),
|
||||||
|
mReferenceFrame(aOther.mReferenceFrame),
|
||||||
mToReferenceFrame(aOther.mToReferenceFrame),
|
mToReferenceFrame(aOther.mToReferenceFrame),
|
||||||
|
mAnimatedGeometryRoot(aOther.mAnimatedGeometryRoot),
|
||||||
mActiveScrolledRoot(aOther.mActiveScrolledRoot),
|
mActiveScrolledRoot(aOther.mActiveScrolledRoot),
|
||||||
mClipChain(aOther.mClipChain) {
|
mClipChain(aOther.mClipChain),
|
||||||
|
mClip(aOther.mClip) {
|
||||||
MOZ_COUNT_CTOR(nsDisplayItem);
|
MOZ_COUNT_CTOR(nsDisplayItem);
|
||||||
// TODO: It might be better to remove the flags that aren't copied.
|
// TODO: It might be better to remove the flags that aren't copied.
|
||||||
if (aOther.ForceNotVisible()) {
|
if (aOther.ForceNotVisible()) {
|
||||||
mItemFlags += ItemFlag::ForceNotVisible;
|
mItemFlags += ItemFlag::ForceNotVisible;
|
||||||
}
|
}
|
||||||
|
if (aOther.IsSubpixelAADisabled()) {
|
||||||
|
mItemFlags += ItemFlag::DisableSubpixelAA;
|
||||||
|
}
|
||||||
if (mFrame->In3DContextAndBackfaceIsHidden()) {
|
if (mFrame->In3DContextAndBackfaceIsHidden()) {
|
||||||
mItemFlags += ItemFlag::BackfaceHidden;
|
mItemFlags += ItemFlag::BackfaceHidden;
|
||||||
}
|
}
|
||||||
@@ -2278,6 +2431,24 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
nsDisplayItem() = delete;
|
nsDisplayItem() = delete;
|
||||||
nsDisplayItem(const nsDisplayItem&) = delete;
|
nsDisplayItem(const nsDisplayItem&) = delete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Roll back side effects carried out by processing the display list.
|
||||||
|
*
|
||||||
|
* @return true if the rollback actually modified anything, to help the caller
|
||||||
|
* decide whether to invalidate cached information about this node.
|
||||||
|
*/
|
||||||
|
virtual bool RestoreState() {
|
||||||
|
if (mClipChain == mState.mClipChain && mClip == mState.mClip &&
|
||||||
|
!mItemFlags.contains(ItemFlag::DisableSubpixelAA)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mClipChain = mState.mClipChain;
|
||||||
|
mClip = mState.mClip;
|
||||||
|
mItemFlags -= ItemFlag::DisableSubpixelAA;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalidate cached information that depends on this node's contents, after
|
* Invalidate cached information that depends on this node's contents, after
|
||||||
* a mutation of those contents.
|
* a mutation of those contents.
|
||||||
@@ -2648,11 +2819,29 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
NS_ASSERTION(mFrame, "No frame?");
|
NS_ASSERTION(mFrame, "No frame?");
|
||||||
return mToReferenceFrame;
|
return mToReferenceFrame;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @return the root of the display list's frame (sub)tree, whose origin
|
||||||
|
* establishes the coordinate system for the display list
|
||||||
|
*/
|
||||||
|
const nsIFrame* ReferenceFrame() const { return mReferenceFrame; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the reference frame for display item children of this item.
|
* Returns the reference frame for display item children of this item.
|
||||||
*/
|
*/
|
||||||
virtual const nsIFrame* ReferenceFrameForChildren() const { return nullptr; }
|
virtual const nsIFrame* ReferenceFrameForChildren() const {
|
||||||
|
return mReferenceFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimatedGeometryRoot* GetAnimatedGeometryRoot() const {
|
||||||
|
MOZ_ASSERT(mAnimatedGeometryRoot,
|
||||||
|
"Must have cached AGR before accessing it!");
|
||||||
|
return mAnimatedGeometryRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual struct AnimatedGeometryRoot* AnimatedGeometryRootForScrollMetadata()
|
||||||
|
const {
|
||||||
|
return GetAnimatedGeometryRoot();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if this display item (or any children) contains content that might
|
* Checks if this display item (or any children) contains content that might
|
||||||
@@ -2664,6 +2853,16 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
return nsRect();
|
return nsRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable usage of component alpha. Currently only relevant for items that
|
||||||
|
* have text.
|
||||||
|
*/
|
||||||
|
void DisableComponentAlpha() { mItemFlags += ItemFlag::DisableSubpixelAA; }
|
||||||
|
|
||||||
|
bool IsSubpixelAADisabled() const {
|
||||||
|
return mItemFlags.contains(ItemFlag::DisableSubpixelAA);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we can add async animations to the layer for this display item.
|
* Check if we can add async animations to the layer for this display item.
|
||||||
*/
|
*/
|
||||||
@@ -2673,7 +2872,9 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
|
|
||||||
virtual bool SupportsOptimizingToImage() const { return false; }
|
virtual bool SupportsOptimizingToImage() const { return false; }
|
||||||
|
|
||||||
virtual const DisplayItemClip& GetClip() const;
|
const DisplayItemClip& GetClip() const {
|
||||||
|
return mClip ? *mClip : DisplayItemClip::NoClip();
|
||||||
|
}
|
||||||
void IntersectClip(nsDisplayListBuilder* aBuilder,
|
void IntersectClip(nsDisplayListBuilder* aBuilder,
|
||||||
const DisplayItemClipChain* aOther, bool aStore);
|
const DisplayItemClipChain* aOther, bool aStore);
|
||||||
|
|
||||||
@@ -2689,6 +2890,13 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
bool aStore);
|
bool aStore);
|
||||||
const DisplayItemClipChain* GetClipChain() const { return mClipChain; }
|
const DisplayItemClipChain* GetClipChain() const { return mClipChain; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Intersect all clips in our clip chain up to (and including) aASR and set
|
||||||
|
* set the intersection as this item's clip.
|
||||||
|
*/
|
||||||
|
void FuseClipChainUpTo(nsDisplayListBuilder* aBuilder,
|
||||||
|
const ActiveScrolledRoot* aASR);
|
||||||
|
|
||||||
bool BackfaceIsHidden() const {
|
bool BackfaceIsHidden() const {
|
||||||
return mItemFlags.contains(ItemFlag::BackfaceHidden);
|
return mItemFlags.contains(ItemFlag::BackfaceHidden);
|
||||||
}
|
}
|
||||||
@@ -2728,8 +2936,10 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
virtual Maybe<nsRect> GetClipWithRespectToASR(
|
virtual Maybe<nsRect> GetClipWithRespectToASR(
|
||||||
nsDisplayListBuilder* aBuilder, const ActiveScrolledRoot* aASR) const;
|
nsDisplayListBuilder* aBuilder, const ActiveScrolledRoot* aASR) const;
|
||||||
|
|
||||||
|
const nsRect& GetPaintRect() const { return mBuildingRect; }
|
||||||
|
|
||||||
virtual const nsRect& GetUntransformedPaintRect() const {
|
virtual const nsRect& GetUntransformedPaintRect() const {
|
||||||
return GetBuildingRect();
|
return GetPaintRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRect GetPaintRect(nsDisplayListBuilder* aBuilder, gfxContext* aCtx);
|
nsRect GetPaintRect(nsDisplayListBuilder* aBuilder, gfxContext* aCtx);
|
||||||
@@ -2751,6 +2961,7 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
#endif
|
#endif
|
||||||
BackfaceHidden,
|
BackfaceHidden,
|
||||||
Combines3DTransformWithAncestors,
|
Combines3DTransformWithAncestors,
|
||||||
|
DisableSubpixelAA,
|
||||||
ForceNotVisible,
|
ForceNotVisible,
|
||||||
HasHitTestInfo,
|
HasHitTestInfo,
|
||||||
IsGlassItem,
|
IsGlassItem,
|
||||||
@@ -2784,10 +2995,18 @@ class nsDisplayItem : public nsDisplayItemLink {
|
|||||||
void SetHasHitTestInfo() { mItemFlags += ItemFlag::HasHitTestInfo; }
|
void SetHasHitTestInfo() { mItemFlags += ItemFlag::HasHitTestInfo; }
|
||||||
|
|
||||||
// Result of ToReferenceFrame(mFrame), if mFrame is non-null
|
// Result of ToReferenceFrame(mFrame), if mFrame is non-null
|
||||||
|
const nsIFrame* mReferenceFrame;
|
||||||
nsPoint mToReferenceFrame;
|
nsPoint mToReferenceFrame;
|
||||||
|
|
||||||
|
RefPtr<AnimatedGeometryRoot> mAnimatedGeometryRoot;
|
||||||
RefPtr<const ActiveScrolledRoot> mActiveScrolledRoot;
|
RefPtr<const ActiveScrolledRoot> mActiveScrolledRoot;
|
||||||
RefPtr<const DisplayItemClipChain> mClipChain;
|
RefPtr<const DisplayItemClipChain> mClipChain;
|
||||||
|
const DisplayItemClip* mClip = nullptr;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
RefPtr<const DisplayItemClipChain> mClipChain;
|
||||||
|
const DisplayItemClip* mClip;
|
||||||
|
} mState;
|
||||||
|
|
||||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||||
public:
|
public:
|
||||||
@@ -2816,14 +3035,20 @@ class nsPaintedDisplayItem : public nsDisplayItem {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stores the given opacity value to be applied when drawing. It is an error
|
||||||
|
* to call this if CanApplyOpacity returned false.
|
||||||
|
*/
|
||||||
|
virtual void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity,
|
||||||
|
const DisplayItemClipChain* aClip) {
|
||||||
|
MOZ_ASSERT(CanApplyOpacity(), "ApplyOpacity is not supported on this type");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this display item would return true from ApplyOpacity
|
* Returns true if this display item would return true from ApplyOpacity
|
||||||
* without actually applying the opacity. Otherwise returns false.
|
* without actually applying the opacity. Otherwise returns false.
|
||||||
*/
|
*/
|
||||||
virtual bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
virtual bool CanApplyOpacity() const { return false; }
|
||||||
nsDisplayListBuilder* aBuilder) const {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this item supports PaintWithClip, where the clipping
|
* Returns true if this item supports PaintWithClip, where the clipping
|
||||||
@@ -4009,6 +4234,13 @@ class nsDisplayBackgroundImage : public nsPaintedDisplayItem {
|
|||||||
nsIFrame* aFrameForBounds = nullptr);
|
nsIFrame* aFrameForBounds = nullptr);
|
||||||
~nsDisplayBackgroundImage() override;
|
~nsDisplayBackgroundImage() override;
|
||||||
|
|
||||||
|
bool RestoreState() override {
|
||||||
|
bool superChanged = nsPaintedDisplayItem::RestoreState();
|
||||||
|
bool opacityChanged = (mOpacity != 1.0f);
|
||||||
|
mOpacity = 1.0f;
|
||||||
|
return (superChanged || opacityChanged);
|
||||||
|
}
|
||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("Background", TYPE_BACKGROUND)
|
NS_DISPLAY_DECL_NAME("Background", TYPE_BACKGROUND)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4039,9 +4271,11 @@ class nsDisplayBackgroundImage : public nsPaintedDisplayItem {
|
|||||||
bool* aSnap) const override;
|
bool* aSnap) const override;
|
||||||
Maybe<nscolor> IsUniform(nsDisplayListBuilder* aBuilder) const override;
|
Maybe<nscolor> IsUniform(nsDisplayListBuilder* aBuilder) const override;
|
||||||
|
|
||||||
bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
bool CanApplyOpacity() const override { return true; }
|
||||||
nsDisplayListBuilder* aBuilder) const override {
|
|
||||||
return CanBuildWebRenderDisplayItems(aManager, aBuilder);
|
void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity,
|
||||||
|
const DisplayItemClipChain* aClip) override {
|
||||||
|
mOpacity = aOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4110,7 +4344,7 @@ class nsDisplayBackgroundImage : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool CanBuildWebRenderDisplayItems(layers::WebRenderLayerManager* aManager,
|
bool CanBuildWebRenderDisplayItems(layers::WebRenderLayerManager* aManager,
|
||||||
nsDisplayListBuilder* aBuilder) const;
|
nsDisplayListBuilder* aBuilder);
|
||||||
nsRect GetBoundsInternal(nsDisplayListBuilder* aBuilder,
|
nsRect GetBoundsInternal(nsDisplayListBuilder* aBuilder,
|
||||||
nsIFrame* aFrameForBounds = nullptr);
|
nsIFrame* aFrameForBounds = nullptr);
|
||||||
|
|
||||||
@@ -4131,6 +4365,8 @@ class nsDisplayBackgroundImage : public nsPaintedDisplayItem {
|
|||||||
bool mIsRasterImage;
|
bool mIsRasterImage;
|
||||||
/* Whether the image should be treated as fixed to the viewport. */
|
/* Whether the image should be treated as fixed to the viewport. */
|
||||||
bool mShouldFixToViewport;
|
bool mShouldFixToViewport;
|
||||||
|
uint32_t mImageFlags;
|
||||||
|
float mOpacity;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4295,6 +4531,8 @@ class nsDisplayBackgroundColor : public nsPaintedDisplayItem {
|
|||||||
mHasStyle(aBackgroundStyle),
|
mHasStyle(aBackgroundStyle),
|
||||||
mDependentFrame(nullptr),
|
mDependentFrame(nullptr),
|
||||||
mColor(gfx::sRGBColor::FromABGR(aColor)) {
|
mColor(gfx::sRGBColor::FromABGR(aColor)) {
|
||||||
|
mState.mColor = mColor;
|
||||||
|
|
||||||
if (mHasStyle) {
|
if (mHasStyle) {
|
||||||
mBottomLayerClip =
|
mBottomLayerClip =
|
||||||
aBackgroundStyle->StyleBackground()->BottomLayer().mClip;
|
aBackgroundStyle->StyleBackground()->BottomLayer().mClip;
|
||||||
@@ -4311,6 +4549,15 @@ class nsDisplayBackgroundColor : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("BackgroundColor", TYPE_BACKGROUND_COLOR)
|
NS_DISPLAY_DECL_NAME("BackgroundColor", TYPE_BACKGROUND_COLOR)
|
||||||
|
|
||||||
|
bool RestoreState() override {
|
||||||
|
if (!nsPaintedDisplayItem::RestoreState() && mColor == mState.mColor) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mColor = mState.mColor;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool HasBackgroundClipText() const {
|
bool HasBackgroundClipText() const {
|
||||||
MOZ_ASSERT(mHasStyle);
|
MOZ_ASSERT(mHasStyle);
|
||||||
return mBottomLayerClip == StyleGeometryBox::Text;
|
return mBottomLayerClip == StyleGeometryBox::Text;
|
||||||
@@ -4329,8 +4576,10 @@ class nsDisplayBackgroundColor : public nsPaintedDisplayItem {
|
|||||||
Maybe<nscolor> IsUniform(nsDisplayListBuilder* aBuilder) const override;
|
Maybe<nscolor> IsUniform(nsDisplayListBuilder* aBuilder) const override;
|
||||||
void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||||
HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override;
|
HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override;
|
||||||
bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity,
|
||||||
nsDisplayListBuilder* aBuilder) const override;
|
const DisplayItemClipChain* aClip) override;
|
||||||
|
|
||||||
|
bool CanApplyOpacity() const override;
|
||||||
|
|
||||||
float GetOpacity() const { return mColor.a; }
|
float GetOpacity() const { return mColor.a; }
|
||||||
|
|
||||||
@@ -4400,6 +4649,10 @@ class nsDisplayBackgroundColor : public nsPaintedDisplayItem {
|
|||||||
StyleGeometryBox mBottomLayerClip;
|
StyleGeometryBox mBottomLayerClip;
|
||||||
nsIFrame* mDependentFrame;
|
nsIFrame* mDependentFrame;
|
||||||
gfx::sRGBColor mColor;
|
gfx::sRGBColor mColor;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
gfx::sRGBColor mColor;
|
||||||
|
} mState;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsDisplayTableBackgroundColor : public nsDisplayBackgroundColor {
|
class nsDisplayTableBackgroundColor : public nsDisplayBackgroundColor {
|
||||||
@@ -4448,7 +4701,7 @@ class nsDisplayTableBackgroundColor : public nsDisplayBackgroundColor {
|
|||||||
class nsDisplayBoxShadowOuter final : public nsPaintedDisplayItem {
|
class nsDisplayBoxShadowOuter final : public nsPaintedDisplayItem {
|
||||||
public:
|
public:
|
||||||
nsDisplayBoxShadowOuter(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
|
nsDisplayBoxShadowOuter(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
|
||||||
: nsPaintedDisplayItem(aBuilder, aFrame) {
|
: nsPaintedDisplayItem(aBuilder, aFrame), mOpacity(1.0f) {
|
||||||
MOZ_COUNT_CTOR(nsDisplayBoxShadowOuter);
|
MOZ_COUNT_CTOR(nsDisplayBoxShadowOuter);
|
||||||
mBounds = GetBoundsInternal();
|
mBounds = GetBoundsInternal();
|
||||||
}
|
}
|
||||||
@@ -4457,6 +4710,15 @@ class nsDisplayBoxShadowOuter final : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("BoxShadowOuter", TYPE_BOX_SHADOW_OUTER)
|
NS_DISPLAY_DECL_NAME("BoxShadowOuter", TYPE_BOX_SHADOW_OUTER)
|
||||||
|
|
||||||
|
bool RestoreState() override {
|
||||||
|
if (!nsPaintedDisplayItem::RestoreState() && mOpacity == 1.0f) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mOpacity = 1.0f;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
|
void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
|
||||||
nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const override;
|
nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const override;
|
||||||
bool IsInvisibleInRect(const nsRect& aRect) const override;
|
bool IsInvisibleInRect(const nsRect& aRect) const override;
|
||||||
@@ -4464,12 +4726,21 @@ class nsDisplayBoxShadowOuter final : public nsPaintedDisplayItem {
|
|||||||
const nsDisplayItemGeometry* aGeometry,
|
const nsDisplayItemGeometry* aGeometry,
|
||||||
nsRegion* aInvalidRegion) const override;
|
nsRegion* aInvalidRegion) const override;
|
||||||
|
|
||||||
bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity,
|
||||||
nsDisplayListBuilder* aBuilder) const override {
|
const DisplayItemClipChain* aClip) override {
|
||||||
return CanBuildWebRenderDisplayItems();
|
NS_ASSERTION(CanApplyOpacity(), "ApplyOpacity should be allowed");
|
||||||
|
mOpacity = aOpacity;
|
||||||
|
IntersectClip(aBuilder, aClip, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanBuildWebRenderDisplayItems() const;
|
bool CanApplyOpacity() const override { return true; }
|
||||||
|
|
||||||
|
nsDisplayItemGeometry* AllocateGeometry(
|
||||||
|
nsDisplayListBuilder* aBuilder) override {
|
||||||
|
return new nsDisplayBoxShadowOuterGeometry(this, aBuilder, mOpacity);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CanBuildWebRenderDisplayItems();
|
||||||
bool CreateWebRenderCommands(
|
bool CreateWebRenderCommands(
|
||||||
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
||||||
const StackingContextHelper& aSc,
|
const StackingContextHelper& aSc,
|
||||||
@@ -4479,6 +4750,7 @@ class nsDisplayBoxShadowOuter final : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
nsRect mBounds;
|
nsRect mBounds;
|
||||||
|
float mOpacity;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4671,7 +4943,6 @@ class nsDisplayWrapList : public nsPaintedDisplayItem {
|
|||||||
MOZ_COUNT_CTOR(nsDisplayWrapList);
|
MOZ_COUNT_CTOR(nsDisplayWrapList);
|
||||||
mBaseBuildingRect = GetBuildingRect();
|
mBaseBuildingRect = GetBuildingRect();
|
||||||
mListPtr = &mList;
|
mListPtr = &mList;
|
||||||
mOriginalClipChain = mClipChain;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsDisplayWrapList() = delete;
|
nsDisplayWrapList() = delete;
|
||||||
@@ -4689,7 +4960,6 @@ class nsDisplayWrapList : public nsPaintedDisplayItem {
|
|||||||
mMergedFrames(aOther.mMergedFrames.Clone()),
|
mMergedFrames(aOther.mMergedFrames.Clone()),
|
||||||
mBounds(aOther.mBounds),
|
mBounds(aOther.mBounds),
|
||||||
mBaseBuildingRect(aOther.mBaseBuildingRect),
|
mBaseBuildingRect(aOther.mBaseBuildingRect),
|
||||||
mOriginalClipChain(aOther.mClipChain),
|
|
||||||
mOverrideZIndex(aOther.mOverrideZIndex),
|
mOverrideZIndex(aOther.mOverrideZIndex),
|
||||||
mHasZIndexOverride(aOther.mHasZIndexOverride),
|
mHasZIndexOverride(aOther.mHasZIndexOverride),
|
||||||
mClearingClipChain(aOther.mClearingClipChain) {
|
mClearingClipChain(aOther.mClearingClipChain) {
|
||||||
@@ -4721,7 +4991,7 @@ class nsDisplayWrapList : public nsPaintedDisplayItem {
|
|||||||
// Clear the clip chain up to the asr, but don't store it, so that we'll
|
// Clear the clip chain up to the asr, but don't store it, so that we'll
|
||||||
// recover it when we reuse the item.
|
// recover it when we reuse the item.
|
||||||
if (mClearingClipChain) {
|
if (mClearingClipChain) {
|
||||||
const DisplayItemClipChain* clip = mOriginalClipChain;
|
const DisplayItemClipChain* clip = mState.mClipChain;
|
||||||
while (clip && ActiveScrolledRoot::IsAncestor(GetActiveScrolledRoot(),
|
while (clip && ActiveScrolledRoot::IsAncestor(GetActiveScrolledRoot(),
|
||||||
clip->mASR)) {
|
clip->mASR)) {
|
||||||
clip = clip->mParent;
|
clip = clip->mParent;
|
||||||
@@ -4743,15 +5013,6 @@ class nsDisplayWrapList : public nsPaintedDisplayItem {
|
|||||||
SetBuildingRect(buildingRect);
|
SetBuildingRect(buildingRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetClipChain(const DisplayItemClipChain* aClipChain,
|
|
||||||
bool aStore) override {
|
|
||||||
nsDisplayItem::SetClipChain(aClipChain, aStore);
|
|
||||||
|
|
||||||
if (aStore) {
|
|
||||||
mOriginalClipChain = mClipChain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||||
HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override;
|
HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override;
|
||||||
nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const override;
|
nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const override;
|
||||||
@@ -4811,6 +5072,11 @@ class nsDisplayWrapList : public nsPaintedDisplayItem {
|
|||||||
nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) const override;
|
nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) const override;
|
||||||
|
|
||||||
RetainedDisplayList* GetSameCoordinateSystemChildren() const override {
|
RetainedDisplayList* GetSameCoordinateSystemChildren() const override {
|
||||||
|
NS_ASSERTION(
|
||||||
|
mListPtr->IsEmpty() || !ReferenceFrame() ||
|
||||||
|
!mListPtr->GetBottom()->ReferenceFrame() ||
|
||||||
|
mListPtr->GetBottom()->ReferenceFrame() == ReferenceFrame(),
|
||||||
|
"Children must have same reference frame");
|
||||||
return mListPtr;
|
return mListPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4870,7 +5136,6 @@ class nsDisplayWrapList : public nsPaintedDisplayItem {
|
|||||||
// Displaylist building rect contributed by this display item itself.
|
// Displaylist building rect contributed by this display item itself.
|
||||||
// Our mBuildingRect may include the visible areas of children.
|
// Our mBuildingRect may include the visible areas of children.
|
||||||
nsRect mBaseBuildingRect;
|
nsRect mBaseBuildingRect;
|
||||||
RefPtr<const DisplayItemClipChain> mOriginalClipChain;
|
|
||||||
int32_t mOverrideZIndex;
|
int32_t mOverrideZIndex;
|
||||||
bool mHasZIndexOverride;
|
bool mHasZIndexOverride;
|
||||||
bool mClearingClipChain = false;
|
bool mClearingClipChain = false;
|
||||||
@@ -4957,6 +5222,15 @@ class nsDisplayOpacity : public nsDisplayWrapList {
|
|||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY)
|
NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY)
|
||||||
|
|
||||||
|
bool RestoreState() override {
|
||||||
|
if (!nsDisplayWrapList::RestoreState() && mOpacity == mState.mOpacity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mOpacity = mState.mOpacity;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void InvalidateCachedChildInfo(nsDisplayListBuilder* aBuilder) override {
|
void InvalidateCachedChildInfo(nsDisplayListBuilder* aBuilder) override {
|
||||||
mChildOpacityState = ChildOpacityState::Unknown;
|
mChildOpacityState = ChildOpacityState::Unknown;
|
||||||
}
|
}
|
||||||
@@ -4989,15 +5263,10 @@ class nsDisplayOpacity : public nsDisplayWrapList {
|
|||||||
}
|
}
|
||||||
return nsDisplayWrapList::IsInvalid(aRect);
|
return nsDisplayWrapList::IsInvalid(aRect);
|
||||||
}
|
}
|
||||||
bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity,
|
||||||
nsDisplayListBuilder* aBuilder) const override;
|
const DisplayItemClipChain* aClip) override;
|
||||||
bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override {
|
bool CanApplyOpacity() const override;
|
||||||
return false;
|
bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override;
|
||||||
}
|
|
||||||
|
|
||||||
bool CanApplyOpacityToChildren(WebRenderLayerManager* aManager,
|
|
||||||
nsDisplayListBuilder* aBuilder,
|
|
||||||
float aInheritedOpacity);
|
|
||||||
|
|
||||||
bool NeedsGeometryUpdates() const override {
|
bool NeedsGeometryUpdates() const override {
|
||||||
// For flattened nsDisplayOpacity items, ComputeInvalidationRegion() only
|
// For flattened nsDisplayOpacity items, ComputeInvalidationRegion() only
|
||||||
@@ -5032,9 +5301,8 @@ class nsDisplayOpacity : public nsDisplayWrapList {
|
|||||||
private:
|
private:
|
||||||
NS_DISPLAY_ALLOW_CLONING()
|
NS_DISPLAY_ALLOW_CLONING()
|
||||||
|
|
||||||
bool CanApplyToChildren(WebRenderLayerManager* aManager,
|
bool ApplyToChildren(nsDisplayListBuilder* aBuilder);
|
||||||
nsDisplayListBuilder* aBuilder);
|
bool ApplyToFilterOrMask(const bool aUsingLayers);
|
||||||
bool ApplyToMask();
|
|
||||||
|
|
||||||
float mOpacity;
|
float mOpacity;
|
||||||
bool mForEventsOnly : 1;
|
bool mForEventsOnly : 1;
|
||||||
@@ -5053,6 +5321,10 @@ class nsDisplayOpacity : public nsDisplayWrapList {
|
|||||||
#else
|
#else
|
||||||
ChildOpacityState mChildOpacityState;
|
ChildOpacityState mChildOpacityState;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct {
|
||||||
|
float mOpacity;
|
||||||
|
} mState{};
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsDisplayBlendMode : public nsDisplayWrapList {
|
class nsDisplayBlendMode : public nsDisplayWrapList {
|
||||||
@@ -5429,9 +5701,8 @@ class nsDisplayStickyPosition : public nsDisplayOwnLayer {
|
|||||||
|
|
||||||
MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayStickyPosition)
|
MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayStickyPosition)
|
||||||
|
|
||||||
const DisplayItemClip& GetClip() const override {
|
void SetClipChain(const DisplayItemClipChain* aClipChain,
|
||||||
return DisplayItemClip::NoClip();
|
bool aStore) override;
|
||||||
}
|
|
||||||
bool IsClippedToDisplayPort() const { return mClippedToDisplayPort; }
|
bool IsClippedToDisplayPort() const { return mClippedToDisplayPort; }
|
||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("StickyPosition", TYPE_STICKY_POSITION)
|
NS_DISPLAY_DECL_NAME("StickyPosition", TYPE_STICKY_POSITION)
|
||||||
@@ -5453,8 +5724,6 @@ class nsDisplayStickyPosition : public nsDisplayOwnLayer {
|
|||||||
|
|
||||||
bool CreatesStackingContextHelper() override { return true; }
|
bool CreatesStackingContextHelper() override { return true; }
|
||||||
|
|
||||||
bool CanMoveAsync() override { return true; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NS_DISPLAY_ALLOW_CLONING()
|
NS_DISPLAY_ALLOW_CLONING()
|
||||||
|
|
||||||
@@ -5492,6 +5761,8 @@ class nsDisplayFixedPosition : public nsDisplayOwnLayer {
|
|||||||
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder,
|
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayFixedPosition& aOther)
|
const nsDisplayFixedPosition& aOther)
|
||||||
: nsDisplayOwnLayer(aBuilder, aOther),
|
: nsDisplayOwnLayer(aBuilder, aOther),
|
||||||
|
mAnimatedGeometryRootForScrollMetadata(
|
||||||
|
aOther.mAnimatedGeometryRootForScrollMetadata),
|
||||||
mContainerASR(aOther.mContainerASR),
|
mContainerASR(aOther.mContainerASR),
|
||||||
mIsFixedBackground(aOther.mIsFixedBackground) {
|
mIsFixedBackground(aOther.mIsFixedBackground) {
|
||||||
MOZ_COUNT_CTOR(nsDisplayFixedPosition);
|
MOZ_COUNT_CTOR(nsDisplayFixedPosition);
|
||||||
@@ -5515,6 +5786,10 @@ class nsDisplayFixedPosition : public nsDisplayOwnLayer {
|
|||||||
return mIsFixedBackground;
|
return mIsFixedBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimatedGeometryRoot* AnimatedGeometryRootForScrollMetadata() const override {
|
||||||
|
return mAnimatedGeometryRootForScrollMetadata;
|
||||||
|
}
|
||||||
|
|
||||||
bool CreateWebRenderCommands(
|
bool CreateWebRenderCommands(
|
||||||
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
||||||
const StackingContextHelper& aSc,
|
const StackingContextHelper& aSc,
|
||||||
@@ -5528,8 +5803,10 @@ class nsDisplayFixedPosition : public nsDisplayOwnLayer {
|
|||||||
// For background-attachment:fixed
|
// For background-attachment:fixed
|
||||||
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
nsDisplayFixedPosition(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||||
nsDisplayList* aList);
|
nsDisplayList* aList);
|
||||||
|
void Init(nsDisplayListBuilder* aBuilder);
|
||||||
ViewID GetScrollTargetId();
|
ViewID GetScrollTargetId();
|
||||||
|
|
||||||
|
RefPtr<AnimatedGeometryRoot> mAnimatedGeometryRootForScrollMetadata;
|
||||||
RefPtr<const ActiveScrolledRoot> mContainerASR;
|
RefPtr<const ActiveScrolledRoot> mContainerASR;
|
||||||
bool mIsFixedBackground;
|
bool mIsFixedBackground;
|
||||||
|
|
||||||
@@ -5708,7 +5985,8 @@ class nsDisplayEffectsBase : public nsDisplayWrapList {
|
|||||||
nsDisplayEffectsBase(nsDisplayListBuilder* aBuilder,
|
nsDisplayEffectsBase(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayEffectsBase& aOther)
|
const nsDisplayEffectsBase& aOther)
|
||||||
: nsDisplayWrapList(aBuilder, aOther),
|
: nsDisplayWrapList(aBuilder, aOther),
|
||||||
mEffectsBounds(aOther.mEffectsBounds) {
|
mEffectsBounds(aOther.mEffectsBounds),
|
||||||
|
mHandleOpacity(aOther.mHandleOpacity) {
|
||||||
MOZ_COUNT_CTOR(nsDisplayEffectsBase);
|
MOZ_COUNT_CTOR(nsDisplayEffectsBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5719,10 +5997,25 @@ class nsDisplayEffectsBase : public nsDisplayWrapList {
|
|||||||
void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
|
||||||
HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override;
|
HitTestState* aState, nsTArray<nsIFrame*>* aOutFrames) override;
|
||||||
|
|
||||||
|
bool RestoreState() override {
|
||||||
|
if (!nsDisplayWrapList::RestoreState() && !mHandleOpacity) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mHandleOpacity = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override {
|
bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) override {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void SelectOpacityOptimization(const bool /* aUsingLayers */) {
|
||||||
|
SetHandleOpacity();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ShouldHandleOpacity() const { return mHandleOpacity; }
|
||||||
|
|
||||||
gfxRect BBoxInUserSpace() const;
|
gfxRect BBoxInUserSpace() const;
|
||||||
gfxPoint UserSpaceOffset() const;
|
gfxPoint UserSpaceOffset() const;
|
||||||
|
|
||||||
@@ -5731,10 +6024,13 @@ class nsDisplayEffectsBase : public nsDisplayWrapList {
|
|||||||
nsRegion* aInvalidRegion) const override;
|
nsRegion* aInvalidRegion) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void SetHandleOpacity() { mHandleOpacity = true; }
|
||||||
bool ValidateSVGFrame();
|
bool ValidateSVGFrame();
|
||||||
|
|
||||||
// relative to mFrame
|
// relative to mFrame
|
||||||
nsRect mEffectsBounds;
|
nsRect mEffectsBounds;
|
||||||
|
// True if we need to handle css opacity in this display item.
|
||||||
|
bool mHandleOpacity;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -5800,10 +6096,12 @@ class nsDisplayMasksAndClipPaths : public nsDisplayEffectsBase {
|
|||||||
* return whether the mask layer was painted successfully.
|
* return whether the mask layer was painted successfully.
|
||||||
*/
|
*/
|
||||||
bool PaintMask(nsDisplayListBuilder* aBuilder, gfxContext* aMaskContext,
|
bool PaintMask(nsDisplayListBuilder* aBuilder, gfxContext* aMaskContext,
|
||||||
bool aHandleOpacity, bool* aMaskPainted = nullptr);
|
bool* aMaskPainted = nullptr);
|
||||||
|
|
||||||
const nsTArray<nsRect>& GetDestRects() { return mDestRects; }
|
const nsTArray<nsRect>& GetDestRects() { return mDestRects; }
|
||||||
|
|
||||||
|
void SelectOpacityOptimization(const bool aUsingLayers) override;
|
||||||
|
|
||||||
bool CreateWebRenderCommands(
|
bool CreateWebRenderCommands(
|
||||||
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
wr::DisplayListBuilder& aBuilder, wr::IpcResourceUpdateQueue& aResources,
|
||||||
const StackingContextHelper& aSc,
|
const StackingContextHelper& aSc,
|
||||||
@@ -5824,6 +6122,7 @@ class nsDisplayMasksAndClipPaths : public nsDisplayEffectsBase {
|
|||||||
bool CanPaintOnMaskLayer(LayerManager* aManager);
|
bool CanPaintOnMaskLayer(LayerManager* aManager);
|
||||||
|
|
||||||
nsTArray<nsRect> mDestRects;
|
nsTArray<nsRect> mDestRects;
|
||||||
|
bool mApplyOpacityWithSimpleClipPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsDisplayBackdropRootContainer : public nsDisplayWrapList {
|
class nsDisplayBackdropRootContainer : public nsDisplayWrapList {
|
||||||
@@ -5954,12 +6253,7 @@ class nsDisplayFilters : public nsDisplayEffectsBase {
|
|||||||
const StackingContextHelper& aSc,
|
const StackingContextHelper& aSc,
|
||||||
layers::RenderRootStateManager* aManager,
|
layers::RenderRootStateManager* aManager,
|
||||||
nsDisplayListBuilder* aDisplayListBuilder) override;
|
nsDisplayListBuilder* aDisplayListBuilder) override;
|
||||||
bool CanCreateWebRenderCommands() const;
|
bool CanCreateWebRenderCommands();
|
||||||
|
|
||||||
bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
|
||||||
nsDisplayListBuilder* aBuilder) const override {
|
|
||||||
return CanCreateWebRenderCommands();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CreatesStackingContextHelper() override { return true; }
|
bool CreatesStackingContextHelper() override { return true; }
|
||||||
|
|
||||||
@@ -5968,7 +6262,6 @@ class nsDisplayFilters : public nsDisplayEffectsBase {
|
|||||||
|
|
||||||
// relative to mFrame
|
// relative to mFrame
|
||||||
nsRect mEffectsBounds;
|
nsRect mEffectsBounds;
|
||||||
nsRect mVisibleRect;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A display item that applies a transformation to all of its descendant
|
/* A display item that applies a transformation to all of its descendant
|
||||||
@@ -6014,6 +6307,15 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("nsDisplayTransform", TYPE_TRANSFORM)
|
NS_DISPLAY_DECL_NAME("nsDisplayTransform", TYPE_TRANSFORM)
|
||||||
|
|
||||||
|
bool RestoreState() override {
|
||||||
|
if (!nsPaintedDisplayItem::RestoreState() && !mShouldFlatten) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mShouldFlatten = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateBounds(nsDisplayListBuilder* aBuilder) override;
|
void UpdateBounds(nsDisplayListBuilder* aBuilder) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6083,6 +6385,8 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NeedsGeometryUpdates() const override { return mShouldFlatten; }
|
||||||
|
|
||||||
const nsIFrame* ReferenceFrameForChildren() const override {
|
const nsIFrame* ReferenceFrameForChildren() const override {
|
||||||
// If we were created using a transform-getter, then we don't
|
// If we were created using a transform-getter, then we don't
|
||||||
// belong to a transformed frame, and aren't a reference frame
|
// belong to a transformed frame, and aren't a reference frame
|
||||||
@@ -6093,6 +6397,10 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
return nsPaintedDisplayItem::ReferenceFrameForChildren();
|
return nsPaintedDisplayItem::ReferenceFrameForChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AnimatedGeometryRoot* AnimatedGeometryRootForScrollMetadata() const override {
|
||||||
|
return mAnimatedGeometryRootForScrollMetadata;
|
||||||
|
}
|
||||||
|
|
||||||
const nsRect& GetBuildingRectForChildren() const override {
|
const nsRect& GetBuildingRectForChildren() const override {
|
||||||
return mChildrenBuildingRect;
|
return mChildrenBuildingRect;
|
||||||
}
|
}
|
||||||
@@ -6157,6 +6465,11 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
return UntransformRect(aBuilder, GetBuildingRect(), aOutRect);
|
return UntransformRect(aBuilder, GetBuildingRect(), aOutRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UntransformPaintRect(nsDisplayListBuilder* aBuilder,
|
||||||
|
nsRect* aOutRect) const {
|
||||||
|
return UntransformRect(aBuilder, GetPaintRect(), aOutRect);
|
||||||
|
}
|
||||||
|
|
||||||
static gfx::Point3D GetDeltaToTransformOrigin(const nsIFrame* aFrame,
|
static gfx::Point3D GetDeltaToTransformOrigin(const nsIFrame* aFrame,
|
||||||
TransformReferenceBox&,
|
TransformReferenceBox&,
|
||||||
float aAppUnitsPerPixel);
|
float aAppUnitsPerPixel);
|
||||||
@@ -6267,11 +6580,6 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
void WriteDebugInfo(std::stringstream& aStream) override;
|
void WriteDebugInfo(std::stringstream& aStream) override;
|
||||||
|
|
||||||
bool CanMoveAsync() override {
|
|
||||||
return EffectCompositor::HasAnimationsForCompositor(
|
|
||||||
mFrame, DisplayItemType::TYPE_TRANSFORM);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This item is an additional item as the boundary between parent
|
* This item is an additional item as the boundary between parent
|
||||||
* and child 3D rendering context.
|
* and child 3D rendering context.
|
||||||
@@ -6326,6 +6634,8 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
mutable Maybe<Matrix4x4Flagged> mInverseTransform;
|
mutable Maybe<Matrix4x4Flagged> mInverseTransform;
|
||||||
// Accumulated transform of ancestors on the preserves-3d chain.
|
// Accumulated transform of ancestors on the preserves-3d chain.
|
||||||
UniquePtr<Matrix4x4> mTransformPreserves3D;
|
UniquePtr<Matrix4x4> mTransformPreserves3D;
|
||||||
|
RefPtr<AnimatedGeometryRoot> mAnimatedGeometryRootForChildren;
|
||||||
|
RefPtr<AnimatedGeometryRoot> mAnimatedGeometryRootForScrollMetadata;
|
||||||
nsRect mChildrenBuildingRect;
|
nsRect mChildrenBuildingRect;
|
||||||
mutable RetainedDisplayList mChildren;
|
mutable RetainedDisplayList mChildren;
|
||||||
|
|
||||||
@@ -6342,6 +6652,8 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
|
|||||||
// parent context unintendedly if the root of the child preserves3d context
|
// parent context unintendedly if the root of the child preserves3d context
|
||||||
// doesn't create a transform item.
|
// doesn't create a transform item.
|
||||||
bool mIsTransformSeparator : 1;
|
bool mIsTransformSeparator : 1;
|
||||||
|
// True if this nsDisplayTransform should get flattened
|
||||||
|
bool mShouldFlatten : 1;
|
||||||
// True if we have a transform getter.
|
// True if we have a transform getter.
|
||||||
bool mHasTransformGetter : 1;
|
bool mHasTransformGetter : 1;
|
||||||
};
|
};
|
||||||
@@ -6434,6 +6746,15 @@ class nsDisplayText final : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("Text", TYPE_TEXT)
|
NS_DISPLAY_DECL_NAME("Text", TYPE_TEXT)
|
||||||
|
|
||||||
|
bool RestoreState() final {
|
||||||
|
if (!nsPaintedDisplayItem::RestoreState() && mOpacity == 1.0f) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
mOpacity = 1.0f;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const final {
|
nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const final {
|
||||||
*aSnap = false;
|
*aSnap = false;
|
||||||
return mBounds;
|
return mBounds;
|
||||||
@@ -6473,11 +6794,16 @@ class nsDisplayText final : public nsPaintedDisplayItem {
|
|||||||
nsRegion* aInvalidRegion) const final;
|
nsRegion* aInvalidRegion) const final;
|
||||||
|
|
||||||
void RenderToContext(gfxContext* aCtx, nsDisplayListBuilder* aBuilder,
|
void RenderToContext(gfxContext* aCtx, nsDisplayListBuilder* aBuilder,
|
||||||
const nsRect& aVisibleRect, float aOpacity = 1.0f,
|
|
||||||
bool aIsRecording = false);
|
bool aIsRecording = false);
|
||||||
|
|
||||||
bool CanApplyOpacity(WebRenderLayerManager* aManager,
|
bool CanApplyOpacity() const final;
|
||||||
nsDisplayListBuilder* aBuilder) const final;
|
|
||||||
|
void ApplyOpacity(nsDisplayListBuilder* aBuilder, float aOpacity,
|
||||||
|
const DisplayItemClipChain* aClip) final {
|
||||||
|
NS_ASSERTION(CanApplyOpacity(), "ApplyOpacity should be allowed");
|
||||||
|
mOpacity = aOpacity;
|
||||||
|
IntersectClip(aBuilder, aClip, false);
|
||||||
|
}
|
||||||
|
|
||||||
void WriteDebugInfo(std::stringstream& aStream) final;
|
void WriteDebugInfo(std::stringstream& aStream) final;
|
||||||
|
|
||||||
@@ -6516,10 +6842,11 @@ class nsDisplayText final : public nsPaintedDisplayItem {
|
|||||||
|
|
||||||
nscoord& VisIStartEdge() { return mVisIStartEdge; }
|
nscoord& VisIStartEdge() { return mVisIStartEdge; }
|
||||||
nscoord& VisIEndEdge() { return mVisIEndEdge; }
|
nscoord& VisIEndEdge() { return mVisIEndEdge; }
|
||||||
|
float Opacity() const { return mOpacity; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsRect mBounds;
|
nsRect mBounds;
|
||||||
nsRect mVisibleRect;
|
float mOpacity;
|
||||||
|
|
||||||
// Lengths measured from the visual inline start and end sides
|
// Lengths measured from the visual inline start and end sides
|
||||||
// (i.e. left and right respectively in horizontal writing modes,
|
// (i.e. left and right respectively in horizontal writing modes,
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ void nsDisplayBoxShadowInnerGeometry::MoveBy(const nsPoint& aOffset) {
|
|||||||
mPaddingRect.MoveBy(aOffset);
|
mPaddingRect.MoveBy(aOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsDisplayBoxShadowOuterGeometry::nsDisplayBoxShadowOuterGeometry(
|
||||||
|
nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder, float aOpacity)
|
||||||
|
: nsDisplayItemGenericGeometry(aItem, aBuilder), mOpacity(aOpacity) {}
|
||||||
|
|
||||||
void nsDisplaySolidColorRegionGeometry::MoveBy(const nsPoint& aOffset) {
|
void nsDisplaySolidColorRegionGeometry::MoveBy(const nsPoint& aOffset) {
|
||||||
nsDisplayItemGeometry::MoveBy(aOffset);
|
nsDisplayItemGeometry::MoveBy(aOffset);
|
||||||
mRegion.MoveBy(aOffset);
|
mRegion.MoveBy(aOffset);
|
||||||
@@ -101,7 +105,9 @@ nsDisplaySVGEffectGeometry::nsDisplaySVGEffectGeometry(
|
|||||||
: nsDisplayItemGeometry(aItem, aBuilder),
|
: nsDisplayItemGeometry(aItem, aBuilder),
|
||||||
mBBox(aItem->BBoxInUserSpace()),
|
mBBox(aItem->BBoxInUserSpace()),
|
||||||
mUserSpaceOffset(aItem->UserSpaceOffset()),
|
mUserSpaceOffset(aItem->UserSpaceOffset()),
|
||||||
mFrameOffsetToReferenceFrame(aItem->ToReferenceFrame()) {}
|
mFrameOffsetToReferenceFrame(aItem->ToReferenceFrame()),
|
||||||
|
mOpacity(aItem->Frame()->StyleEffects()->mOpacity),
|
||||||
|
mHandleOpacity(aItem->ShouldHandleOpacity()) {}
|
||||||
|
|
||||||
void nsDisplaySVGEffectGeometry::MoveBy(const nsPoint& aOffset) {
|
void nsDisplaySVGEffectGeometry::MoveBy(const nsPoint& aOffset) {
|
||||||
mBounds.MoveBy(aOffset);
|
mBounds.MoveBy(aOffset);
|
||||||
|
|||||||
@@ -245,6 +245,15 @@ class nsDisplayBoxShadowInnerGeometry : public nsDisplayItemGeometry {
|
|||||||
nsRect mPaddingRect;
|
nsRect mPaddingRect;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class nsDisplayBoxShadowOuterGeometry : public nsDisplayItemGenericGeometry {
|
||||||
|
public:
|
||||||
|
nsDisplayBoxShadowOuterGeometry(nsDisplayItem* aItem,
|
||||||
|
nsDisplayListBuilder* aBuilder,
|
||||||
|
float aOpacity);
|
||||||
|
|
||||||
|
float mOpacity;
|
||||||
|
};
|
||||||
|
|
||||||
class nsDisplaySolidColorGeometry : public nsDisplayItemBoundsGeometry {
|
class nsDisplaySolidColorGeometry : public nsDisplayItemBoundsGeometry {
|
||||||
public:
|
public:
|
||||||
nsDisplaySolidColorGeometry(nsDisplayItem* aItem,
|
nsDisplaySolidColorGeometry(nsDisplayItem* aItem,
|
||||||
@@ -280,6 +289,7 @@ class nsDisplaySVGEffectGeometry : public nsDisplayItemGeometry {
|
|||||||
gfxRect mBBox;
|
gfxRect mBBox;
|
||||||
gfxPoint mUserSpaceOffset;
|
gfxPoint mUserSpaceOffset;
|
||||||
nsPoint mFrameOffsetToReferenceFrame;
|
nsPoint mFrameOffsetToReferenceFrame;
|
||||||
|
float mOpacity;
|
||||||
bool mHandleOpacity;
|
bool mHandleOpacity;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ random-if(d2d) fuzzy-if(skiaContent,0-1,0-14) == boxshadow-onecorner.html boxsha
|
|||||||
random-if(d2d) fuzzy-if(skiaContent,0-1,0-22) == boxshadow-twocorners.html boxshadow-twocorners-ref.html
|
random-if(d2d) fuzzy-if(skiaContent,0-1,0-22) == boxshadow-twocorners.html boxshadow-twocorners-ref.html
|
||||||
random-if(d2d) fuzzy-if(skiaContent,0-1,0-36) == boxshadow-threecorners.html boxshadow-threecorners-ref.html
|
random-if(d2d) fuzzy-if(skiaContent,0-1,0-36) == boxshadow-threecorners.html boxshadow-threecorners-ref.html
|
||||||
fuzzy(0-2,0-440) == boxshadow-skiprect.html boxshadow-skiprect-ref.html
|
fuzzy(0-2,0-440) == boxshadow-skiprect.html boxshadow-skiprect-ref.html
|
||||||
fuzzy-if(useDrawSnapshot,1-1,1197-1197) == boxshadow-opacity.html boxshadow-opacity-ref.html
|
== boxshadow-opacity.html boxshadow-opacity-ref.html
|
||||||
== boxshadow-color-rounding.html boxshadow-color-rounding-ref.html
|
== boxshadow-color-rounding.html boxshadow-color-rounding-ref.html
|
||||||
== boxshadow-color-rounding-middle.html boxshadow-color-rounding-middle-ref.html
|
== boxshadow-color-rounding-middle.html boxshadow-color-rounding-middle-ref.html
|
||||||
fuzzy(0-3,0-500) fuzzy-if(d2d,0-2,0-1080) == boxshadow-border-radius-int.html boxshadow-border-radius-int-ref.html
|
fuzzy(0-3,0-500) fuzzy-if(d2d,0-2,0-1080) == boxshadow-border-radius-int.html boxshadow-border-radius-int-ref.html
|
||||||
|
|||||||
@@ -1691,7 +1691,7 @@ fuzzy-if(skiaContent,0-1,0-1) == 751012-1a.html 751012-1-ref.html
|
|||||||
fuzzy-if(skiaContent,0-1,0-1) == 751012-1b.html 751012-1-ref.html
|
fuzzy-if(skiaContent,0-1,0-1) == 751012-1b.html 751012-1-ref.html
|
||||||
== 753329-1.html about:blank
|
== 753329-1.html about:blank
|
||||||
== 758561-1.html 758561-1-ref.html
|
== 758561-1.html 758561-1-ref.html
|
||||||
fuzzy-if(true,0-1,0-90) fuzzy-if(skiaContent,0-1,0-320) fuzzy-if(useDrawSnapshot,1-1,77595-77595) == 759036-1.html 759036-1-ref.html
|
fuzzy-if(true,0-1,0-90) fuzzy-if(skiaContent,0-1,0-320) == 759036-1.html 759036-1-ref.html
|
||||||
fuzzy-if(true,0-17,0-5886) fuzzy-if(skiaContent,0-9,0-5894) fuzzy-if(geckoview&&webrender&&device&&!swgl,3-3,5831-5855) == 759036-2.html 759036-2-ref.html
|
fuzzy-if(true,0-17,0-5886) fuzzy-if(skiaContent,0-9,0-5894) fuzzy-if(geckoview&&webrender&&device&&!swgl,3-3,5831-5855) == 759036-2.html 759036-2-ref.html
|
||||||
== 776265-1a.html 776265-1-ref.html
|
== 776265-1a.html 776265-1-ref.html
|
||||||
== 776265-1b.html 776265-1-ref.html
|
== 776265-1b.html 776265-1-ref.html
|
||||||
@@ -2033,7 +2033,7 @@ fuzzy(0-255,0-4054) == 1415987-1.html 1415987-1-ref.html # this is a large fuzz,
|
|||||||
== 1424680.html 1424680-ref.html
|
== 1424680.html 1424680-ref.html
|
||||||
== 1424798-1.html 1424798-ref.html
|
== 1424798-1.html 1424798-ref.html
|
||||||
fuzzy-if(!webrender,0-74,0-2234) == 1425243-1.html 1425243-1-ref.html
|
fuzzy-if(!webrender,0-74,0-2234) == 1425243-1.html 1425243-1-ref.html
|
||||||
fuzzy-if(Android,0-66,0-574) fuzzy-if(d2d,0-89,0-777) fuzzy-if(!Android&&!d2d,0-1,0-31412) fuzzy-if(webrender&&winWidget,1-1,31240-31412) == 1425243-2.html 1425243-2-ref.html
|
fuzzy-if(Android,0-66,0-574) fuzzy-if(d2d,0-89,0-777) fuzzy-if(!Android&&!d2d,0-1,0-31412) fuzzy-if(webrender&&winWidget,1-1,31240-31412) fails-if(useDrawSnapshot) == 1425243-2.html 1425243-2-ref.html
|
||||||
== 1430869.html 1430869-ref.html
|
== 1430869.html 1430869-ref.html
|
||||||
== 1432541.html 1432541-ref.html
|
== 1432541.html 1432541-ref.html
|
||||||
== 1446470.html 1035091-ref.html
|
== 1446470.html 1035091-ref.html
|
||||||
@@ -2059,7 +2059,7 @@ fuzzy-if(winWidget&&!webrender,0-104,0-1423) == 1513423-1.html 1513423-1-ref.htm
|
|||||||
fuzzy-if(winWidget&&!webrender,0-89,0-1420) == 1513423-2.html 1513423-2-ref.html
|
fuzzy-if(winWidget&&!webrender,0-89,0-1420) == 1513423-2.html 1513423-2-ref.html
|
||||||
== 1513423-3.html 1513423-3-ref.html
|
== 1513423-3.html 1513423-3-ref.html
|
||||||
pref(layout.accessiblecaret.enabled,true) == 1517385.html 1517385-ref.html
|
pref(layout.accessiblecaret.enabled,true) == 1517385.html 1517385-ref.html
|
||||||
fuzzy-if(!webrender,1-5,66-547) fuzzy-if(geckoview&&!webrender,1-2,64-141) fuzzy-if(winWidget&&swgl,1-1,12-16) fuzzy-if(cocoaWidget&&swgl,1-1,32-32) fuzzy-if(useDrawSnapshot&&webrender,2-2,209-209) == 1529992-1.html 1529992-1-ref.html
|
fuzzy-if(!webrender,1-5,66-547) fuzzy-if(geckoview&&!webrender,1-2,64-141) fuzzy-if(winWidget&&swgl,1-1,12-16) fuzzy-if(cocoaWidget&&swgl,1-1,32-32) fuzzy-if(useDrawSnapshot&&webrender,3-3,459-459) == 1529992-1.html 1529992-1-ref.html
|
||||||
fuzzy-if(!webrender,0-6,0-34) fuzzy-if(Android,9-14,44-60) fails-if(!useDrawSnapshot&&webrender) == 1529992-2.html 1529992-2-ref.html
|
fuzzy-if(!webrender,0-6,0-34) fuzzy-if(Android,9-14,44-60) fails-if(!useDrawSnapshot&&webrender) == 1529992-2.html 1529992-2-ref.html
|
||||||
== 1535040-1.html 1535040-1-ref.html
|
== 1535040-1.html 1535040-1-ref.html
|
||||||
== 1545360-1.xhtml 1545360-1-ref.xhtml
|
== 1545360-1.xhtml 1545360-1-ref.xhtml
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ fuzzy(0-1,0-235200) == 1413073.html 1413073-ref.html
|
|||||||
fuzzy-if(useDrawSnapshot&&!webrender,1-1,40000-40000) == 1417601-1.html 1417601-1-ref.html
|
fuzzy-if(useDrawSnapshot&&!webrender,1-1,40000-40000) == 1417601-1.html 1417601-1-ref.html
|
||||||
== 1418945-1.html 1418945-1-ref.html
|
== 1418945-1.html 1418945-1-ref.html
|
||||||
skip-if(Android) == 1428993-1.html 1428993-1-ref.html
|
skip-if(Android) == 1428993-1.html 1428993-1-ref.html
|
||||||
fuzzy-if(!Android&&!swgl&&!useDrawSnapshot,1-1,40000-40000) == 1420480-1.html 1420480-1-ref.html
|
== 1420480-1.html 1420480-1-ref.html
|
||||||
== 1428993-2.html 1428993-2-ref.html
|
== 1428993-2.html 1428993-2-ref.html
|
||||||
needs-focus fuzzy-if(!nativeThemePref,0-3,0-2) == 1429027-1.html 1429027-1-ref.html
|
needs-focus fuzzy-if(!nativeThemePref,0-3,0-2) == 1429027-1.html 1429027-1-ref.html
|
||||||
== 1432553-1.html 1432553-1-ref.html
|
== 1432553-1.html 1432553-1-ref.html
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ fuzzy-if(d2d,0-1,0-33174) fuzzy-if(skiaContent,0-1,0-16863) random-if(useDrawSna
|
|||||||
fuzzy-if(d2d,0-1,0-11058) fuzzy-if(skiaContent,0-1,0-5625) random-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table-column.html border-collapse-opacity-table-column-ref.html
|
fuzzy-if(d2d,0-1,0-11058) fuzzy-if(skiaContent,0-1,0-5625) random-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table-column.html border-collapse-opacity-table-column-ref.html
|
||||||
fuzzy-if(d2d,0-1,0-24606) fuzzy-if(skiaContent,0-1,0-32718) random-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table-row-group.html border-collapse-opacity-table-row-group-ref.html
|
fuzzy-if(d2d,0-1,0-24606) fuzzy-if(skiaContent,0-1,0-32718) random-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table-row-group.html border-collapse-opacity-table-row-group-ref.html
|
||||||
fuzzy-if(d2d,0-1,0-11000) fuzzy-if(skiaContent,0-1,0-11000) random-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table-row.html border-collapse-opacity-table-row-ref.html
|
fuzzy-if(d2d,0-1,0-11000) fuzzy-if(skiaContent,0-1,0-11000) random-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table-row.html border-collapse-opacity-table-row-ref.html
|
||||||
fuzzy-if(d2d||skiaContent,0-1,0-60000) == border-collapse-opacity-table.html border-collapse-opacity-table-ref.html
|
fuzzy-if(d2d||skiaContent,0-1,0-60000) fails-if(useDrawSnapshot&&webrender) == border-collapse-opacity-table.html border-collapse-opacity-table-ref.html
|
||||||
fuzzy-if(d2d,0-1,0-2478) fuzzy-if(skiaContent,0-1,0-2500) random-if(useDrawSnapshot&&webrender) == border-separate-opacity-table-cell.html border-separate-opacity-table-cell-ref.html
|
fuzzy-if(d2d,0-1,0-2478) fuzzy-if(skiaContent,0-1,0-2500) random-if(useDrawSnapshot&&webrender) == border-separate-opacity-table-cell.html border-separate-opacity-table-cell-ref.html
|
||||||
fuzzy-if(d2d,0-1,0-38000) fuzzy-if(webrender,0-1,0-4078) random-if(useDrawSnapshot&&webrender) == border-separate-opacity-table-column-group.html border-separate-opacity-table-column-group-ref.html
|
fuzzy-if(d2d,0-1,0-38000) fuzzy-if(webrender,0-1,0-4078) random-if(useDrawSnapshot&&webrender) == border-separate-opacity-table-column-group.html border-separate-opacity-table-column-group-ref.html
|
||||||
fuzzy-if(d2d,0-1,0-13000) fuzzy-if(webrender,0-1,0-1329) random-if(useDrawSnapshot&&webrender) == border-separate-opacity-table-column.html border-separate-opacity-table-column-ref.html
|
fuzzy-if(d2d,0-1,0-13000) fuzzy-if(webrender,0-1,0-1329) random-if(useDrawSnapshot&&webrender) == border-separate-opacity-table-column.html border-separate-opacity-table-column-ref.html
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ class SVGIntegrationUtils final {
|
|||||||
struct MOZ_STACK_CLASS PaintFramesParams {
|
struct MOZ_STACK_CLASS PaintFramesParams {
|
||||||
gfxContext& ctx;
|
gfxContext& ctx;
|
||||||
nsIFrame* frame;
|
nsIFrame* frame;
|
||||||
nsRect dirtyRect;
|
const nsRect& dirtyRect;
|
||||||
nsRect borderArea;
|
const nsRect& borderArea;
|
||||||
nsDisplayListBuilder* builder;
|
nsDisplayListBuilder* builder;
|
||||||
layers::LayerManager* layerManager;
|
layers::LayerManager* layerManager;
|
||||||
bool handleOpacity; // If true, PaintMaskAndClipPath/ PaintFilter should
|
bool handleOpacity; // If true, PaintMaskAndClipPath/ PaintFilter should
|
||||||
|
|||||||
@@ -2714,6 +2714,9 @@ void DisplaySVGText::HitTest(nsDisplayListBuilder* aBuilder,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DisplaySVGText::Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) {
|
void DisplaySVGText::Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) {
|
||||||
|
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||||
|
IsSubpixelAADisabled());
|
||||||
|
|
||||||
uint32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
|
uint32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
|
||||||
|
|
||||||
// ToReferenceFrame includes our mRect offset, but painting takes
|
// ToReferenceFrame includes our mRect offset, but painting takes
|
||||||
|
|||||||
@@ -7567,10 +7567,8 @@ bool nsDisplayTableBorderCollapse::CreateWebRenderCommands(
|
|||||||
const StackingContextHelper& aSc,
|
const StackingContextHelper& aSc,
|
||||||
mozilla::layers::RenderRootStateManager* aManager,
|
mozilla::layers::RenderRootStateManager* aManager,
|
||||||
nsDisplayListBuilder* aDisplayListBuilder) {
|
nsDisplayListBuilder* aDisplayListBuilder) {
|
||||||
bool dummy;
|
|
||||||
static_cast<nsTableFrame*>(mFrame)->CreateWebRenderCommandsForBCBorders(
|
static_cast<nsTableFrame*>(mFrame)->CreateWebRenderCommandsForBCBorders(
|
||||||
aBuilder, aSc, GetBounds(aDisplayListBuilder, &dummy),
|
aBuilder, aSc, GetPaintRect(), ToReferenceFrame());
|
||||||
ToReferenceFrame());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,11 +263,13 @@ static void PaintTextShadowCallback(gfxContext* aCtx, nsPoint aShadowOffset,
|
|||||||
|
|
||||||
void nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
|
void nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
|
||||||
gfxContext* aCtx) {
|
gfxContext* aCtx) {
|
||||||
|
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||||
|
IsSubpixelAADisabled());
|
||||||
|
|
||||||
// Paint the text shadow before doing any foreground stuff
|
// Paint the text shadow before doing any foreground stuff
|
||||||
nsRect drawRect =
|
nsRect drawRect =
|
||||||
static_cast<nsTextBoxFrame*>(mFrame)->mTextDrawRect + ToReferenceFrame();
|
static_cast<nsTextBoxFrame*>(mFrame)->mTextDrawRect + ToReferenceFrame();
|
||||||
nsLayoutUtils::PaintTextShadow(mFrame, aCtx, drawRect,
|
nsLayoutUtils::PaintTextShadow(mFrame, aCtx, drawRect, GetPaintRect(),
|
||||||
GetPaintRect(aBuilder, aCtx),
|
|
||||||
mFrame->StyleText()->mColor.ToColor(),
|
mFrame->StyleText()->mColor.ToColor(),
|
||||||
PaintTextShadowCallback, (void*)this);
|
PaintTextShadowCallback, (void*)this);
|
||||||
|
|
||||||
@@ -277,8 +279,7 @@ void nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
|
|||||||
void nsDisplayXULTextBox::PaintTextToContext(gfxContext* aCtx, nsPoint aOffset,
|
void nsDisplayXULTextBox::PaintTextToContext(gfxContext* aCtx, nsPoint aOffset,
|
||||||
const nscolor* aColor) {
|
const nscolor* aColor) {
|
||||||
static_cast<nsTextBoxFrame*>(mFrame)->PaintTitle(
|
static_cast<nsTextBoxFrame*>(mFrame)->PaintTitle(
|
||||||
*aCtx, mFrame->InkOverflowRectRelativeToSelf() + ToReferenceFrame(),
|
*aCtx, GetPaintRect(), ToReferenceFrame() + aOffset, aColor);
|
||||||
ToReferenceFrame() + aOffset, aColor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsDisplayXULTextBox::CreateWebRenderCommands(
|
bool nsDisplayXULTextBox::CreateWebRenderCommands(
|
||||||
|
|||||||
@@ -2525,6 +2525,9 @@ class nsDisplayTreeBody final : public nsPaintedDisplayItem {
|
|||||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||||
gfxContext* aCtx) override {
|
gfxContext* aCtx) override {
|
||||||
MOZ_ASSERT(aBuilder);
|
MOZ_ASSERT(aBuilder);
|
||||||
|
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||||
|
IsSubpixelAADisabled());
|
||||||
|
|
||||||
ImgDrawResult result = static_cast<nsTreeBodyFrame*>(mFrame)->PaintTreeBody(
|
ImgDrawResult result = static_cast<nsTreeBodyFrame*>(mFrame)->PaintTreeBody(
|
||||||
*aCtx, GetPaintRect(aBuilder, aCtx), ToReferenceFrame(), aBuilder);
|
*aCtx, GetPaintRect(aBuilder, aCtx), ToReferenceFrame(), aBuilder);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user