Bug 1389010, part 2 - Move an early return in nsCSSBorderRenderer::DrawBorders up to avoid unnecessary work. r=dholbert

MozReview-Commit-ID: AfuBCfYs3S1
This commit is contained in:
Jonathan Watt 2017-08-07 10:17:57 +01:00
Родитель 90da60023d
Коммит 4c063580b8
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -3214,6 +3214,14 @@ nsCSSBorderRenderer::DrawBorders()
return; return;
} }
bool allBordersSameWidth = AllBordersSameWidth();
if (allBordersSameWidth && mBorderWidths[0] == 0.0) {
// Some of the allBordersSameWidth codepaths depend on the border
// width being greater than zero.
return;
}
AutoRestoreTransform autoRestoreTransform; AutoRestoreTransform autoRestoreTransform;
Matrix mat = mDrawTarget->GetTransform(); Matrix mat = mDrawTarget->GetTransform();
@ -3241,14 +3249,6 @@ nsCSSBorderRenderer::DrawBorders()
mInnerRect.Round(); mInnerRect.Round();
} }
bool allBordersSameWidth = AllBordersSameWidth();
if (allBordersSameWidth && mBorderWidths[0] == 0.0) {
// Some of the allBordersSameWidth codepaths depend on the border
// width being greater than zero.
return;
}
// Initial values only used when the border colors/widths are all the same: // Initial values only used when the border colors/widths are all the same:
ColorPattern color(ToDeviceColor(mBorderColors[eSideTop])); ColorPattern color(ToDeviceColor(mBorderColors[eSideTop]));
StrokeOptions strokeOptions(mBorderWidths[eSideTop]); // stroke width StrokeOptions strokeOptions(mBorderWidths[eSideTop]); // stroke width