Backed out changeset 544e2832e783 (bug 1449608) for bustages "xul.dll : fatal error LNK112". CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2018-04-24 21:06:41 +03:00
Родитель 662b559413
Коммит cf9dd5bc32
6 изменённых файлов: 38 добавлений и 88 удалений

Просмотреть файл

@ -403,8 +403,10 @@ ScrollingLayersHelper::RecurseAndDefineAsr(nsDisplayItem* aItem,
aItem, aAsr->mParent, aChain, aAppUnitsPerDevPixel, aSc); aItem, aAsr->mParent, aChain, aAppUnitsPerDevPixel, aSc);
ids = ancestorIds; ids = ancestorIds;
// Ok to pass nullptr for aLayer here (first arg) because aClip (last arg) is
// also nullptr.
Maybe<ScrollMetadata> metadata = aAsr->mScrollableFrame->ComputeScrollMetadata( Maybe<ScrollMetadata> metadata = aAsr->mScrollableFrame->ComputeScrollMetadata(
mManager, aItem->ReferenceFrame(), ContainerLayerParameters(), nullptr); nullptr, mManager, aItem->ReferenceFrame(), ContainerLayerParameters(), nullptr);
MOZ_ASSERT(metadata); MOZ_ASSERT(metadata);
FrameMetrics& metrics = metadata->GetMetrics(); FrameMetrics& metrics = metadata->GetMetrics();

Просмотреть файл

@ -64,7 +64,7 @@ WebRenderLayerScrollData::Initialize(WebRenderScrollData& aOwner,
mScrollIds.AppendElement(index.ref()); mScrollIds.AppendElement(index.ref());
} else { } else {
Maybe<ScrollMetadata> metadata = asr->mScrollableFrame->ComputeScrollMetadata( Maybe<ScrollMetadata> metadata = asr->mScrollableFrame->ComputeScrollMetadata(
aOwner.GetManager(), aItem->ReferenceFrame(), nullptr, aOwner.GetManager(), aItem->ReferenceFrame(),
ContainerLayerParameters(), nullptr); ContainerLayerParameters(), nullptr);
MOZ_ASSERT(metadata); MOZ_ASSERT(metadata);
MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId); MOZ_ASSERT(metadata->GetMetrics().GetScrollId() == scrollId);

Просмотреть файл

