зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 22d7763100aa (bug 1391499) for build bustage on Windows at gfx/layers/wr/StackingContextHelper.cpp(105): 'Size': undeclared identifier. r=backout
This commit is contained in:
Родитель
ebac958b65
Коммит
80cced1397
|
@ -14,8 +14,6 @@ namespace layers {
|
|||
|
||||
StackingContextHelper::StackingContextHelper()
|
||||
: mBuilder(nullptr)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
// mOrigin remains at 0,0
|
||||
}
|
||||
|
@ -26,8 +24,6 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
const Maybe<gfx::Matrix4x4>& aTransform,
|
||||
const nsTArray<wr::WrFilterOp>& aFilters)
|
||||
: mBuilder(&aBuilder)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
wr::LayoutRect scBounds = aParentSC.ToRelativeLayoutRect(aLayer->BoundsForStackingContext());
|
||||
Layer* layer = aLayer->GetLayer();
|
||||
|
@ -51,8 +47,6 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
gfx::Matrix4x4* aTransformPtr,
|
||||
const nsTArray<wr::WrFilterOp>& aFilters)
|
||||
: mBuilder(&aBuilder)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
wr::LayoutRect scBounds = aParentSC.ToRelativeLayoutRect(aLayer->BoundsForStackingContext());
|
||||
if (aTransformPtr) {
|
||||
|
@ -83,38 +77,13 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
const nsTArray<wr::WrFilterOp>& aFilters,
|
||||
const gfx::CompositionOp& aMixBlendMode)
|
||||
: mBuilder(&aBuilder)
|
||||
, mXScale(1.0f)
|
||||
, mYScale(1.0f)
|
||||
{
|
||||
nsRect visibleRect;
|
||||
|
||||
if (aTransformPtr) {
|
||||
mTransform = *aTransformPtr;
|
||||
}
|
||||
|
||||
bool is2d = !aTransformPtr || (aTransformPtr->Is2D() && !aPerspectivePtr);
|
||||
if (is2d) {
|
||||
nsRect itemBounds = aDisplayList->GetClippedBoundsWithRespectToASR(aDisplayListBuilder, aItem->GetActiveScrolledRoot());
|
||||
nsRect childrenVisible = aItem->GetVisibleRectForChildren();
|
||||
visibleRect = itemBounds.Intersect(childrenVisible);
|
||||
|
||||
// Apply the inherited scale from parent
|
||||
mTransform.PostScale(aParentSC.mXScale, aParentSC.mYScale, 1.0);
|
||||
mTransform.NudgeToIntegersFixedEpsilon();
|
||||
|
||||
Size scale = mTransform.As2D().ScaleFactors(true);
|
||||
|
||||
// Restore the scale to default if the scale is too small
|
||||
if (FuzzyEqualsAdditive(scale.width, 0.0f) ||
|
||||
FuzzyEqualsAdditive(scale.height, 0.0f)) {
|
||||
scale = Size(1.0f, 1.0f);
|
||||
}
|
||||
|
||||
mTransform.PreScale(1.0f/scale.width, 1.0f/scale.height, 1.0);
|
||||
|
||||
// Store the inherited scale if has
|
||||
this->mXScale = scale.width;
|
||||
this->mYScale = scale.height;
|
||||
} else {
|
||||
visibleRect = aDisplayList->GetBounds(aDisplayListBuilder);
|
||||
// The position of bounds are calculated by transform and perspective matrix in 3d case. reset it to (0, 0)
|
||||
|
@ -130,11 +99,14 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
|
|||
}
|
||||
|
||||
wr::LayoutRect scBounds = aParentSC.ToRelativeLayoutRect(bounds);
|
||||
if (aTransformPtr) {
|
||||
mTransform = *aTransformPtr;
|
||||
}
|
||||
|
||||
mBuilder->PushStackingContext(scBounds,
|
||||
aAnimationsId,
|
||||
aOpacityPtr,
|
||||
aTransformPtr ? &mTransform : aTransformPtr,
|
||||
aTransformPtr,
|
||||
is2d ? wr::TransformStyle::Flat : wr::TransformStyle::Preserve3D,
|
||||
aPerspectivePtr,
|
||||
wr::ToMixBlendMode(aMixBlendMode),
|
||||
|
@ -153,25 +125,13 @@ StackingContextHelper::~StackingContextHelper()
|
|||
wr::LayoutRect
|
||||
StackingContextHelper::ToRelativeLayoutRect(const LayerRect& aRect) const
|
||||
{
|
||||
// Multiply by the scale inherited from ancestors if exits
|
||||
LayerRect aMaybeScaledRect = aRect;
|
||||
if (mXScale != 1.0f || mYScale != 1.0f) {
|
||||
aMaybeScaledRect.Scale(mXScale, mYScale);
|
||||
}
|
||||
|
||||
return wr::ToLayoutRect(aMaybeScaledRect - mOrigin);
|
||||
return wr::ToLayoutRect(aRect - mOrigin);
|
||||
}
|
||||
|
||||
wr::LayoutRect
|
||||
StackingContextHelper::ToRelativeLayoutRect(const LayoutDeviceRect& aRect) const
|
||||
{
|
||||
// Multiply by the scale inherited from ancestors if exits
|
||||
LayoutDeviceRect aMaybeScaledRect = aRect;
|
||||
if (mXScale != 1.0f || mYScale != 1.0f) {
|
||||
aMaybeScaledRect.Scale(mXScale, mYScale);
|
||||
}
|
||||
|
||||
return wr::ToLayoutRect(ViewAs<LayerPixel>(aMaybeScaledRect, PixelCastJustification::WebRenderHasUnitResolution) - mOrigin);
|
||||
return wr::ToLayoutRect(ViewAs<LayerPixel>(aRect, PixelCastJustification::WebRenderHasUnitResolution) - mOrigin);
|
||||
}
|
||||
|
||||
wr::LayoutPoint
|
||||
|
@ -183,13 +143,7 @@ StackingContextHelper::ToRelativeLayoutPoint(const LayerPoint& aPoint) const
|
|||
wr::LayoutRect
|
||||
StackingContextHelper::ToRelativeLayoutRectRounded(const LayoutDeviceRect& aRect) const
|
||||
{
|
||||
// Multiply by the scale inherited from ancestors if exits
|
||||
LayoutDeviceRect aMaybeScaledRect = aRect;
|
||||
if (mXScale != 1.0f || mYScale != 1.0f) {
|
||||
aMaybeScaledRect.Scale(mXScale, mYScale);
|
||||
}
|
||||
|
||||
return wr::ToLayoutRect(RoundedToInt(ViewAs<LayerPixel>(aMaybeScaledRect, PixelCastJustification::WebRenderHasUnitResolution) - mOrigin));
|
||||
return wr::ToLayoutRect(RoundedToInt(ViewAs<LayerPixel>(aRect, PixelCastJustification::WebRenderHasUnitResolution) - mOrigin));
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
|
|
@ -89,9 +89,6 @@ private:
|
|||
wr::DisplayListBuilder* mBuilder;
|
||||
LayerPoint mOrigin;
|
||||
gfx::Matrix4x4 mTransform;
|
||||
|
||||
float mXScale;
|
||||
float mYScale;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
|
Загрузка…
Ссылка в новой задаче