Bug 1090494, part 2 - Convert the consumers of AppendRoundedRectToPath and MakePathForRoundedRect to use the new RectCornerRadii API. r=mattwoodrow

This commit is contained in:
Jonathan Watt 2014-10-30 09:34:10 +00:00
parent ecfd6db484
commit 6b502f624e
3 changed files with 6 additions and 8 deletions

View File

@ -204,8 +204,7 @@ SVGRectElement::BuildPath(PathBuilder* aBuilder)
rx = std::min(rx, width / 2);
ry = std::min(ry, height / 2);
Size cornerRadii(rx, ry);
Size radii[] = { cornerRadii, cornerRadii, cornerRadii, cornerRadii };
RectCornerRadii radii(rx, ry);
AppendRoundedRectToPath(aBuilder, Rect(x, y, width, height), radii);
}

View File

@ -1146,10 +1146,10 @@ gfxContext::RoundedRectangle(const gfxRect& rect,
// appropriate multiplier from the list before using.
EnsurePathBuilder();
Size radii[] = { ToSize(corners[NS_CORNER_TOP_LEFT]),
ToSize(corners[NS_CORNER_TOP_RIGHT]),
ToSize(corners[NS_CORNER_BOTTOM_RIGHT]),
ToSize(corners[NS_CORNER_BOTTOM_LEFT]) };
RectCornerRadii radii(ToSize(corners[NS_CORNER_TOP_LEFT]),
ToSize(corners[NS_CORNER_TOP_RIGHT]),
ToSize(corners[NS_CORNER_BOTTOM_RIGHT]),
ToSize(corners[NS_CORNER_BOTTOM_LEFT]));
AppendRoundedRectToPath(mPathBuilder, ToRect(rect), radii, draw_clockwise);
}

View File

@ -791,8 +791,7 @@ void nsDisplayNotation::Paint(nsDisplayListBuilder* aBuilder,
}
case NOTATION_ROUNDEDBOX: {
Float radius = 3 * strokeWidth;
Size cornerRadii(radius, radius);
Size radii[] = { cornerRadii, cornerRadii, cornerRadii, cornerRadii };
RectCornerRadii radii(radius, radius);
RefPtr<Path> roundedRect =
MakePathForRoundedRect(aDrawTarget, rect, radii, true);
aDrawTarget.Stroke(roundedRect, color, strokeOptions);