зеркало из https://github.com/mozilla/gecko-dev.git
Bug 779269 - Implement a TryMerge method for nsDisplayFixedPosition. r=roc
Allow nsDisplayFixedPosition items that share the same fixed-pos frame to be merged. This avoids a bug where the Google PDF viewer document image gets re-rendered offset on the initial frame of a scroll when layer acceleration is enabled.
This commit is contained in:
Родитель
4788839f6c
Коммит
b2f8ecf01c
|
@ -2528,6 +2528,17 @@ nsDisplayFixedPosition::BuildLayer(nsDisplayListBuilder* aBuilder,
|
|||
return layer.forget();
|
||||
}
|
||||
|
||||
bool nsDisplayFixedPosition::TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) {
|
||||
if (aItem->GetType() != TYPE_FIXED_POSITION)
|
||||
return false;
|
||||
// Items with the same fixed position frame can be merged.
|
||||
nsDisplayFixedPosition* other = static_cast<nsDisplayFixedPosition*>(aItem);
|
||||
if (other->mFixedPosFrame != mFixedPosFrame)
|
||||
return false;
|
||||
MergeFromTrackingMergedFrames(other);
|
||||
return true;
|
||||
}
|
||||
|
||||
nsDisplayScrollLayer::nsDisplayScrollLayer(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList* aList,
|
||||
nsIFrame* aForFrame,
|
||||
|
|
|
@ -1948,6 +1948,8 @@ public:
|
|||
{
|
||||
return mozilla::LAYER_ACTIVE;
|
||||
}
|
||||
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem);
|
||||
|
||||
NS_DISPLAY_DECL_NAME("FixedPosition", TYPE_FIXED_POSITION)
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче