Bug 1209100 - Back out bug 1165185 on inbound.

MozReview-Commit-ID: JqohyXNvjiU

--HG--
extra : rebase_source : c2165d279a6ca57a3439ebbfc081961369a42124
This commit is contained in:
Markus Stange 2016-03-21 16:16:52 -04:00
parent 397d6cce9c
commit 04177e1aa2
9 changed files with 13 additions and 162 deletions

View File

@ -1269,24 +1269,6 @@ public:
return *this;
}
// Nudge the 3D components to integer so that this matrix will become 2D if
// it's very close to already being 2D.
// This doesn't change the _41 and _42 components.
Matrix4x4Typed &NudgeTo2D()
{
NudgeToInteger(&_13);
NudgeToInteger(&_14);
NudgeToInteger(&_23);
NudgeToInteger(&_24);
NudgeToInteger(&_31);
NudgeToInteger(&_32);
NudgeToInteger(&_33);
NudgeToInteger(&_34);
NudgeToInteger(&_43);
NudgeToInteger(&_44);
return *this;
}
Point4D TransposedVector(int aIndex) const
{
MOZ_ASSERT(aIndex >= 0 && aIndex <= 3, "Invalid matrix array index");

View File

@ -171,7 +171,7 @@ struct LayerPropertiesBase : public LayerProperties
nsIntRegion ComputeChange(NotifySubDocInvalidationFunc aCallback,
bool& aGeometryChanged)
{
bool transformChanged = !mTransform.FuzzyEqualsMultiplicative(GetTransformForInvalidation(mLayer)) ||
bool transformChanged = !mTransform.FuzzyEqual(GetTransformForInvalidation(mLayer)) ||
mLayer->GetPostXScale() != mPostXScale ||
mLayer->GetPostYScale() != mPostYScale;
const Maybe<ParentLayerIntRect>& otherClip = mLayer->GetEffectiveClipRect();

View File

@ -4996,15 +4996,6 @@ static inline gfxSize RoundToFloatPrecision(const gfxSize& aSize)
return gfxSize(float(aSize.width), float(aSize.height));
}
static inline gfxSize NudgedToIntegerSize(const gfxSize& aSize)
{
float width = aSize.width;
float height = aSize.height;
gfx::NudgeToInteger(&width);
gfx::NudgeToInteger(&height);
return gfxSize(width, height);
}
static void RestrictScaleToMaxLayerSize(gfxSize& aScale,
const nsRect& aVisibleRect,
nsIFrame* aContainerFrame,
@ -5050,13 +5041,12 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder,
if (aTransform) {
// aTransform is applied first, then the scale is applied to the result
transform = (*aTransform)*transform;
// Set relevant 3d matrix entries that are close to integers to be those
// exact integers. This protects against floating-point inaccuracies
// causing problems in the CanDraw2D / Is2D checks below.
// We don't nudge all matrix components here. In particular, we don't want to
// nudge the X/Y translation components, because those include the scroll
// offset, and we don't want scrolling to affect whether we nudge or not.
transform.NudgeTo2D();
// Set any matrix entries close to integers to be those exact integers.
// This protects against floating-point inaccuracies causing problems
// in the checks below.
// We use the fixed epsilon version here because we don't want the nudging
// to depend on the scroll position.
transform.NudgeToIntegersFixedEpsilon();
}
Matrix transform2d;
if (aContainerFrame &&
@ -5146,7 +5136,7 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder,
scale.height = gfxUtils::ClampToScaleFactor(scale.height);
}
} else {
scale = NudgedToIntegerSize(scale);
// XXX Do we need to move nearly-integer values to integers here?
}
}
// If the scale factors are too small, just use 1.0. The content is being

View File

@ -3,10 +3,11 @@
== wide--contain--height.html ref-wide-empty.html
== wide--contain--width.html ref-wide-empty.html
== tall--cover--height.html ref-tall-lime.html
== tall--cover--width.html ref-tall-lime.html
== wide--cover--height.html ref-wide-lime.html
== wide--cover--width.html ref-wide-lime.html
# These tests fail because of integer overflow; see bug 894555.
fails == tall--cover--height.html ref-tall-lime.html
fails == tall--cover--width.html ref-tall-lime.html
fails == wide--cover--height.html ref-wide-lime.html
fails == wide--cover--width.html ref-wide-lime.html
== zero-height-ratio-contain.html ref-tall-empty.html
== zero-height-ratio-cover.html ref-tall-empty.html

