Bug 1274962 - Part 3: Remove aOutAncestor. r=mstange

This commit is contained in:
Matt Woodrow 2016-06-03 14:22:57 +12:00
Родитель 78823780e7
Коммит a3ac199d7f
3 изменённых файлов: 11 добавлений и 20 удалений

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

@ -5625,11 +5625,10 @@ nsDisplayTransform::GetResultingTransformMatrix(const FrameTransformProperties&
const nsPoint& aOrigin, const nsPoint& aOrigin,
float aAppUnitsPerPixel, float aAppUnitsPerPixel,
uint32_t aFlags, uint32_t aFlags,
const nsRect* aBoundsOverride, const nsRect* aBoundsOverride)
nsIFrame** aOutAncestor)
{ {
return GetResultingTransformMatrixInternal(aProperties, aOrigin, aAppUnitsPerPixel, return GetResultingTransformMatrixInternal(aProperties, aOrigin, aAppUnitsPerPixel,
aFlags, aBoundsOverride, aOutAncestor); aFlags, aBoundsOverride);
} }
Matrix4x4 Matrix4x4
@ -5637,15 +5636,14 @@ nsDisplayTransform::GetResultingTransformMatrix(const nsIFrame* aFrame,
const nsPoint& aOrigin, const nsPoint& aOrigin,
float aAppUnitsPerPixel, float aAppUnitsPerPixel,
uint32_t aFlags, uint32_t aFlags,
const nsRect* aBoundsOverride, const nsRect* aBoundsOverride)
nsIFrame** aOutAncestor)
{ {
FrameTransformProperties props(aFrame, FrameTransformProperties props(aFrame,
aAppUnitsPerPixel, aAppUnitsPerPixel,
aBoundsOverride); aBoundsOverride);
return GetResultingTransformMatrixInternal(props, aOrigin, aAppUnitsPerPixel, return GetResultingTransformMatrixInternal(props, aOrigin, aAppUnitsPerPixel,
aFlags, aBoundsOverride, aOutAncestor); aFlags, aBoundsOverride);
} }
Matrix4x4 Matrix4x4
@ -5653,18 +5651,13 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
const nsPoint& aOrigin, const nsPoint& aOrigin,
float aAppUnitsPerPixel, float aAppUnitsPerPixel,
uint32_t aFlags, uint32_t aFlags,
const nsRect* aBoundsOverride, const nsRect* aBoundsOverride)
nsIFrame** aOutAncestor)
{ {
const nsIFrame *frame = aProperties.mFrame; const nsIFrame *frame = aProperties.mFrame;
NS_ASSERTION(frame || !(aFlags & INCLUDE_PERSPECTIVE), "Must have a frame to compute perspective!"); NS_ASSERTION(frame || !(aFlags & INCLUDE_PERSPECTIVE), "Must have a frame to compute perspective!");
MOZ_ASSERT((aFlags & (OFFSET_BY_ORIGIN|BASIS_AT_ORIGIN)) != (OFFSET_BY_ORIGIN|BASIS_AT_ORIGIN), MOZ_ASSERT((aFlags & (OFFSET_BY_ORIGIN|BASIS_AT_ORIGIN)) != (OFFSET_BY_ORIGIN|BASIS_AT_ORIGIN),
"Can't specify offset by origin as well as basis at origin!"); "Can't specify offset by origin as well as basis at origin!");
if (aOutAncestor) {
*aOutAncestor = nsLayoutUtils::GetCrossDocParentFrame(frame);
}
// Get the underlying transform matrix: // Get the underlying transform matrix:
// We don't use aBoundsOverride for SVG since we need to account for // We don't use aBoundsOverride for SVG since we need to account for
@ -5789,7 +5782,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
GetResultingTransformMatrixInternal(props, GetResultingTransformMatrixInternal(props,
aOrigin - frame->GetPosition(), aOrigin - frame->GetPosition(),
aAppUnitsPerPixel, flags, aAppUnitsPerPixel, flags,
nullptr, aOutAncestor); nullptr);
result = result * parent; result = result * parent;
} }

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

@ -4093,14 +4093,12 @@ public:
const nsPoint& aOrigin, const nsPoint& aOrigin,
float aAppUnitsPerPixel, float aAppUnitsPerPixel,
uint32_t aFlags, uint32_t aFlags,
const nsRect* aBoundsOverride = nullptr, const nsRect* aBoundsOverride = nullptr);
nsIFrame** aOutAncestor = nullptr);
static Matrix4x4 GetResultingTransformMatrix(const FrameTransformProperties& aProperties, static Matrix4x4 GetResultingTransformMatrix(const FrameTransformProperties& aProperties,
const nsPoint& aOrigin, const nsPoint& aOrigin,
float aAppUnitsPerPixel, float aAppUnitsPerPixel,
uint32_t aFlags, uint32_t aFlags,
const nsRect* aBoundsOverride = nullptr, const nsRect* aBoundsOverride = nullptr);
nsIFrame** aOutAncestor = nullptr);
/** /**
* Return true when we should try to prerender the entire contents of the * Return true when we should try to prerender the entire contents of the
* transformed frame even when it's not completely visible (yet). * transformed frame even when it's not completely visible (yet).
@ -4180,8 +4178,7 @@ private:
const nsPoint& aOrigin, const nsPoint& aOrigin,
float aAppUnitsPerPixel, float aAppUnitsPerPixel,
uint32_t aFlags, uint32_t aFlags,
const nsRect* aBoundsOverride, const nsRect* aBoundsOverride);
nsIFrame** aOutAncestor);
StoreList mStoredList; StoreList mStoredList;
Matrix4x4 mTransform; Matrix4x4 mTransform;

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

@ -5358,7 +5358,8 @@ nsIFrame::GetTransformMatrix(const nsIFrame* aStopAtAncestor,
Matrix4x4 result = nsDisplayTransform::GetResultingTransformMatrix(this, Matrix4x4 result = nsDisplayTransform::GetResultingTransformMatrix(this,
nsPoint(0,0), scaleFactor, nsPoint(0,0), scaleFactor,
nsDisplayTransform::INCLUDE_PERSPECTIVE|nsDisplayTransform::OFFSET_BY_ORIGIN, nsDisplayTransform::INCLUDE_PERSPECTIVE|nsDisplayTransform::OFFSET_BY_ORIGIN,
nullptr, aOutAncestor); nullptr);
*aOutAncestor = nsLayoutUtils::GetCrossDocParentFrame(this);
nsPoint delta = GetOffsetToCrossDoc(*aOutAncestor); nsPoint delta = GetOffsetToCrossDoc(*aOutAncestor);
/* Combine the raw transform with a translation to our parent. */ /* Combine the raw transform with a translation to our parent. */
result.PostTranslate(NSAppUnitsToFloatPixels(delta.x, scaleFactor), result.PostTranslate(NSAppUnitsToFloatPixels(delta.x, scaleFactor),