Bug 1215180 - Modify the scale calculate in order to prevent blurry of animation transform. r=mstange

This commit is contained in:
Mantaroh Yoshinaga
2016-03-23 16:18:00 -04:00
parent baa1c8dce5
commit cef797a3fa

View File

@@ -5105,9 +5105,11 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder,
scale = nsLayoutUtils::ComputeSuitableScaleForAnimation( scale = nsLayoutUtils::ComputeSuitableScaleForAnimation(
aContainerFrame, aVisibleRect.Size(), aContainerFrame, aVisibleRect.Size(),
displaySize); displaySize);
// multiply by the scale inherited from ancestors // multiply by the scale inherited from ancestors--we use a uniform
scale.width *= aIncomingScale.mXScale; // scale factor to prevent blurring when the layer is rotated.
scale.height *= aIncomingScale.mYScale; float incomingScale = std::max(aIncomingScale.mXScale, aIncomingScale.mYScale);
scale.width *= incomingScale;
scale.height *= incomingScale;
} else { } else {
// Scale factors are normalized to a power of 2 to reduce the number of resolution changes // Scale factors are normalized to a power of 2 to reduce the number of resolution changes
scale = RoundToFloatPrecision(ThebesMatrix(transform2d).ScaleFactors(true)); scale = RoundToFloatPrecision(ThebesMatrix(transform2d).ScaleFactors(true));