Bug 1348408 - Only create inset box shadow WR layers for cases WR supports. r=rhunt

This commit is contained in:
Mason Chang 2017-03-15 13:40:00 -07:00
Родитель 0a0a696241
Коммит d1c245a2c8
2 изменённых файлов: 24 добавлений и 1 удалений

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

@ -5114,6 +5114,29 @@ nsDisplayBoxShadowInner::GetLayerState(nsDisplayListBuilder* aBuilder,
const ContainerLayerParameters& aParameters)
{
if (gfxPrefs::LayersAllowInsetBoxShadow()) {
nsPoint offset = ToReferenceFrame();
nsRect borderRect = nsRect(offset, mFrame->GetSize());
RectCornerRadii innerRadii;
bool hasBorderRadius = nsCSSRendering::GetShadowInnerRadii(mFrame,
borderRect,
innerRadii);
if (hasBorderRadius) {
return LAYER_NONE;
}
nsCSSShadowArray* shadows = mFrame->StyleEffects()->mBoxShadow;
for (uint32_t i = shadows->Length(); i > 0; --i) {
nsCSSShadowItem* shadowItem = shadows->ShadowAt(i - 1);
if (!shadowItem->mInset) {
continue;
}
if (shadowItem->mXOffset <= 0 || shadowItem->mYOffset <= 0) {
// Need to wait for WR to support clip out.
return LAYER_NONE;
}
}
return LAYER_ACTIVE;
}

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

@ -32,7 +32,7 @@ fuzzy(26,3610) == boxshadow-rotated.html boxshadow-rotated-ref.html # Bug 121126
== boxshadow-inset-large-border-radius.html boxshadow-inset-large-border-radius-ref.html
# fuzzy due to blur going inside, but as long as it's essentially black instead of a light gray its ok.
fuzzy(12,9445) fuzzy-if(d2d,13,10926) == boxshadow-inset-large-offset.html boxshadow-inset-large-offset-ref.html
fuzzy(13,9445) fuzzy-if(d2d,13,10926) fuzzy-if(webrender,13,13612) == boxshadow-inset-large-offset.html boxshadow-inset-large-offset-ref.html
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref.html
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref2.html