View File

@ -1,40 +0,0 @@
<!DOCTYPE html>
<html lang="en" class="reftest-wait"
reftest-displayport-x="0"
reftest-displayport-y="0"
reftest-displayport-w="800"
reftest-displayport-h="1000">
<meta charset="utf-8">
<title>Scrolling shouldn't invalidate either rect.</title>
<style>
body {
margin: 0;
height: 5000px;
}
</style>
<body>
<svg width="768" height="1000">
<g transform="translate(0 -2000.3234)">
<rect x="100" y="2300" height="50" width="50" fill="grey" class="reftest-no-paint"/>
</g>
<g transform="translate(0 -4000.6468)">
<rect x="200" y="4300" height="50" width="50" fill="grey" class="reftest-no-paint"/>
</g>
</svg>
<script>
document.documentElement.scrollTop = 177;
window.addEventListener("MozReftestInvalidate", function (e) {
document.documentElement.scrollTop = 30;
document.documentElement.removeAttribute("class");
});
</script>

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html lang="en" class="reftest-wait"
reftest-displayport-x="0"
reftest-displayport-y="0"
reftest-displayport-w="800"
reftest-displayport-h="1000">
<meta charset="utf-8">
<title>Scrolling shouldn't invalidate the square.</title>
<style>
body {
margin: 0;
height: 5000px;
}
</style>
<body>
<svg width="768" height="1000">
<g transform="translate(0 112.152992)">
<rect x="100" y="650" height="50" width="50" fill="grey" class="reftest-no-paint"/>
</g>
</svg>
<script>
document.documentElement.scrollTop = 709;
window.addEventListener("MozReftestInvalidate", function (e) {
document.documentElement.scrollTop = 617;
document.documentElement.removeAttribute("class");
});
</script>

View File

@ -1,36 +0,0 @@
<!DOCTYPE html>
<html lang="en" class="reftest-wait"
reftest-displayport-x="0"
reftest-displayport-y="0"
reftest-displayport-w="800"
reftest-displayport-h="1000">
<meta charset="utf-8">
<title>Scrolling shouldn't invalidate the square.</title>
<style>
body {
margin: 0;
height: 5000px;
}
</style>
<body>
<svg width="768" height="1000">
<g transform="translate(0 0.999948799610138)">
<rect x="100" y="100" height="50" width="50" fill="grey" class="reftest-no-paint"/>
</g>
</svg>
<script>
document.documentElement.scrollTop = 11;
window.addEventListener("MozReftestInvalidate", function (e) {
document.documentElement.scrollTop = 51;
document.documentElement.removeAttribute("class");
});
</script>

View File

@ -68,9 +68,6 @@ pref(layers.single-tile.enabled,false) != paintedlayer-recycling-3.html about:bl
fuzzy-if(gtkWidget,2,4) fuzzy-if(asyncPan,2,3955) fuzzy-if(OSX,179,30) fuzzy-if(skiaContent,16,3230) == image-scrolling-zoom-1.html image-scrolling-zoom-1-ref.html
!= image-scrolling-zoom-1-ref.html image-scrolling-zoom-1-notref.html
pref(layers.single-tile.enabled,false) != fast-scrolling.html about:blank
!= fractional-transform-1.html about:blank
!= fractional-transform-2.html about:blank
!= fractional-transform-3.html about:blank
== background-position-1.html background-position-1-ref.html
== zero-opacity-animation.html about:blank
== zero-opacity-text.html about:blank

View File

@ -401,13 +401,6 @@ FuzzyEqualsMultiplicative(T aValue1, T aValue2,
T aEpsilon = detail::FuzzyEqualsEpsilon<T>::value())
{
static_assert(IsFloatingPoint<T>::value, "floating point type required");
// Short-circuit the common case in order to avoid the expensive operations
// below.
if (aValue1 == aValue2) {
return true;
}
// can't use std::min because of bug 965340
T smaller = Abs(aValue1) < Abs(aValue2) ? Abs(aValue1) : Abs(aValue2);
return Abs(aValue1 - aValue2) <= aEpsilon * smaller;