@ -3898,7 +3898,8 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
Maybe<ScrollMetadata> Maybe<ScrollMetadata>
ScrollFrameHelper::ComputeScrollMetadata(LayerManager* aLayerManager, ScrollFrameHelper::ComputeScrollMetadata(Layer* aLayer,
LayerManager* aLayerManager,
const nsIFrame* aContainerReferenceFrame, const nsIFrame* aContainerReferenceFrame,
const ContainerLayerParameters& aParameters, const ContainerLayerParameters& aParameters,
const DisplayItemClip* aClip) const const DisplayItemClip* aClip) const
@ -3907,11 +3908,6 @@ ScrollFrameHelper::ComputeScrollMetadata(LayerManager* aLayerManager,
return Nothing(); 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); nsPoint toReferenceFrame = mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
Maybe<nsRect> parentLayerClip; Maybe<nsRect> parentLayerClip;
@ -3922,33 +3918,11 @@ ScrollFrameHelper::ComputeScrollMetadata(LayerManager* aLayerManager,
} }
bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument(); bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument();
bool thisScrollFrameUsesAsyncScrolling = nsLayoutUtils::UsesAsyncScrolling(mOuter);
MOZ_ASSERT(mScrolledFrame->GetContent()); if (!thisScrollFrameUsesAsyncScrolling) {
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());
}
if (parentLayerClip) { if (parentLayerClip) {
// If APZ is not enabled, we still need the displayport to be clipped
// in the compositor.
ParentLayerIntRect displayportClip = ParentLayerIntRect displayportClip =
ViewAs<ParentLayerPixel>( ViewAs<ParentLayerPixel>(
parentLayerClip->ScaleToNearestPixels( parentLayerClip->ScaleToNearestPixels(
@ -3964,7 +3938,19 @@ ScrollFrameHelper::ClipLayerToDisplayPort(Layer* aLayer,
} }
aLayer->SetClipRect(Some(layerClip)); 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 bool

Просмотреть файл

@ -464,13 +464,11 @@ public:
} }
bool WantAsyncScroll() const; bool WantAsyncScroll() const;
Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata( Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
Layer* aLayer,
LayerManager* aLayerManager, LayerManager* aLayerManager,
const nsIFrame* aContainerReferenceFrame, const nsIFrame* aContainerReferenceFrame,
const ContainerLayerParameters& aParameters, const ContainerLayerParameters& aParameters,
const mozilla::DisplayItemClip* aClip) const; const mozilla::DisplayItemClip* aClip) const;
void ClipLayerToDisplayPort(Layer* aLayer,
const mozilla::DisplayItemClip* aClip,
const ContainerLayerParameters& aParameters) const;
// nsIScrollbarMediator // nsIScrollbarMediator
void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection, void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
@ -616,7 +614,7 @@ public:
// will already have the necessary frame metrics. // will already have the necessary frame metrics.
bool mIsScrollableLayerInRootContainer:1; bool mIsScrollableLayerInRootContainer:1;
// If true, add clipping in ScrollFrameHelper::ClipLayerToDisplayPort. // If true, add clipping in ScrollFrameHelper::ComputeFrameMetrics.
bool mAddClipRectToLayer:1; bool mAddClipRectToLayer:1;
// True if this frame has been scrolled at least once // True if this frame has been scrolled at least once
@ -972,21 +970,16 @@ public:
return mHelper.WantAsyncScroll(); return mHelper.WantAsyncScroll();
} }
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata( virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
Layer* aLayer,
LayerManager* aLayerManager, LayerManager* aLayerManager,
const nsIFrame* aContainerReferenceFrame, const nsIFrame* aContainerReferenceFrame,
const ContainerLayerParameters& aParameters, const ContainerLayerParameters& aParameters,
const mozilla::DisplayItemClip* aClip) const override 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, virtual bool IsIgnoringViewportClipping() const override {
const mozilla::DisplayItemClip* aClip, return mHelper.IsIgnoringViewportClipping();
const ContainerLayerParameters& aParameters) const override
{
mHelper.ClipLayerToDisplayPort(aLayer, aClip, aParameters);
}
virtual bool IsIgnoringViewportClipping() const override {
return mHelper.IsIgnoringViewportClipping();
} }
virtual void MarkScrollbarsDirtyForReflow() const override { virtual void MarkScrollbarsDirtyForReflow() const override {
mHelper.MarkScrollbarsDirtyForReflow(); mHelper.MarkScrollbarsDirtyForReflow();
@ -1420,20 +1413,16 @@ public:
return mHelper.WantAsyncScroll(); return mHelper.WantAsyncScroll();
} }
virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata( virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
Layer* aLayer,
LayerManager* aLayerManager, LayerManager* aLayerManager,
const nsIFrame* aContainerReferenceFrame, const nsIFrame* aContainerReferenceFrame,
const ContainerLayerParameters& aParameters, const ContainerLayerParameters& aParameters,
const mozilla::DisplayItemClip* aClip) const override 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, virtual bool IsIgnoringViewportClipping() const override {
const mozilla::DisplayItemClip* aClip, return mHelper.IsIgnoringViewportClipping();
const ContainerLayerParameters& aParameters) const override {
mHelper.ClipLayerToDisplayPort(aLayer, aClip, aParameters);
}
virtual bool IsIgnoringViewportClipping() const override {
return mHelper.IsIgnoringViewportClipping();
} }
virtual void MarkScrollbarsDirtyForReflow() const override { virtual void MarkScrollbarsDirtyForReflow() const override {
mHelper.MarkScrollbarsDirtyForReflow(); mHelper.MarkScrollbarsDirtyForReflow();

Просмотреть файл

@ -411,19 +411,16 @@ public:
*/ */
virtual bool WantAsyncScroll() const = 0; 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( virtual mozilla::Maybe<mozilla::layers::ScrollMetadata> ComputeScrollMetadata(
mozilla::layers::Layer* aLayer,
mozilla::layers::LayerManager* aLayerManager, mozilla::layers::LayerManager* aLayerManager,
const nsIFrame* aContainerReferenceFrame, const nsIFrame* aContainerReferenceFrame,
const ContainerLayerParameters& aParameters, const ContainerLayerParameters& aParameters,
const mozilla::DisplayItemClip* aClip) const = 0; 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 * If this scroll frame is ignoring viewporting clipping

Просмотреть файл

@ -1574,19 +1574,6 @@ protected:
// thing repeatly. // thing repeatly.
AnimatedGeometryRoot* mLastDisplayPortAGR; AnimatedGeometryRoot* mLastDisplayPortAGR;
nsRect mLastDisplayPortRect; 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 bool
@ -5462,20 +5449,9 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry)
const DisplayItemClip* clip = const DisplayItemClip* clip =
(clipChain && clipChain->mASR == asr->mParent) ? &clipChain->mClip : nullptr; (clipChain && clipChain->mASR == asr->mParent) ? &clipChain->mClip : nullptr;
scrollFrame->ClipLayerToDisplayPort(aEntry->mLayer, clip, mParameters); Maybe<ScrollMetadata> metadata =
scrollFrame->ComputeScrollMetadata(aEntry->mLayer, aEntry->mLayer->Manager(),
Maybe<ScrollMetadata> metadata;
if (mCachedScrollMetadata.mASR == asr &&
mCachedScrollMetadata.mClip == clip) {
metadata = mCachedScrollMetadata.mMetadata;
} else {
metadata = scrollFrame->ComputeScrollMetadata(aEntry->mLayer->Manager(),
mContainerReferenceFrame, mParameters, clip); mContainerReferenceFrame, mParameters, clip);
mCachedScrollMetadata.mASR = asr;
mCachedScrollMetadata.mClip = clip;
mCachedScrollMetadata.mMetadata = metadata;
}
if (!metadata) { if (!metadata) {
continue; continue;
} }