Bug 1368190 - Enable outer box shadows with negative spread radius. r=rhunt

This commit is contained in:
Mason Chang 2017-05-26 12:49:07 -07:00
Родитель e49fb92e99
Коммит 39305a1bbc
4 изменённых файлов: 13 добавлений и 44 удалений

Просмотреть файл

@ -5178,14 +5178,6 @@ nsDisplayBoxShadowOuter::CanBuildWebRenderDisplayItems()
}
}
for (uint32_t j = shadows->Length(); j > 0; j--) {
nsCSSShadowItem* shadow = shadows->ShadowAt(j - 1);
// Need WR support for clip out.
if (shadow->mRadius <= 0) {
return false;
}
}
return true;
}
@ -5255,38 +5247,15 @@ nsDisplayBoxShadowOuter::CreateWebRenderCommands(wr::DisplayListBuilder& aBuilde
: 0.0;
float spreadRadius = float(shadow->mSpread) / float(appUnitsPerDevPixel);
if (blurRadius <= 0) {
MOZ_ASSERT(false, "WR needs clip out first");
// TODO: See nsContextBoxBlur::BlurRectangle. Just need to fill
// a rect here with the proper clip in/out, but WR doesn't support
// clip out yet
if (hasBorderRadius) {
LayerSize borderRadiusSize(borderRadius, borderRadius);
WrComplexClipRegion roundedRect =
wr::ToWrComplexClipRegion(deviceBoxRect,
borderRadiusSize);
nsTArray<WrComplexClipRegion> clips;
clips.AppendElement(roundedRect);
aBuilder.PushRect(deviceBoxRect,
aBuilder.PushClipRegion(deviceClipRect,
clips),
wr::ToWrColor(shadowColor));
} else {
aBuilder.PushRect(deviceBoxRect,
aBuilder.PushClipRegion(deviceClipRect),
wr::ToWrColor(shadowColor));
}
} else {
aBuilder.PushBoxShadow(deviceBoxRect,
aBuilder.PushClipRegion(deviceClipRect),
deviceBoxRect,
wr::ToWrPoint(shadowOffset),
wr::ToWrColor(shadowColor),
blurRadius,
spreadRadius,
borderRadius,
WrBoxShadowClipMode::Outset);
}
aBuilder.PushBoxShadow(deviceBoxRect,
aBuilder.PushClipRegion(deviceClipRect),
deviceBoxRect,
wr::ToWrPoint(shadowOffset),
wr::ToWrColor(shadowColor),
blurRadius,
spreadRadius,
borderRadius,
WrBoxShadowClipMode::Outset);
}
}
}

Просмотреть файл

@ -16,7 +16,7 @@ fuzzy-if(OSX==1010,1,24) fuzzy-if(d2d,16,908) fuzzy-if(webrender,48,2040) == box
fails-if(Android) == boxshadow-fileupload.html boxshadow-fileupload-ref.html
fuzzy-if(skiaContent,13,28) == boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg
random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
random-if(d2d) fuzzy-if(skiaContent,1,100) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
random-if(d2d) fuzzy-if(skiaContent,1,100) fuzzy-if(webrender,127,3528) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
fuzzy-if(skiaContent,1,50) HTTP(..) == boxshadow-dynamic.xul boxshadow-dynamic-ref.xul
random-if(d2d) == boxshadow-onecorner.html boxshadow-onecorner-ref.html
random-if(d2d) == boxshadow-twocorners.html boxshadow-twocorners-ref.html

Просмотреть файл

@ -34,7 +34,7 @@ fuzzy-if(skiaContent,1,20) == clip-path-polygon-013.html clip-path-stripes-003-r
== clip-path-circle-014.html clip-path-circle-007-ref.html
== clip-path-circle-015.html clip-path-circle-008-ref.html
== clip-path-circle-016.html clip-path-circle-009-ref.html
== clip-path-circle-017.html clip-path-circle-007-ref.html
fuzzy-if(webrender,128,714) == clip-path-circle-017.html clip-path-circle-007-ref.html
== clip-path-circle-018.html clip-path-circle-010-ref.html
== clip-path-circle-019.html clip-path-circle-002-ref.html
== clip-path-circle-020.html clip-path-circle-002-ref.html

Просмотреть файл

@ -27,8 +27,8 @@ fuzzy-if(skiaContent||winWidget,1,20000) == mask-image-2.html mask-image-2-ref.h
fuzzy-if(skiaContent||winWidget,1,43) == mask-image-3c.html mask-image-3-ref.html
fuzzy-if(skiaContent||winWidget,1,43) == mask-image-3d.html mask-image-3-ref.html
== mask-image-3e.html mask-image-3-ref.html
fuzzy-if(skiaContent||winWidget,50,85) == mask-image-3f.html mask-image-3-ref.html
fuzzy-if(skiaContent||winWidget,50,85) == mask-image-3g.html mask-image-3-ref.html
fuzzy-if(skiaContent||winWidget,50,85) fuzzy-if(webrender,1,126) == mask-image-3f.html mask-image-3-ref.html
fuzzy-if(skiaContent||winWidget,50,85) fuzzy-if(webrender,1,126) == mask-image-3g.html mask-image-3-ref.html
pref(layout.css.clip-path-shapes.enabled,true) fuzzy-if(winWidget,1,3) fuzzy-if(skiaContent,2,12) == mask-image-3h.html mask-image-3-ref.html
fuzzy-if(skiaContent,71,203) == mask-image-3i.html mask-image-3-ref.html
== mask-image-4a.html blank.html