зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 544e2832e783 (bug 1449608) for bustages "xul.dll : fatal error LNK112". CLOSED TREE
This commit is contained in:
Родитель
662b559413
Коммит
cf9dd5bc32
|
@ -403,8 +403,10 @@ ScrollingLayersHelper::RecurseAndDefineAsr(nsDisplayItem* aItem,
|
|||
aItem, aAsr->mParent, aChain, aAppUnitsPerDevPixel, aSc);
|
||||
ids = ancestorIds;
|
||||
|
||||
// Ok to pass nullptr for aLayer here (first arg) because aClip (last arg) is
|
||||
// also nullptr.
|
||||
Maybe<ScrollMetadata> metadata = aAsr->mScrollableFrame->ComputeScrollMetadata(
|
||||
mManager, aItem->ReferenceFrame(), ContainerLayerParameters(), nullptr);
|
||||
nullptr, mManager, aItem->ReferenceFrame(), ContainerLayerParameters(), nullptr);
|
||||
MOZ_ASSERT(metadata);
|
||||
FrameMetrics& metrics = metadata->GetMetrics();
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner,
|
|||
mScrollIds.AppendElement(index.ref());
|
||||
} else {
|
||||
Maybe<ScrollMetadata> metadata = asr->mScrollableFrame->ComputeScrollMetadata(
|
||||
aOwner.GetManager(), aItem->ReferenceFrame(),
|
||||
nullptr, aOwner.GetManager(), aItem->ReferenceFrame(),
|
||||
ContainerLayerParameters(), nullptr);
|
||||
MOZ_ASSERT(metadata);
|
||||
MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId);
|
||||
|
|
|
@ -3898,7 +3898,8 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
|
||||
Maybe<ScrollMetadata>
|
||||
ScrollFrameHelper::ComputeScrollMetadata(LayerManager* aLayerManager,
|
||||
ScrollFrameHelper::ComputeScrollMetadata(Layer* aLayer,
|
||||
LayerManager* aLayerManager,
|
||||
const nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
const DisplayItemClip* aClip) const
|
||||
|
@ -3907,11 +3908,6 @@ ScrollFrameHelper::ComputeScrollMetadata(LayerManager* aLayerManager,
|
|||
return Nothing();
|
||||
}
|
||||
|
||||
if (!nsLayoutUtils::UsesAsyncScrolling(mOuter)) {
|
||||
// Return early, since if we don't use APZ we don't need FrameMetrics.
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
nsPoint toReferenceFrame = mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
|
||||
|
||||
Maybe<nsRect> parentLayerClip;
|
||||
|
@ -3922,33 +3918,11 @@ ScrollFrameHelper::ComputeScrollMetadata(LayerManager* aLayerManager,
|
|||
}
|
||||
|
||||
bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument();
|
||||
|
||||
MOZ_ASSERT(mScrolledFrame->GetContent());
|
||||
|
||||
nsRect scrollport = mScrollPort + toReferenceFrame;
|
||||
|
||||
return Some(nsLayoutUtils::ComputeScrollMetadata(
|
||||
mScrolledFrame, mOuter, mOuter->GetContent(),
|
||||
aContainerReferenceFrame, aLayerManager, mScrollParentID,
|
||||
scrollport, parentLayerClip, isRootContent, aParameters));
|
||||
}
|
||||
|
||||
void
|
||||
ScrollFrameHelper::ClipLayerToDisplayPort(Layer* aLayer,
|
||||
const DisplayItemClip* aClip,
|
||||
const ContainerLayerParameters& aParameters) const
|
||||
{
|
||||
// If APZ is not enabled, we still need the displayport to be clipped
|
||||
// in the compositor.
|
||||
if (!nsLayoutUtils::UsesAsyncScrolling(mOuter)) {
|
||||
Maybe<nsRect> parentLayerClip;
|
||||
// For containerful frames, the clip is on the container layer.
|
||||
if (aClip &&
|
||||
(!gfxPrefs::LayoutUseContainersForRootFrames() || mAddClipRectToLayer)) {
|
||||
parentLayerClip = Some(aClip->GetClipRect());
|
||||
}
|
||||
|
||||
bool thisScrollFrameUsesAsyncScrolling = nsLayoutUtils::UsesAsyncScrolling(mOuter);
|
||||
if (!thisScrollFrameUsesAsyncScrolling) {
|
||||
if (parentLayerClip) {
|
||||
// If APZ is not enabled, we still need the displayport to be clipped
|
||||
// in the compositor.
|
||||
ParentLayerIntRect displayportClip =
|
||||
ViewAs<ParentLayerPixel>(
|
||||
parentLayerClip->ScaleToNearestPixels(
|
||||
|
@ -3964,7 +3938,19 @@ ScrollFrameHelper::ClipLayerToDisplayPort(Layer* aLayer,
|
|||
}
|
||||
aLayer->SetClipRect(Some(layerClip));
|
||||
}
|
||||
|
||||
// Return early, since if we don't use APZ we don't need FrameMetrics.
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
MOZ_ASSERT(mScrolledFrame->GetContent());
|
||||
|
||||
nsRect scrollport = mScrollPort + toReferenceFrame;
|
||||
|
||||
return Some(nsLayoutUtils::ComputeScrollMetadata(
|
||||
mScrolledFrame, mOuter, mOuter->GetContent(),
|
||||
aContainerReferenceFrame, aLayerManager, mScrollParentID,
|
||||
scrollport, parentLayerClip, isRootContent, aParameters));
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -464,13 +464,11 @@ public:
|
|||
}
|
||||
bool WantAsyncScroll() const;
|
||||
Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||
Layer* aLayer,
|
||||
LayerManager* aLayerManager,
|
||||
const nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
const mozilla::DisplayItemClip* aClip) const;
|
||||
void ClipLayerToDisplayPort(Layer* aLayer,
|
||||
const mozilla::DisplayItemClip* aClip,
|
||||
const ContainerLayerParameters& aParameters) const;
|
||||
|
||||
// nsIScrollbarMediator
|
||||
void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
|
||||
|
@ -616,7 +614,7 @@ public:
|
|||
// will already have the necessary frame metrics.
|
||||
bool mIsScrollableLayerInRootContainer:1;
|
||||
|
||||
// If true, add clipping in ScrollFrameHelper::ClipLayerToDisplayPort.
|
||||
// If true, add clipping in ScrollFrameHelper::ComputeFrameMetrics.
|
||||
bool mAddClipRectToLayer:1;
|
||||
|
||||
// True if this frame has been scrolled at least once
|
||||
|
@ -972,21 +970,16 @@ public:
|
|||
return mHelper.WantAsyncScroll();
|
||||
}
|
||||
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||
Layer* aLayer,
|
||||
LayerManager* aLayerManager,
|
||||
const nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
const mozilla::DisplayItemClip* aClip) const override
|
||||
{
|
||||
return mHelper.ComputeScrollMetadata(aLayerManager, aContainerReferenceFrame, aParameters, aClip);
|
||||
return mHelper.ComputeScrollMetadata(aLayer, aLayerManager, aContainerReferenceFrame, aParameters, aClip);
|
||||
}
|
||||
virtual void ClipLayerToDisplayPort(Layer* aLayer,
|
||||
const mozilla::DisplayItemClip* aClip,
|
||||
const ContainerLayerParameters& aParameters) const override
|
||||
{
|
||||
mHelper.ClipLayerToDisplayPort(aLayer, aClip, aParameters);
|
||||
}
|
||||
virtual bool IsIgnoringViewportClipping() const override {
|
||||
return mHelper.IsIgnoringViewportClipping();
|
||||
virtual bool IsIgnoringViewportClipping() const override {
|
||||
return mHelper.IsIgnoringViewportClipping();
|
||||
}
|
||||
virtual void MarkScrollbarsDirtyForReflow() const override {
|
||||
mHelper.MarkScrollbarsDirtyForReflow();
|
||||
|
@ -1420,20 +1413,16 @@ public:
|
|||
return mHelper.WantAsyncScroll();
|
||||
}
|
||||
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||
Layer* aLayer,
|
||||
LayerManager* aLayerManager,
|
||||
const nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
const mozilla::DisplayItemClip* aClip) const override
|
||||
{
|
||||
return mHelper.ComputeScrollMetadata(aLayerManager, aContainerReferenceFrame, aParameters, aClip);
|
||||
return mHelper.ComputeScrollMetadata(aLayer, aLayerManager, aContainerReferenceFrame, aParameters, aClip);
|
||||
}
|
||||
virtual void ClipLayerToDisplayPort(Layer* aLayer,
|
||||
const mozilla::DisplayItemClip* aClip,
|
||||
const ContainerLayerParameters& aParameters) const override {
|
||||
mHelper.ClipLayerToDisplayPort(aLayer, aClip, aParameters);
|
||||
}
|
||||
virtual bool IsIgnoringViewportClipping() const override {
|
||||
return mHelper.IsIgnoringViewportClipping();
|
||||
virtual bool IsIgnoringViewportClipping() const override {
|
||||
return mHelper.IsIgnoringViewportClipping();
|
||||
}
|
||||
virtual void MarkScrollbarsDirtyForReflow() const override {
|
||||
mHelper.MarkScrollbarsDirtyForReflow();
|
||||
|
|
|
@ -411,19 +411,16 @@ public:
|
|||
*/
|
||||
virtual bool WantAsyncScroll() const = 0;
|
||||
/**
|
||||
* Returns the ScrollMetadata contributed by this frame, if there is one.
|
||||
* aLayer's animated geometry root is this frame. Returns the ScrollMetadata
|
||||
* contributed by this frame, if there is one.
|
||||
* If aClip is non-null, then aLayer must also be non-null.
|
||||
*/
|
||||
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
|
||||
mozilla::layers::Layer* aLayer,
|
||||
mozilla::layers::LayerManager* aLayerManager,
|
||||
const nsIFrame* aContainerReferenceFrame,
|
||||
const ContainerLayerParameters& aParameters,
|
||||
const mozilla::DisplayItemClip* aClip) const = 0;
|
||||
/**
|
||||
* Ensure's aLayer is clipped to the display port.
|
||||
*/
|
||||
virtual void ClipLayerToDisplayPort(mozilla::layers::Layer* aLayer,
|
||||
const mozilla::DisplayItemClip* aClip,
|
||||
const ContainerLayerParameters& aParameters) const;
|
||||
|
||||
/**
|
||||
* If this scroll frame is ignoring viewporting clipping
|
||||
|
|
|
@ -1574,19 +1574,6 @@ protected:
|
|||
// thing repeatly.
|
||||
AnimatedGeometryRoot* mLastDisplayPortAGR;
|
||||
nsRect mLastDisplayPortRect;
|
||||
|
||||
// Cache ScrollMetadata so it doesn't need recomputed if the ASR and clip are unchanged.
|
||||
// If mASR == nullptr then mMetadata is not valid.
|
||||
struct CachedScrollMetadata {
|
||||
const ActiveScrolledRoot* mASR;
|
||||
const DisplayItemClip* mClip;
|
||||
Maybe<ScrollMetadata> mMetadata;
|
||||
|
||||
CachedScrollMetadata()
|
||||
: mASR(nullptr), mClip(nullptr)
|
||||
{}
|
||||
};
|
||||
CachedScrollMetadata mCachedScrollMetadata;
|
||||
};
|
||||
|
||||
bool
|
||||
|
@ -5462,20 +5449,9 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry)
|
|||
const DisplayItemClip* clip =
|
||||
(clipChain && clipChain->mASR == asr->mParent) ? &clipChain->mClip : nullptr;
|
||||
|
||||
scrollFrame->ClipLayerToDisplayPort(aEntry->mLayer, clip, mParameters);
|
||||
|
||||
Maybe<ScrollMetadata> metadata;
|
||||
if (mCachedScrollMetadata.mASR == asr &&
|
||||
mCachedScrollMetadata.mClip == clip) {
|
||||
metadata = mCachedScrollMetadata.mMetadata;
|
||||
} else {
|
||||
metadata = scrollFrame->ComputeScrollMetadata(aEntry->mLayer->Manager(),
|
||||
Maybe<ScrollMetadata> metadata =
|
||||
scrollFrame->ComputeScrollMetadata(aEntry->mLayer, aEntry->mLayer->Manager(),
|
||||
mContainerReferenceFrame, mParameters, clip);
|
||||
mCachedScrollMetadata.mASR = asr;
|
||||
mCachedScrollMetadata.mClip = clip;
|
||||
mCachedScrollMetadata.mMetadata = metadata;
|
||||
}
|
||||
|
||||
if (!metadata) {
|
||||
continue;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче