mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1090494, part 2 - Convert the consumers of AppendRoundedRectToPath and MakePathForRoundedRect to use the new RectCornerRadii API. r=mattwoodrow
This commit is contained in:
parent
ecfd6db484
commit
6b502f624e
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user