Files
desktop/src/layout/painting/nsImageRenderer-cpp.patch

50 lines
2.6 KiB
C++

diff --git a/layout/painting/nsImageRenderer.cpp b/layout/painting/nsImageRenderer.cpp
index 6e464b48c90174b8954aad8a79bae30a7a30cbc9..9ea9a4963ceae679f092e014ac24a0d24fb106ce 100644
--- a/layout/painting/nsImageRenderer.cpp
+++ b/layout/painting/nsImageRenderer.cpp
@@ -90,7 +90,7 @@ static already_AddRefed<imgIContainer> GetSymbolicIconImage(nsAtom* aName,
if (NS_WARN_IF(!XRE_IsParentProcess())) {
return nullptr;
}
- const auto fg = aFrame->StyleText()->mColor.ToColor();
+ const auto fg = aFrame->StyleText()->mColor.ToColor(aFrame);
auto key = std::make_tuple(aName, aScale, fg);
auto* cache = aFrame->GetOrCreateDeletableProperty(SymbolicImageCacheProp());
auto lookup = cache->Lookup(key);
@@ -575,7 +575,7 @@ ImgDrawResult nsImageRenderer::Draw(nsPresContext* aPresContext,
}
case StyleImage::Tag::Gradient: {
nsCSSGradientRenderer renderer = nsCSSGradientRenderer::Create(
- aPresContext, mForFrame->Style(), *mGradientData, mSize);
+ aPresContext, mForFrame->Style(), mForFrame, *mGradientData, mSize);
renderer.Paint(*ctx, aDest, aFill, aRepeatSize, aSrc, aDirtyRect,
aOpacity);
@@ -652,7 +652,7 @@ ImgDrawResult nsImageRenderer::BuildWebRenderDisplayItems(
switch (mType) {
case StyleImage::Tag::Gradient: {
nsCSSGradientRenderer renderer = nsCSSGradientRenderer::Create(
- aPresContext, mForFrame->Style(), *mGradientData, mSize);
+ aPresContext, mForFrame->Style(), mForFrame, *mGradientData, mSize);
renderer.BuildWebRenderDisplayItems(aBuilder, aSc, aDest, aFill,
aRepeatSize, aSrc,
@@ -678,6 +678,8 @@ ImgDrawResult nsImageRenderer::BuildWebRenderDisplayItems(
nsPresContext::AppUnitsToIntCSSPixels(aDest.height)};
SVGImageContext svgContext(Some(destCSSSize));
+ SVGImageContext::MaybeStoreZenBoosts(svgContext,
+ *mForFrame->PresContext());
Maybe<ImageIntRegion> region;
const int32_t appUnitsPerDevPixel = aPresContext->AppUnitsPerDevPixel();
@@ -1092,7 +1094,7 @@ ImgDrawResult nsImageRenderer::DrawShapeImage(nsPresContext* aPresContext,
if (mImage->IsGradient()) {
nsCSSGradientRenderer renderer = nsCSSGradientRenderer::Create(
- aPresContext, mForFrame->Style(), *mGradientData, mSize);
+ aPresContext, mForFrame->Style(), mForFrame, *mGradientData, mSize);
nsRect dest(nsPoint(0, 0), mSize);
renderer.Paint(aRenderingContext, dest, dest, mSize,
CSSIntRect::FromAppUnitsRounded(dest), dest, 1.0);