--- a/layout/svg/nsCSSClipPathInstance.cpp
+++ b/layout/svg/nsCSSClipPathInstance.cpp
@@ -128,17 +128,17 @@ nsCSSClipPathInstance::CreateClipPathCir
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
nsPoint topLeft, anchor;
nsSize size = nsSize(aRefBox.width, aRefBox.height);
nsImageRenderer::ComputeObjectAnchorPoint(basicShape->GetPosition(),
size, size,
&topLeft, &anchor);
- Point center = Point(anchor.x + aRefBox.x, anchor.y + aRefBox.y);
+ nsPoint center(anchor.x + aRefBox.x, anchor.y + aRefBox.y);
const nsTArray<nsStyleCoord>& coords = basicShape->Coordinates();
MOZ_ASSERT(coords.Length() == 1, "wrong number of arguments");
nscoord r = 0;
if (coords[0].GetUnit() == eStyleUnit_Enumerated) {
const auto styleShapeRadius = coords[0].GetEnumValue<StyleShapeRadius>();
nscoord horizontal, vertical;
EnumerationToLength(horizontal, styleShapeRadius,
@@ -157,17 +157,18 @@ nsCSSClipPathInstance::CreateClipPathCir
SVGContentUtils::ComputeNormalizedHypotenuse(aRefBox.width,
aRefBox.height);
r = nsRuleNode::ComputeCoordPercentCalc(coords[0],
NSToCoordRound(referenceLength));
}
nscoord appUnitsPerDevPixel =
mTargetFrame->PresContext()->AppUnitsPerDevPixel();
- builder->Arc(center / appUnitsPerDevPixel, r / appUnitsPerDevPixel,
+ builder->Arc(Point(center.x, center.y) / appUnitsPerDevPixel,
+ r / appUnitsPerDevPixel,
0, Float(2 * M_PI));
builder->Close();
return builder->Finish();
}
already_AddRefed<Path>
nsCSSClipPathInstance::CreateClipPathEllipse(DrawTarget* aDrawTarget,
const nsRect& aRefBox)
@@ -176,17 +177,17 @@ nsCSSClipPathInstance::CreateClipPathEll
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
nsPoint topLeft, anchor;
nsSize size = nsSize(aRefBox.width, aRefBox.height);
nsImageRenderer::ComputeObjectAnchorPoint(basicShape->GetPosition(),
size, size,
&topLeft, &anchor);
- Point center = Point(anchor.x + aRefBox.x, anchor.y + aRefBox.y);
+ nsPoint center(anchor.x + aRefBox.x, anchor.y + aRefBox.y);
const nsTArray<nsStyleCoord>& coords = basicShape->Coordinates();
MOZ_ASSERT(coords.Length() == 2, "wrong number of arguments");
nscoord rx = 0, ry = 0;
if (coords[0].GetUnit() == eStyleUnit_Enumerated) {
EnumerationToLength(rx, coords[0].GetEnumValue<StyleShapeRadius>(),
center.x, aRefBox.x, aRefBox.x + aRefBox.width);
} else {
@@ -197,17 +198,17 @@ nsCSSClipPathInstance::CreateClipPathEll
center.y, aRefBox.y, aRefBox.y + aRefBox.height);
} else {
ry = nsRuleNode::ComputeCoordPercentCalc(coords[1], aRefBox.height);
}
nscoord appUnitsPerDevPixel =
mTargetFrame->PresContext()->AppUnitsPerDevPixel();
EllipseToBezier(builder.get(),
- center / appUnitsPerDevPixel,
+ Point(center.x, center.y) / appUnitsPerDevPixel,
Size(rx, ry) / appUnitsPerDevPixel);
builder->Close();
return builder->Finish();
}
already_AddRefed<Path>
nsCSSClipPathInstance::CreateClipPathPolygon(DrawTarget* aDrawTarget,
const nsRect& aRefBox)