forked from mirrors/gecko-dev
Bug 1641246 - Remove nsDisplayResolution. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77111
This commit is contained in:
parent
994485ee93
commit
b0ee5dd871
6 changed files with 3 additions and 71 deletions
|
|
@ -2428,7 +2428,7 @@ class ContainerLayer : public Layer {
|
||||||
// be part of mTransform.
|
// be part of mTransform.
|
||||||
float mInheritedXScale;
|
float mInheritedXScale;
|
||||||
float mInheritedYScale;
|
float mInheritedYScale;
|
||||||
// For layers corresponding to an nsDisplayResolution, the resolution of the
|
// For layers corresponding to an nsDisplayAsyncZoom, the resolution of the
|
||||||
// associated pres shell; for other layers, 1.0.
|
// associated pres shell; for other layers, 1.0.
|
||||||
float mPresShellResolution;
|
float mPresShellResolution;
|
||||||
bool mUseIntermediateSurface;
|
bool mUseIntermediateSurface;
|
||||||
|
|
|
||||||
|
|
@ -5297,21 +5297,6 @@ void PresShell::SetRenderingState(const RenderingState& aState) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// nsSubDocumentFrame uses a resolution different from 1.0 to determine if it
|
|
||||||
// needs to build a nsDisplayResolution item. So if we are going from or
|
|
||||||
// to 1.0 then we need to invalidate the subdoc frame so that item gets
|
|
||||||
// created/removed.
|
|
||||||
if (mResolution.valueOr(1.0) != aState.mResolution.valueOr(1.0) &&
|
|
||||||
(mResolution.valueOr(1.0) == 1.0 ||
|
|
||||||
aState.mResolution.valueOr(1.0) == 1.0)) {
|
|
||||||
if (nsIFrame* frame = GetRootFrame()) {
|
|
||||||
frame = nsLayoutUtils::GetCrossDocParentFrame(frame);
|
|
||||||
if (frame) {
|
|
||||||
frame->InvalidateFrame();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mRenderingStateFlags = aState.mRenderingStateFlags;
|
mRenderingStateFlags = aState.mRenderingStateFlags;
|
||||||
mResolution = aState.mResolution;
|
mResolution = aState.mResolution;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -431,12 +431,9 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
clipState.ClipContainingBlockDescendantsToContentBox(aBuilder, this);
|
clipState.ClipContainingBlockDescendantsToContentBox(aBuilder, this);
|
||||||
|
|
||||||
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
|
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
|
||||||
bool constructResolutionItem =
|
|
||||||
subdocRootFrame && (presShell->GetResolution() != 1.0);
|
|
||||||
bool constructZoomItem = subdocRootFrame && parentAPD != subdocAPD;
|
bool constructZoomItem = subdocRootFrame && parentAPD != subdocAPD;
|
||||||
bool needsOwnLayer = false;
|
bool needsOwnLayer = false;
|
||||||
if (constructResolutionItem || constructZoomItem ||
|
if (constructZoomItem || presContext->IsRootContentDocument() ||
|
||||||
presContext->IsRootContentDocument() ||
|
|
||||||
(sf && sf->IsScrollingActive(aBuilder))) {
|
(sf && sf->IsScrollingActive(aBuilder))) {
|
||||||
needsOwnLayer = true;
|
needsOwnLayer = true;
|
||||||
}
|
}
|
||||||
|
|
@ -525,7 +522,7 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
// becomes the topmost. We do this below.
|
// becomes the topmost. We do this below.
|
||||||
if (constructZoomItem) {
|
if (constructZoomItem) {
|
||||||
nsDisplayOwnLayerFlags zoomFlags = flags;
|
nsDisplayOwnLayerFlags zoomFlags = flags;
|
||||||
if (ignoreViewportScrolling && !constructResolutionItem) {
|
if (ignoreViewportScrolling) {
|
||||||
zoomFlags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer;
|
zoomFlags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer;
|
||||||
}
|
}
|
||||||
childItems.AppendNewToTop<nsDisplayZoom>(aBuilder, subdocRootFrame, this,
|
childItems.AppendNewToTop<nsDisplayZoom>(aBuilder, subdocRootFrame, this,
|
||||||
|
|
@ -540,12 +537,6 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||||
if (ignoreViewportScrolling) {
|
if (ignoreViewportScrolling) {
|
||||||
flags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer;
|
flags |= nsDisplayOwnLayerFlags::GenerateScrollableLayer;
|
||||||
}
|
}
|
||||||
if (constructResolutionItem) {
|
|
||||||
childItems.AppendNewToTop<nsDisplayResolution>(aBuilder, subdocRootFrame,
|
|
||||||
this, &childItems, flags);
|
|
||||||
|
|
||||||
needsOwnLayer = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We always want top level content documents to be in their own layer.
|
// We always want top level content documents to be in their own layer.
|
||||||
nsDisplaySubDocument* layerItem = MakeDisplayItem<nsDisplaySubDocument>(
|
nsDisplaySubDocument* layerItem = MakeDisplayItem<nsDisplaySubDocument>(
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,6 @@ DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_READBACK, 0)
|
||||||
DECLARE_DISPLAY_ITEM_TYPE(PRINT_PLUGIN, 0)
|
DECLARE_DISPLAY_ITEM_TYPE(PRINT_PLUGIN, 0)
|
||||||
DECLARE_DISPLAY_ITEM_TYPE(RANGE_FOCUS_RING, 0)
|
DECLARE_DISPLAY_ITEM_TYPE(RANGE_FOCUS_RING, 0)
|
||||||
DECLARE_DISPLAY_ITEM_TYPE(REMOTE, TYPE_RENDERS_NO_IMAGES)
|
DECLARE_DISPLAY_ITEM_TYPE(REMOTE, TYPE_RENDERS_NO_IMAGES)
|
||||||
DECLARE_DISPLAY_ITEM_TYPE(RESOLUTION,
|
|
||||||
TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTAINER)
|
|
||||||
DECLARE_DISPLAY_ITEM_TYPE(SCROLL_INFO_LAYER,
|
DECLARE_DISPLAY_ITEM_TYPE(SCROLL_INFO_LAYER,
|
||||||
TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTAINER)
|
TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTAINER)
|
||||||
DECLARE_DISPLAY_ITEM_TYPE(SELECTION_OVERLAY, TYPE_RENDERS_NO_IMAGES)
|
DECLARE_DISPLAY_ITEM_TYPE(SELECTION_OVERLAY, TYPE_RENDERS_NO_IMAGES)
|
||||||
|
|
|
||||||
|
|
@ -6548,29 +6548,6 @@ nsRegion nsDisplaySubDocument::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||||
return nsDisplayOwnLayer::GetOpaqueRegion(aBuilder, aSnap);
|
return nsDisplayOwnLayer::GetOpaqueRegion(aBuilder, aSnap);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsDisplayResolution::nsDisplayResolution(nsDisplayListBuilder* aBuilder,
|
|
||||||
nsIFrame* aFrame,
|
|
||||||
nsSubDocumentFrame* aSubDocFrame,
|
|
||||||
nsDisplayList* aList,
|
|
||||||
nsDisplayOwnLayerFlags aFlags)
|
|
||||||
: nsDisplaySubDocument(aBuilder, aFrame, aSubDocFrame, aList, aFlags) {
|
|
||||||
MOZ_COUNT_CTOR(nsDisplayResolution);
|
|
||||||
}
|
|
||||||
|
|
||||||
already_AddRefed<Layer> nsDisplayResolution::BuildLayer(
|
|
||||||
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
|
|
||||||
const ContainerLayerParameters& aContainerParameters) {
|
|
||||||
float rootLayerResolution = 1.0f;
|
|
||||||
ContainerLayerParameters containerParameters(
|
|
||||||
rootLayerResolution, rootLayerResolution, nsIntPoint(),
|
|
||||||
aContainerParameters);
|
|
||||||
|
|
||||||
RefPtr<Layer> layer =
|
|
||||||
nsDisplaySubDocument::BuildLayer(aBuilder, aManager, containerParameters);
|
|
||||||
|
|
||||||
return layer.forget();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
nsDisplayFixedPosition* nsDisplayFixedPosition::CreateForFixedBackground(
|
nsDisplayFixedPosition* nsDisplayFixedPosition::CreateForFixedBackground(
|
||||||
nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsIFrame* aSecondaryFrame,
|
nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsIFrame* aSecondaryFrame,
|
||||||
|
|
|
||||||
|
|
@ -6107,25 +6107,6 @@ class nsDisplaySubDocument : public nsDisplayOwnLayer {
|
||||||
nsSubDocumentFrame* mSubDocFrame;
|
nsSubDocumentFrame* mSubDocFrame;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* A display item for subdocuments to capture the resolution from the presShell
|
|
||||||
* and ensure that it gets applied to all the right elements. This item creates
|
|
||||||
* a container layer.
|
|
||||||
*/
|
|
||||||
class nsDisplayResolution : public nsDisplaySubDocument {
|
|
||||||
public:
|
|
||||||
nsDisplayResolution(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
|
|
||||||
nsSubDocumentFrame* aSubDocFrame, nsDisplayList* aList,
|
|
||||||
nsDisplayOwnLayerFlags aFlags);
|
|
||||||
MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayResolution)
|
|
||||||
|
|
||||||
NS_DISPLAY_DECL_NAME("Resolution", TYPE_RESOLUTION)
|
|
||||||
|
|
||||||
already_AddRefed<Layer> BuildLayer(
|
|
||||||
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
|
|
||||||
const ContainerLayerParameters& aContainerParameters) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A display item used to represent sticky position elements. The contents
|
* A display item used to represent sticky position elements. The contents
|
||||||
* gets its own layer and creates a stacking context, and the layer will have
|
* gets its own layer and creates a stacking context, and the layer will have
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue