Bug 955712 - Don't draw background color when not needed. r=roc

This commit is contained in:
Mats Palmgren 2014-01-05 23:31:14 +00:00
parent e6ea29ce0d
commit 62f87e1c89

View File

@ -2614,14 +2614,17 @@ nsCSSRendering::PaintBackgroundColorWithSC(nsPresContext* aPresContext,
// background colors.
bool drawBackgroundImage;
bool drawBackgroundColor;
nscolor bgColor = DetermineBackgroundColor(aPresContext,
aBackgroundSC,
aForFrame,
drawBackgroundImage,
drawBackgroundColor);
NS_ASSERTION(drawBackgroundColor, "Should not be trying to paint a background color if we don't have one");
NS_ASSERTION(drawBackgroundImage || drawBackgroundColor,
"Should not be trying to paint a background if we don't have one");
if (!drawBackgroundColor) {
return;
}
// Compute the outermost boundary of the area that might be painted.
gfxContext *ctx = aRenderingContext.ThebesContext();