mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1207420 - Improve GetBounds() to avoid recomputing every time. r=roc
This commit is contained in:
parent
1df74e473e
commit
670e4d1065
@ -3589,20 +3589,28 @@ class nsDisplayTransform: public nsDisplayItem
|
|||||||
public:
|
public:
|
||||||
StoreList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
StoreList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||||
nsDisplayList* aList) :
|
nsDisplayList* aList) :
|
||||||
nsDisplayWrapList(aBuilder, aFrame, aList) {}
|
nsDisplayWrapList(aBuilder, aFrame, aList),
|
||||||
|
mHasBounds(false) {}
|
||||||
StoreList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
StoreList(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
||||||
nsDisplayItem* aItem) :
|
nsDisplayItem* aItem) :
|
||||||
nsDisplayWrapList(aBuilder, aFrame, aItem) {}
|
nsDisplayWrapList(aBuilder, aFrame, aItem),
|
||||||
|
mHasBounds(false) {}
|
||||||
virtual ~StoreList() {}
|
virtual ~StoreList() {}
|
||||||
|
|
||||||
virtual void UpdateBounds(nsDisplayListBuilder* aBuilder) override {}
|
virtual void UpdateBounds(nsDisplayListBuilder* aBuilder) override {}
|
||||||
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
|
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
|
||||||
bool* aSnap) override {
|
bool* aSnap) override {
|
||||||
// The bounds should not be computed until now, because we don't
|
if (!mHasBounds) {
|
||||||
// get accmulated transform before.
|
// The bounds should not be computed until now, because we don't
|
||||||
nsDisplayWrapList::UpdateBounds(aBuilder);
|
// get accmulated transform before.
|
||||||
|
nsDisplayWrapList::UpdateBounds(aBuilder);
|
||||||
|
mHasBounds = true;
|
||||||
|
}
|
||||||
return nsDisplayWrapList::GetBounds(aBuilder, aSnap);
|
return nsDisplayWrapList::GetBounds(aBuilder, aSnap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool mHasBounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user