Bug 1656817 - Don't create WebRender gradient items for empty gradients. r=lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D86891
This commit is contained in:
Matt Woodrow 2020-08-14 00:56:35 +00:00
parent 5e382d20a3
commit 02b6ed52b4
2 changed files with 8 additions and 9 deletions

View File

@ -765,16 +765,15 @@ ImgDrawResult nsImageRenderer::BuildWebRenderDisplayItemsForLayer(
return mPrepareResult;
}
if (aDest.IsEmpty() || aFill.IsEmpty() || mSize.width <= 0 ||
mSize.height <= 0) {
CSSIntRect srcRect(0, 0, nsPresContext::AppUnitsToIntCSSPixels(mSize.width),
nsPresContext::AppUnitsToIntCSSPixels(mSize.height));
if (aDest.IsEmpty() || aFill.IsEmpty() || srcRect.IsEmpty()) {
return ImgDrawResult::SUCCESS;
}
return BuildWebRenderDisplayItems(
aPresContext, aBuilder, aResources, aSc, aManager, aItem, aDirty, aDest,
aFill, aAnchor, aRepeatSize,
CSSIntRect(0, 0, nsPresContext::AppUnitsToIntCSSPixels(mSize.width),
nsPresContext::AppUnitsToIntCSSPixels(mSize.height)),
aOpacity);
return BuildWebRenderDisplayItems(aPresContext, aBuilder, aResources, aSc,
aManager, aItem, aDirty, aDest, aFill,
aAnchor, aRepeatSize, srcRect, aOpacity);
}
/**

View File

@ -1718,7 +1718,7 @@ fuzzy-if(true,0-17,0-5886) fuzzy-if(skiaContent,0-9,0-5894) fuzzy-if(geckoview&&
== 776443-1.html 776443-1-ref.html
== 776443-2.html 776443-2-ref.html
== 786254-1.html 786254-1-ref.html
fails-if(gtkWidget&&webrender&&swgl) == 787947-1.html 787947-1-ref.html # Bug 1656817
== 787947-1.html 787947-1-ref.html
== 796847-1.svg 796847-1-ref.svg
fuzzy(0-40,0-875) fuzzy-if(skiaContent,0-1,0-2500) == 797797-1.html 797797-1-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely
fuzzy(0-40,0-850) fuzzy-if(skiaContent,0-2,0-2310) == 797797-2.html 797797-2-ref.html # 'opacity:N' and rgba(,,,N) text don't match precisely