Backed out 2 changesets (bug 1474722)For freqvently failing test verify on gfx/tests/reftest/1474722.html CLOSED TREE

Backed out changeset 53d0bbb455cb (bug 1474722)
Backed out changeset 315d75c42ef0 (bug 1474722)
This commit is contained in:
arthur.iakab 2018-07-18 19:48:21 +03:00
parent dc49387df8
commit ecc4a026dc
5 changed files with 13 additions and 50 deletions

View File

@ -292,13 +292,6 @@ IntRectTyped<units> RoundedToInt(const RectTyped<units>& aRect)
int32_t(copy.Height()));
}
template<class units>
bool RectIsInt32Safe(const RectTyped<units>& aRect) {
float min = (float)std::numeric_limits<std::int32_t>::min();
float max = (float)std::numeric_limits<std::int32_t>::max();
return aRect.x > min && aRect.y > min && aRect.XMost() < max && aRect.YMost() < max;
}
template<class units>
IntRectTyped<units> RoundedIn(const RectTyped<units>& aRect)
{

View File

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.shadowed {
box-shadow: 0 0 35px rgba(0, 0, 0, .9);
border: 1px solid lightgray;
margin: 0 2em;
float: left;
}
</style>
</head>
<body style = "overflow:hidden">
<div class="shadowed" style="height: 200vh"> long shadow </div>
</body>
</html>

View File

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.shadowed {
box-shadow: 0 0 35px rgba(0, 0, 0, .9);
border: 1px solid lightgray;
margin: 0 2em;
float: left;
}
</style>
</head>
<body style = "overflow:hidden">
<div class="shadowed" style="height: 100000px"> long shadow </div>
</body>
</html>

View File

@ -13,6 +13,5 @@ fuzzy(100,30) == 1149923.html 1149923-ref.html # use fuzzy due to few distorted
== 1435143.html 1435143-ref.html
== 1444904.html 1444904-ref.html
== 1451168.html 1451168-ref.html
== 1474722.html 1474722-ref.html
fuzzy(5-32,21908-26354) fuzzy-if(webrender,0-1,0-3) == 1463802.html 1463802-ref.html
== 1461313.html 1461313-ref.html

View File

@ -594,12 +594,6 @@ GetBlur(gfxContext* aDestinationCtx,
if (useDestRect) {
minSize = aRectSize;
}
int32_t maxTextureSize = gfxPlatform::MaxTextureSize();
if (minSize.width > maxTextureSize || minSize.height > maxTextureSize) {
return nullptr;
}
aOutMinSize = minSize;
DrawTarget* destDT = aDestinationCtx->GetDrawTarget();
@ -961,7 +955,13 @@ gfxAlphaBoxBlur::BlurRectangle(gfxContext* aDestinationCtx,
const gfxRect& aDirtyRect,
const gfxRect& aSkipRect)
{
if (!RectIsInt32Safe(ToRect(aRect))) {
const double maxSize = (double)gfxPlatform::MaxTextureSize();
const double maxPos = (double)std::numeric_limits<std::int16_t>::max();
if (aRect.width > maxSize || aRect.height > maxSize ||
std::abs(aRect.x) > maxPos || std::abs(aRect.y) > maxPos) {
// The rectangle is huge, perhaps due to a very strong perspective or some other
// transform. We won't be able to blur something this big so give up now before
// overflowing or running into texture size limits later.
return;
}
@ -1020,12 +1020,17 @@ gfxAlphaBoxBlur::BlurRectangle(gfxContext* aDestinationCtx,
// so if there's a transform on destDrawTarget that is not pixel-aligned,
// there will be seams between adjacent parts of the box-shadow. It's hard to
// avoid those without the use of an intermediate surface.
// You might think that we could avoid those by just turning off AA, but there
// You might think that we could avoid those by just turning of AA, but there
// is a problem with that: Box-shadow rendering needs to clip out the
// element's border box, and we'd like that clip to have anti-aliasing -
// especially if the element has rounded corners! So we can't do that unless
// we have a way to say "Please anti-alias the clip, but don't antialias the
// destination rect of the DrawSurface call".
// On OS X there is an additional problem with turning off AA: CoreGraphics
// will not just fill the pixels that have their pixel center inside the
// filled shape. Instead, it will fill all the pixels which are partially
// covered by the shape. So for pixels on the edge between two adjacent parts,
// all those pixels will be painted to by both parts, which looks very bad.
destDrawTarget->PopClip();
}