Issue #2364 - Re-factor AlphaBoxBlur

Only blur one quadrant of a box-shadow and mirror it to the other quadrants.
This applies only if the corners are symmetrical (square corners or equal
corner radii) otherwise we'll fall back to the old method.
This commit is contained in:
Moonchild 2023-10-30 12:23:36 +01:00 committed by roytam1
commit 8d30faf95f
6 changed files with 556 additions and 351 deletions

View file

@ -1631,7 +1631,6 @@ nsCSSRendering::PaintBoxShadowInner(nsPresContext* aPresContext,
// transparent in the shadow, so drawing them changes nothing.
gfxContext* renderContext = aRenderingContext.ThebesContext();
DrawTarget* drawTarget = renderContext->GetDrawTarget();
nsContextBoxBlur blurringArea;
// Clip the context to the area of the frame's padding rect, so no part of the
// shadow is painted outside. Also cut out anything beyond where the inset shadow
@ -6243,9 +6242,8 @@ nsContextBoxBlur::InsetBoxBlur(gfxContext* aDestinationCtx,
mAlphaBoxBlur.BlurInsetBox(aDestinationCtx, transformedDestRect,
transformedShadowClipRect,
blurRadius, spreadRadius,
aShadowColor, aHasBorderRadius,
aInnerClipRectRadii, transformedSkipRect,
aShadowOffset);
blurRadius, aShadowColor,
aHasBorderRadius ? &aInnerClipRectRadii : nullptr,
transformedSkipRect, aShadowOffset);
return true;
}