mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1389010, part 7 - Call AllBordersSameWidth in nsCSSBorderRenderer's constructor and store the result as a member. r=dholbert
MozReview-Commit-ID: 70Z3TBLKcq5
This commit is contained in:
parent
f65ea8e5f8
commit
56901d3ac8
@ -211,6 +211,7 @@ nsCSSBorderRenderer::nsCSSBorderRenderer(nsPresContext* aPresContext,
|
||||
mOneUnitBorder = CheckFourFloatsEqual(mBorderWidths, 1.0);
|
||||
mNoBorderRadius = AllCornersZeroSize(mBorderRadii);
|
||||
mAllBordersSameStyle = AreBorderSideFinalStylesSame(eSideBitsAll);
|
||||
mAllBordersSameWidth = AllBordersSameWidth();
|
||||
mAvoidStroke = false;
|
||||
}
|
||||
|
||||
@ -3217,10 +3218,8 @@ nsCSSBorderRenderer::DrawBorders()
|
||||
return;
|
||||
}
|
||||
|
||||
bool allBordersSameWidth = AllBordersSameWidth();
|
||||
|
||||
if (allBordersSameWidth && mBorderWidths[0] == 0.0) {
|
||||
// Some of the allBordersSameWidth codepaths depend on the border
|
||||
if (mAllBordersSameWidth && mBorderWidths[0] == 0.0) {
|
||||
// Some of the mAllBordersSameWidth codepaths depend on the border
|
||||
// width being greater than zero.
|
||||
return;
|
||||
}
|
||||
@ -3261,7 +3260,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||
// border drawing code.
|
||||
if (mAllBordersSameStyle &&
|
||||
mCompositeColors[0] == nullptr &&
|
||||
allBordersSameWidth &&
|
||||
mAllBordersSameWidth &&
|
||||
mBorderStyles[0] == NS_STYLE_BORDER_STYLE_SOLID &&
|
||||
mNoBorderRadius &&
|
||||
!mAvoidStroke)
|
||||
@ -3310,7 +3309,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||
// 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 &&
|
||||
mAllBordersSameWidth &&
|
||||
mCompositeColors[0] == nullptr &&
|
||||
mBorderWidths[0] == 1 &&
|
||||
mNoBorderRadius &&
|
||||
@ -3328,7 +3327,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||
}
|
||||
|
||||
if (allBordersSolid &&
|
||||
allBordersSameWidth &&
|
||||
mAllBordersSameWidth &&
|
||||
mNoBorderRadius &&
|
||||
!mAvoidStroke)
|
||||
{
|
||||
@ -3436,7 +3435,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||
// | | | | | | | |
|
||||
// +----+------------+--+ +----+------------+--+
|
||||
//
|
||||
// XXX Should we only do this optimization if |allBordersSameWidth| is true?
|
||||
// XXX Should we only do this optimization if |mAllBordersSameWidth| is true?
|
||||
//
|
||||
// XXX In fact is this optimization even worth the complexity it adds to
|
||||
// the code? 1px wide dashed borders are not overly common, and drawing
|
||||
|
@ -157,6 +157,7 @@ private:
|
||||
|
||||
// calculated values
|
||||
bool mAllBordersSameStyle;
|
||||
bool mAllBordersSameWidth;
|
||||
bool mOneUnitBorder;
|
||||
bool mNoBorderRadius;
|
||||
bool mAvoidStroke;
|
||||
|
Loading…
Reference in New Issue
Block a user