Bug 1389010, part 4 - In nsCSSRenderingBorders::DrawBorders declare allBordersSolid where it is defined and make it const. r=dholbert
MozReview-Commit-ID: rdKiCDOplp
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -3248,18 +3248,16 @@ nsCSSBorderRenderer::DrawBorders()
mOuterRect.Round();
mInnerRect.Round();
}
// Initial values only used when the border colors/widths are all the same:
ColorPattern color(ToDeviceColor(mBorderColors[eSideTop]));
StrokeOptions strokeOptions(mBorderWidths[eSideTop]); // stroke width
- bool allBordersSolid;
-
// First there's a couple of 'special cases' that have specifically optimized
// drawing paths, when none of these can be used we move on to the generalized
// border drawing code.
if (allBordersSameStyle &&
mCompositeColors[0] == nullptr &&
allBordersSameWidth &&
mBorderStyles[0] == NS_STYLE_BORDER_STYLE_SOLID &&
mNoBorderRadius &&
@@ -3298,19 +3296,19 @@ nsCSSBorderRenderer::DrawBorders()
RefPtr<PathBuilder> builder = mDrawTarget->CreatePathBuilder();
AppendRoundedRectToPath(builder, mOuterRect, mBorderRadii, true);
AppendRoundedRectToPath(builder, ToRect(borderInnerRect.rect), borderInnerRect.corners, false);
RefPtr<Path> path = builder->Finish();
mDrawTarget->Fill(path, color);
return;
}
- bool hasCompositeColors;
-
- allBordersSolid = AllBordersSolid(&hasCompositeColors);
+ const bool hasCompositeColors;
+ const bool allBordersSolid = AllBordersSolid(&hasCompositeColors);
+
// This leaves the border corners non-interpolated for single width borders.
// Doing this is slightly faster and shouldn't be a problem visually.
if (allBordersSolid &&
allBordersSameWidth &&
mCompositeColors[0] == nullptr &&
mBorderWidths[0] == 1 &&
mNoBorderRadius &&
!mAvoidStroke)