From 1f96bf701402c15407c411fdbf4fb4a035dceeca Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Mon, 29 Jun 2015 16:46:16 -0700 Subject: [PATCH] Bug 1122526 patch 1 - Factor in the scale from ancestors when computing scale for layer with OMT animation of transform. r=roc --- layout/base/FrameLayerBuilder.cpp | 5 ++++ .../animate-layer-scale-inherit-1-ref.html | 24 +++++++++++++++++ .../animate-layer-scale-inherit-1.html | 27 +++++++++++++++++++ layout/reftests/transform/reftest.list | 2 ++ 4 files changed, 58 insertions(+) create mode 100644 layout/reftests/transform/animate-layer-scale-inherit-1-ref.html create mode 100644 layout/reftests/transform/animate-layer-scale-inherit-1.html diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 156a116f674f..f7d127daa39b 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -4700,9 +4700,14 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder, if (aContainerFrame->GetContent() && nsLayoutUtils::HasAnimationsForCompositor( aContainerFrame->GetContent(), eCSSProperty_transform)) { + // compute scale using the animation on the container (ignoring + // its ancestors) scale = nsLayoutUtils::ComputeSuitableScaleForAnimation( aContainerFrame->GetContent(), aVisibleRect.Size(), aContainerFrame->PresContext()->GetVisibleArea().Size()); + // multiply by the scale inherited from ancestors + scale.width *= aIncomingScale.mXScale; + scale.height *= aIncomingScale.mYScale; } else { // Scale factors are normalized to a power of 2 to reduce the number of resolution changes scale = RoundToFloatPrecision(ThebesMatrix(transform2d).ScaleFactors(true)); diff --git a/layout/reftests/transform/animate-layer-scale-inherit-1-ref.html b/layout/reftests/transform/animate-layer-scale-inherit-1-ref.html new file mode 100644 index 000000000000..3f2974597f31 --- /dev/null +++ b/layout/reftests/transform/animate-layer-scale-inherit-1-ref.html @@ -0,0 +1,24 @@ + +Testcase, bug 1122526 + + +
+
+
+
diff --git a/layout/reftests/transform/animate-layer-scale-inherit-1.html b/layout/reftests/transform/animate-layer-scale-inherit-1.html new file mode 100644 index 000000000000..b04c4a8fa965 --- /dev/null +++ b/layout/reftests/transform/animate-layer-scale-inherit-1.html @@ -0,0 +1,27 @@ + +Testcase, bug 1122526 + + +
+
+
+
diff --git a/layout/reftests/transform/reftest.list b/layout/reftests/transform/reftest.list index ad09aa38d009..80c58967edc0 100644 --- a/layout/reftests/transform/reftest.list +++ b/layout/reftests/transform/reftest.list @@ -132,3 +132,5 @@ pref(svg.transform-origin.enabled,true) == transform-origin-svg-1a.svg transform pref(svg.transform-origin.enabled,true) == transform-origin-svg-1b.svg transform-origin-svg-1-ref.svg pref(svg.transform-origin.enabled,true) == transform-origin-svg-2a.svg transform-origin-svg-2-ref.svg pref(svg.transform-origin.enabled,true) == transform-origin-svg-2b.svg transform-origin-svg-2-ref.svg +# Bug 1122526 +== animate-layer-scale-inherit-1.html animate-layer-scale-inherit-1-ref.html