Bug 1626570 - Improve handling of copying arrays in layout/painting/. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D72352
This commit is contained in:
Simon Giesecke 2020-05-05 10:05:59 +00:00
Родитель ea61234b3c
Коммит fe4c928a46
5 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -182,7 +182,7 @@ class DisplayItemClip {
private:
nsRect mClipRect;
nsTArray<RoundedRect> mRoundedClipRects;
CopyableTArray<RoundedRect> mRoundedClipRects;
// If mHaveClipRect is false then this object represents no clipping at all
// and mRoundedClipRects must be empty.
bool mHaveClipRect;

Просмотреть файл

@ -333,7 +333,7 @@ void DisplayItemData::BeginUpdate(Layer* aLayer, LayerState aState,
// We avoid adding or removing element unnecessarily
// since we have to modify userdata each time
AutoTArray<nsIFrame*, 4> copy(mFrameList);
CopyableAutoTArray<nsIFrame*, 4> copy(mFrameList);
if (!copy.RemoveElement(aItem->Frame())) {
AddFrame(aItem->Frame());
mChangedFrameInvalidations.Or(mChangedFrameInvalidations,
@ -5740,7 +5740,7 @@ void ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) {
// so add to it rather than overwriting it (we clear the list when recycling
// a layer).
nsTArray<RefPtr<Layer>> maskLayers(
aEntry->mLayer->GetAllAncestorMaskLayers());
aEntry->mLayer->GetAllAncestorMaskLayers().Clone());
// Iterate over the ASR chain and create the corresponding scroll metadatas.
// This loop is slightly tricky because the scrollframe-to-clip relationship

Просмотреть файл

@ -52,7 +52,8 @@ MaskLayerImageCache::MaskLayerImageKey::MaskLayerImageKey()
MaskLayerImageCache::MaskLayerImageKey::MaskLayerImageKey(
const MaskLayerImageKey& aKey)
: mRoundedClipRects(aKey.mRoundedClipRects), mLayerCount(aKey.mLayerCount) {
: mRoundedClipRects(aKey.mRoundedClipRects.Clone()),
mLayerCount(aKey.mLayerCount) {
MOZ_COUNT_CTOR(MaskLayerImageKey);
}

Просмотреть файл

@ -5383,7 +5383,7 @@ class nsDisplayWrapList : public nsDisplayHitTestInfoBase {
: nsDisplayHitTestInfoBase(aBuilder, aOther),
mListPtr(&mList),
mFrameActiveScrolledRoot(aOther.mFrameActiveScrolledRoot),
mMergedFrames(aOther.mMergedFrames),
mMergedFrames(aOther.mMergedFrames.Clone()),
mBounds(aOther.mBounds),
mBaseBuildingRect(aOther.mBaseBuildingRect),
mOverrideZIndex(aOther.mOverrideZIndex),
@ -5567,7 +5567,7 @@ class nsDisplayWrapList : public nsDisplayHitTestInfoBase {
buildingRect.UnionRect(GetBuildingRect(), aOther->GetBuildingRect());
SetBuildingRect(buildingRect);
mMergedFrames.AppendElement(aOther->mFrame);
mMergedFrames.AppendElements(aOther->mMergedFrames);
mMergedFrames.AppendElements(aOther->mMergedFrames.Clone());
}
RetainedDisplayList mList;
@ -6598,7 +6598,8 @@ class nsDisplayMasksAndClipPaths : public nsDisplayEffectsBase {
const ActiveScrolledRoot* aActiveScrolledRoot);
nsDisplayMasksAndClipPaths(nsDisplayListBuilder* aBuilder,
const nsDisplayMasksAndClipPaths& aOther)
: nsDisplayEffectsBase(aBuilder, aOther), mDestRects(aOther.mDestRects) {
: nsDisplayEffectsBase(aBuilder, aOther),
mDestRects(aOther.mDestRects.Clone()) {
MOZ_COUNT_CTOR(nsDisplayMasksAndClipPaths);
}

Просмотреть файл

@ -107,7 +107,7 @@ nsDisplayMasksAndClipPathsGeometry::nsDisplayMasksAndClipPathsGeometry(
nsDisplayMasksAndClipPaths* aItem, nsDisplayListBuilder* aBuilder)
: nsDisplaySVGEffectGeometry(aItem, aBuilder),
nsImageGeometryMixin(aItem, aBuilder),
mDestRects(aItem->GetDestRects()) {}
mDestRects(aItem->GetDestRects().Clone()) {}
nsDisplayFiltersGeometry::nsDisplayFiltersGeometry(
nsDisplayFilters* aItem, nsDisplayListBuilder* aBuilder)