mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1205087 - Remove LayerManager parameter for ShouldFixToViewport. r=roc
This commit is contained in:
parent
bcb5fd90a4
commit
69fe1b8c9c
@ -1029,10 +1029,10 @@ public:
|
||||
MOZ_ASSERT_IF(isAtRoot, mContainerReferenceFrame == mBuilder->RootReferenceFrame());
|
||||
mContainerAnimatedGeometryRoot = isAtRoot
|
||||
? mContainerReferenceFrame
|
||||
: nsLayoutUtils::GetAnimatedGeometryRootFor(aContainerItem, aBuilder, aManager);
|
||||
: nsLayoutUtils::GetAnimatedGeometryRootFor(aContainerItem, aBuilder);
|
||||
MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(mBuilder->RootReferenceFrame(),
|
||||
mContainerAnimatedGeometryRoot));
|
||||
NS_ASSERTION(!aContainerItem || !aContainerItem->ShouldFixToViewport(aManager),
|
||||
NS_ASSERTION(!aContainerItem || !aContainerItem->ShouldFixToViewport(mBuilder),
|
||||
"Container items never return true for ShouldFixToViewport");
|
||||
mContainerFixedPosFrame =
|
||||
FindFixedPosFrameForLayerData(mContainerAnimatedGeometryRoot, false);
|
||||
@ -3637,7 +3637,7 @@ ContainerState::ChooseAnimatedGeometryRoot(const nsDisplayList& aList,
|
||||
// Try using the actual active scrolled root of the backmost item, as that
|
||||
// should result in the least invalidation when scrolling.
|
||||
*aAnimatedGeometryRoot =
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder, mManager);
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -3814,7 +3814,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
|
||||
const nsIFrame* animatedGeometryRoot;
|
||||
const nsIFrame* animatedGeometryRootForScrollMetadata = nullptr;
|
||||
const nsIFrame* realAnimatedGeometryRootOfItem =
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder, mManager);
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder);
|
||||
if (mFlattenToSingleLayer) {
|
||||
forceInactive = true;
|
||||
animatedGeometryRoot = lastAnimatedGeometryRoot;
|
||||
@ -3856,7 +3856,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
|
||||
}
|
||||
|
||||
bool shouldFixToViewport = !animatedGeometryRoot->GetParent() &&
|
||||
item->ShouldFixToViewport(mManager);
|
||||
item->ShouldFixToViewport(mBuilder);
|
||||
|
||||
// For items that are fixed to the viewport, remove their clip at the
|
||||
// display item level because additional areas could be brought into
|
||||
|
@ -1459,6 +1459,22 @@ TriggerPendingAnimations(nsIDocument* aDocument,
|
||||
const_cast<TimeStamp*>(&aReadyTime));
|
||||
}
|
||||
|
||||
LayerManager*
|
||||
nsDisplayListBuilder::GetWidgetLayerManager(nsView** aView, bool* aAllowRetaining)
|
||||
{
|
||||
nsView* view = RootReferenceFrame()->GetView();
|
||||
if (aView) {
|
||||
*aView = view;
|
||||
}
|
||||
NS_ASSERTION(RootReferenceFrame() == nsLayoutUtils::GetDisplayRootFrame(RootReferenceFrame()),
|
||||
"Reference frame must be a display root for us to use the layer manager");
|
||||
nsIWidget* window = RootReferenceFrame()->GetNearestWidget();
|
||||
if (window) {
|
||||
return window->GetLayerManager(aAllowRetaining);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* We paint by executing a layer manager transaction, constructing a
|
||||
* single layer representing the display list, and then making it the
|
||||
@ -1476,17 +1492,10 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
|
||||
bool doBeginTransaction = true;
|
||||
nsView *view = nullptr;
|
||||
if (aFlags & PAINT_USE_WIDGET_LAYERS) {
|
||||
nsIFrame* rootReferenceFrame = aBuilder->RootReferenceFrame();
|
||||
view = rootReferenceFrame->GetView();
|
||||
NS_ASSERTION(rootReferenceFrame == nsLayoutUtils::GetDisplayRootFrame(rootReferenceFrame),
|
||||
"Reference frame must be a display root for us to use the layer manager");
|
||||
nsIWidget* window = rootReferenceFrame->GetNearestWidget();
|
||||
if (window) {
|
||||
layerManager = window->GetLayerManager(&allowRetaining);
|
||||
if (layerManager) {
|
||||
doBeginTransaction = !(aFlags & PAINT_EXISTING_TRANSACTION);
|
||||
widgetTransaction = true;
|
||||
}
|
||||
layerManager = aBuilder->GetWidgetLayerManager(&view, &allowRetaining);
|
||||
if (layerManager) {
|
||||
doBeginTransaction = !(aFlags & PAINT_EXISTING_TRANSACTION);
|
||||
widgetTransaction = true;
|
||||
}
|
||||
}
|
||||
if (!layerManager) {
|
||||
@ -2362,11 +2371,12 @@ nsDisplayBackgroundImage::IsNonEmptyFixedImage() const
|
||||
}
|
||||
|
||||
bool
|
||||
nsDisplayBackgroundImage::ShouldFixToViewport(LayerManager* aManager)
|
||||
nsDisplayBackgroundImage::ShouldFixToViewport(nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
// APZ needs background-attachment:fixed images layerized for correctness.
|
||||
nsRefPtr<LayerManager> layerManager = aBuilder->GetWidgetLayerManager();
|
||||
if (!nsLayoutUtils::UsesAsyncScrolling(mFrame) &&
|
||||
aManager && aManager->ShouldAvoidComponentAlphaLayers()) {
|
||||
layerManager && layerManager->ShouldAvoidComponentAlphaLayers()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3703,7 +3713,7 @@ RequiredLayerStateForChildren(nsDisplayListBuilder* aBuilder,
|
||||
LayerState result = LAYER_INACTIVE;
|
||||
for (nsDisplayItem* i = aList.GetBottom(); i; i = i->GetAbove()) {
|
||||
if (result == LAYER_INACTIVE &&
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(i, aBuilder, aManager) !=
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(i, aBuilder) !=
|
||||
aExpectedAnimatedGeometryRootForChildren) {
|
||||
result = LAYER_ACTIVE;
|
||||
}
|
||||
@ -3962,7 +3972,7 @@ nsDisplayOpacity::GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||
return LAYER_ACTIVE;
|
||||
|
||||
return RequiredLayerStateForChildren(aBuilder, aManager, aParameters, mList,
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(this, aBuilder, aManager));
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(this, aBuilder));
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -154,6 +154,8 @@ public:
|
||||
mMode = PLUGIN_GEOMETRY;
|
||||
}
|
||||
|
||||
mozilla::layers::LayerManager* GetWidgetLayerManager(nsView** aView = nullptr, bool* aAllowRetaining = nullptr);
|
||||
|
||||
/**
|
||||
* @return true if the display is being built in order to determine which
|
||||
* frame is under the mouse position.
|
||||
@ -1284,7 +1286,7 @@ public:
|
||||
* @return true if the contents of this item are rendered fixed relative
|
||||
* to the nearest viewport.
|
||||
*/
|
||||
virtual bool ShouldFixToViewport(LayerManager* aManager)
|
||||
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder)
|
||||
{ return false; }
|
||||
|
||||
virtual bool ClearsBackground()
|
||||
@ -2393,7 +2395,7 @@ public:
|
||||
static nsRegion GetInsideClipRegion(nsDisplayItem* aItem, nsPresContext* aPresContext, uint8_t aClip,
|
||||
const nsRect& aRect, bool* aSnap);
|
||||
|
||||
virtual bool ShouldFixToViewport(LayerManager* aManager) override;
|
||||
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) override;
|
||||
|
||||
protected:
|
||||
typedef class mozilla::layers::ImageContainer ImageContainer;
|
||||
|
@ -163,7 +163,7 @@ PrintDisplayItemTo(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem,
|
||||
bool snap;
|
||||
nsRect rect = aItem->GetBounds(aBuilder, &snap);
|
||||
nsRect layerRect = rect -
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(aItem, aBuilder, nullptr)->
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(aItem, aBuilder)->
|
||||
GetOffsetToCrossDoc(aItem->ReferenceFrame());
|
||||
nscolor color;
|
||||
nsRect vis = aItem->GetVisibleRect();
|
||||
@ -194,7 +194,7 @@ PrintDisplayItemTo(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem,
|
||||
aStream << nsPrintfCString(" (opaque %d,%d,%d,%d)", r->x, r->y, r->width, r->height);
|
||||
}
|
||||
|
||||
if (aItem->ShouldFixToViewport(nullptr)) {
|
||||
if (aItem->ShouldFixToViewport(aBuilder)) {
|
||||
aStream << " fixed";
|
||||
}
|
||||
|
||||
|
@ -1843,11 +1843,10 @@ nsLayoutUtils::GetAnimatedGeometryRootForFrame(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsIFrame*
|
||||
nsLayoutUtils::GetAnimatedGeometryRootFor(nsDisplayItem* aItem,
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager)
|
||||
nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
nsIFrame* f = aItem->Frame();
|
||||
if (aItem->ShouldFixToViewport(aManager)) {
|
||||
if (aItem->ShouldFixToViewport(aBuilder)) {
|
||||
// Make its active scrolled root be the active scrolled root of
|
||||
// the enclosing viewport, since it shouldn't be scrolled by scrolled
|
||||
// frames in its document. InvalidateFixedBackgroundFramesFromList in
|
||||
|
@ -550,8 +550,7 @@ public:
|
||||
* geometry root.
|
||||
*/
|
||||
static nsIFrame* GetAnimatedGeometryRootFor(nsDisplayItem* aItem,
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
mozilla::layers::LayerManager* aManager);
|
||||
nsDisplayListBuilder* aBuilder);
|
||||
|
||||
/**
|
||||
* Finds the nearest ancestor frame to aFrame that is considered to have (or
|
||||
|
@ -279,7 +279,7 @@ public:
|
||||
mFrame->Properties().Delete(nsIFrame::CachedBackgroundImageDT());
|
||||
}
|
||||
|
||||
virtual bool ShouldFixToViewport(LayerManager* aManager) override
|
||||
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) override
|
||||
{
|
||||
// Put background-attachment:fixed canvas background images in their own
|
||||
// compositing layer. Since we know their background painting area can't
|
||||
|
Loading…
Reference in New Issue
Block a user