mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 1274962 - Part 2: Remove unnecessary optimization combining translations. r=mstange
--HG-- extra : rebase_source : 8e46cd5a078cc9e506af339220a6bc70a76069f1
This commit is contained in:
parent
4b9ab44334
commit
a9506b8fcc
@ -5727,17 +5727,7 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
|
|||||||
// This is a simplification of the following |else| block, the
|
// This is a simplification of the following |else| block, the
|
||||||
// simplification being possible because we don't need to apply
|
// simplification being possible because we don't need to apply
|
||||||
// mToTransformOrigin between two transforms.
|
// mToTransformOrigin between two transforms.
|
||||||
if ((aFlags & OFFSET_BY_ORIGIN) &&
|
result.ChangeBasis(aProperties.mToTransformOrigin);
|
||||||
!hasPerspective) {
|
|
||||||
// We can fold the final translation by roundedOrigin into the first matrix
|
|
||||||
// basis change translation. This is more stable against variation due to
|
|
||||||
// insufficient floating point precision than reversing the translation
|
|
||||||
// afterwards.
|
|
||||||
result.PreTranslate(-aProperties.mToTransformOrigin);
|
|
||||||
result.PostTranslate(roundedOrigin + aProperties.mToTransformOrigin);
|
|
||||||
} else {
|
|
||||||
result.ChangeBasis(aProperties.mToTransformOrigin);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Point3D refBoxOffset(NSAppUnitsToFloatPixels(refBox.X(), aAppUnitsPerPixel),
|
Point3D refBoxOffset(NSAppUnitsToFloatPixels(refBox.X(), aAppUnitsPerPixel),
|
||||||
NSAppUnitsToFloatPixels(refBox.Y(), aAppUnitsPerPixel),
|
NSAppUnitsToFloatPixels(refBox.Y(), aAppUnitsPerPixel),
|
||||||
@ -5761,24 +5751,16 @@ nsDisplayTransform::GetResultingTransformMatrixInternal(const FrameTransformProp
|
|||||||
// Similar to the code in the |if| block above, but since we've accounted
|
// Similar to the code in the |if| block above, but since we've accounted
|
||||||
// for mToTransformOrigin so we don't include that. We also need to reapply
|
// for mToTransformOrigin so we don't include that. We also need to reapply
|
||||||
// refBoxOffset.
|
// refBoxOffset.
|
||||||
if ((aFlags & OFFSET_BY_ORIGIN) &&
|
result.ChangeBasis(refBoxOffset);
|
||||||
!hasPerspective) {
|
|
||||||
result.PreTranslate(-refBoxOffset);
|
|
||||||
result.PostTranslate(roundedOrigin + refBoxOffset);
|
|
||||||
} else {
|
|
||||||
result.ChangeBasis(refBoxOffset);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasPerspective) {
|
if (hasPerspective) {
|
||||||
result = result * perspectiveMatrix;
|
result = result * perspectiveMatrix;
|
||||||
|
|
||||||
if (aFlags & OFFSET_BY_ORIGIN) {
|
|
||||||
result.PostTranslate(roundedOrigin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aFlags & BASIS_AT_ORIGIN) {
|
if (aFlags & OFFSET_BY_ORIGIN) {
|
||||||
|
result.PostTranslate(roundedOrigin);
|
||||||
|
} else if (aFlags & BASIS_AT_ORIGIN) {
|
||||||
result.ChangeBasis(roundedOrigin);
|
result.ChangeBasis(roundedOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user