mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 00:27:29 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
96140fd9af
1 changed files with 22 additions and 53 deletions
|
|
@ -162,12 +162,7 @@ void
|
||||||
FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame)
|
FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
MOZ_RELEASE_ASSERT(mLayer);
|
MOZ_RELEASE_ASSERT(mLayer);
|
||||||
|
mFrameList.AppendElement(aFrame);
|
||||||
// Make sure we don't add duplicate frames as we're storing these as vectors.
|
|
||||||
// See UXP Issue #1860
|
|
||||||
if (!mFrameList.Contains(aFrame)) {
|
|
||||||
mFrameList.AppendElement(aFrame);
|
|
||||||
}
|
|
||||||
|
|
||||||
nsTArray<DisplayItemData*>* array =
|
nsTArray<DisplayItemData*>* array =
|
||||||
aFrame->GetProperty(FrameLayerBuilder::LayerManagerDataProperty());
|
aFrame->GetProperty(FrameLayerBuilder::LayerManagerDataProperty());
|
||||||
|
|
@ -333,7 +328,8 @@ public:
|
||||||
void Dump(const char *aPrefix = "") {
|
void Dump(const char *aPrefix = "") {
|
||||||
printf_stderr("%sLayerManagerData %p\n", aPrefix, this);
|
printf_stderr("%sLayerManagerData %p\n", aPrefix, this);
|
||||||
|
|
||||||
for (auto& data : mDisplayItems) {
|
for (auto iter = mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||||
|
FrameLayerBuilder::DisplayItemData* data = iter.Get()->GetKey();
|
||||||
|
|
||||||
nsAutoCString prefix;
|
nsAutoCString prefix;
|
||||||
prefix += aPrefix;
|
prefix += aPrefix;
|
||||||
|
|
@ -392,7 +388,7 @@ public:
|
||||||
#ifdef DEBUG_DISPLAY_ITEM_DATA
|
#ifdef DEBUG_DISPLAY_ITEM_DATA
|
||||||
LayerManagerData *mParent;
|
LayerManagerData *mParent;
|
||||||
#endif
|
#endif
|
||||||
std::vector<RefPtr<FrameLayerBuilder::DisplayItemData> > mDisplayItems;
|
nsTHashtable<nsRefPtrHashKey<FrameLayerBuilder::DisplayItemData> > mDisplayItems;
|
||||||
bool mInvalidateAllLayers;
|
bool mInvalidateAllLayers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1975,12 +1971,7 @@ FrameLayerBuilder::RemoveFrameFromLayerManager(const nsIFrame* aFrame,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto it = std::find(data->mParent->mDisplayItems.begin(),
|
data->mParent->mDisplayItems.RemoveEntry(data);
|
||||||
data->mParent->mDisplayItems.end(),
|
|
||||||
data);
|
|
||||||
MOZ_ASSERT(it != data->mParent->mDisplayItems.end());
|
|
||||||
std::iter_swap(it, data->mParent->mDisplayItems.end() - 1);
|
|
||||||
data->mParent->mDisplayItems.pop_back();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arrayCopy.Clear();
|
arrayCopy.Clear();
|
||||||
|
|
@ -2033,40 +2024,27 @@ FrameLayerBuilder::WillEndTransaction()
|
||||||
NS_ASSERTION(data, "Must have data!");
|
NS_ASSERTION(data, "Must have data!");
|
||||||
|
|
||||||
// Update all the frames that used to have layers.
|
// Update all the frames that used to have layers.
|
||||||
auto iter = data->mDisplayItems.begin();
|
for (auto iter = data->mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||||
while (iter != data->mDisplayItems.end()) {
|
DisplayItemData* data = iter.Get()->GetKey();
|
||||||
DisplayItemData* did = iter->get();
|
if (!data->mUsed) {
|
||||||
if (!did->mUsed) {
|
|
||||||
// This item was visible, but isn't anymore.
|
// This item was visible, but isn't anymore.
|
||||||
PaintedLayer* t = did->mLayer->AsPaintedLayer();
|
PaintedLayer* t = data->mLayer->AsPaintedLayer();
|
||||||
if (t && did->mGeometry) {
|
if (t && data->mGeometry) {
|
||||||
#ifdef MOZ_DUMP_PAINTING
|
#ifdef MOZ_DUMP_PAINTING
|
||||||
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
|
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
|
||||||
printf_stderr("Invalidating unused display item (%i) belonging to frame %p from layer %p\n", did->mDisplayItemKey, did->mFrameList[0], t);
|
printf_stderr("Invalidating unused display item (%i) belonging to frame %p from layer %p\n", data->mDisplayItemKey, data->mFrameList[0], t);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
InvalidatePostTransformRegion(t,
|
InvalidatePostTransformRegion(t,
|
||||||
did->mGeometry->ComputeInvalidationRegion(),
|
data->mGeometry->ComputeInvalidationRegion(),
|
||||||
did->mClip,
|
data->mClip,
|
||||||
GetLastPaintOffset(t));
|
GetLastPaintOffset(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
did->ClearAnimationCompositorState();
|
data->ClearAnimationCompositorState();
|
||||||
|
iter.Remove();
|
||||||
// Remove this item. Swapping it with the last element first is
|
|
||||||
// quicker than erasing from the middle.
|
|
||||||
if (iter != data->mDisplayItems.end() - 1) {
|
|
||||||
std::iter_swap(iter, data->mDisplayItems.end() - 1);
|
|
||||||
data->mDisplayItems.pop_back();
|
|
||||||
} else {
|
|
||||||
data->mDisplayItems.pop_back();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't increment iter because we still need to process the item which was moved.
|
|
||||||
} else {
|
} else {
|
||||||
ComputeGeometryChangeForItem(did);
|
ComputeGeometryChangeForItem(data);
|
||||||
iter++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4822,7 +4800,7 @@ FrameLayerBuilder::StoreDataForFrame(nsDisplayItem* aItem, Layer* aLayer, LayerS
|
||||||
|
|
||||||
data->BeginUpdate(aLayer, aState, mContainerLayerGeneration, aItem);
|
data->BeginUpdate(aLayer, aState, mContainerLayerGeneration, aItem);
|
||||||
|
|
||||||
lmd->mDisplayItems.push_back(data);
|
lmd->mDisplayItems.PutEntry(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4846,7 +4824,7 @@ FrameLayerBuilder::StoreDataForFrame(nsIFrame* aFrame,
|
||||||
|
|
||||||
data->BeginUpdate(aLayer, aState, mContainerLayerGeneration);
|
data->BeginUpdate(aLayer, aState, mContainerLayerGeneration);
|
||||||
|
|
||||||
lmd->mDisplayItems.push_back(data);
|
lmd->mDisplayItems.PutEntry(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameLayerBuilder::ClippedDisplayItem::ClippedDisplayItem(nsDisplayItem* aItem,
|
FrameLayerBuilder::ClippedDisplayItem::ClippedDisplayItem(nsDisplayItem* aItem,
|
||||||
|
|
@ -5580,19 +5558,10 @@ FrameLayerBuilder::BuildContainerLayerFor(nsDisplayListBuilder* aBuilder,
|
||||||
flattenToSingleLayer = true;
|
flattenToSingleLayer = true;
|
||||||
|
|
||||||
// Restore DisplayItemData
|
// Restore DisplayItemData
|
||||||
auto iter = data->mDisplayItems.begin();
|
for (auto iter = data->mDisplayItems.Iter(); !iter.Done(); iter.Next()) {
|
||||||
while (iter != data->mDisplayItems.end()) {
|
DisplayItemData* data = iter.Get()->GetKey();
|
||||||
DisplayItemData* did = iter->get();
|
if (data->mUsed && data->mContainerLayerGeneration >= mContainerLayerGeneration) {
|
||||||
if (did->mUsed && did->mContainerLayerGeneration >= mContainerLayerGeneration) {
|
iter.Remove();
|
||||||
if (iter != data->mDisplayItems.end() - 1) {
|
|
||||||
std::iter_swap(iter, data->mDisplayItems.end() - 1);
|
|
||||||
data->mDisplayItems.pop_back();
|
|
||||||
} else {
|
|
||||||
data->mDisplayItems.pop_back();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
iter++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue