Bug 939607 - Part 1: Make PaintBoxShadowOuter take an opacity value. r=roc

This commit is contained in:
Matt Woodrow 2013-11-18 22:32:09 +13:00
parent 01cc092803
commit d5bdc88e88
2 changed files with 8 additions and 3 deletions

View File

@ -1020,7 +1020,8 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,
nsIFrame* aForFrame,
const nsRect& aFrameArea,
const nsRect& aDirtyRect)
const nsRect& aDirtyRect,
float aOpacity)
{
const nsStyleBorder* styleBorder = aForFrame->StyleBorder();
nsCSSShadowArray* shadows = styleBorder->mBoxShadow;
@ -1132,8 +1133,11 @@ nsCSSRendering::PaintBoxShadowOuter(nsPresContext* aPresContext,
else
shadowColor = aForFrame->StyleColor()->mColor;
gfxRGBA gfxShadowColor(shadowColor);
gfxShadowColor.a *= aOpacity;
renderContext->Save();
renderContext->SetColor(gfxRGBA(shadowColor));
renderContext->SetColor(gfxShadowColor);
// Draw the shape of the frame so it can be blurred. Recall how nsContextBoxBlur
// doesn't make any temporary surfaces if blur is 0 and it just returns the original

View File

@ -264,7 +264,8 @@ struct nsCSSRendering {
nsRenderingContext& aRenderingContext,
nsIFrame* aForFrame,
const nsRect& aFrameArea,
const nsRect& aDirtyRect);
const nsRect& aDirtyRect,
float aOpacity = 1.0);
static void ComputePixelRadii(const nscoord *aAppUnitsRadii,
nscoord aAppUnitsPerPixel,