Bug 1389010, part 4 - In nsCSSRenderingBorders::DrawBorders declare allBordersSolid where it is defined and make it const. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Mon, 07 Aug 2017 12:47:19 +0100
changeset 647864 eaee7e7904880bb68467dedd1e45a01cbc830ef4
parent 647863 b73c875c30a6d59ba4a213dba35e63bb4f3653cf
child 647865 430be457b43b0f66eb1a8b3b2dee87285888856a
push id74569
push userbmo:topwu.tw@gmail.com
push dateThu, 17 Aug 2017 01:40:57 +0000
reviewersdholbert
bugs1389010
milestone57.0a1
Bug 1389010, part 4 - In nsCSSRenderingBorders::DrawBorders declare allBordersSolid where it is defined and make it const. r=dholbert MozReview-Commit-ID: rdKiCDOplp
layout/painting/nsCSSRenderingBorders.cpp
--- 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 &&
@@ -3299,18 +3297,18 @@ nsCSSBorderRenderer::DrawBorders()
     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 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)