зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1311244 Part 1 - Use nsPoint type for center in nsCSSClipPathInstance. r=dbaron
|center| should be of nsPoint type since all the arguments of ComputeObjectAnchorPoint() uses nsPoint and nsSize. We should only convert center to Point (which is an an UnknownUnits type) for APIs requiring Point type. MozReview-Commit-ID: EDrQGPUZp6m --HG-- extra : rebase_source : 813b8cb203752e6c63b0a405473f7d0cd9dbc3e6
This commit is contained in:
Родитель
a564d3c513
Коммит
8cddb87ec2
|
@ -133,7 +133,7 @@ nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
|
|||
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");
|
||||
|
@ -162,7 +162,8 @@ nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
|
|||
|
||||
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();
|
||||
|
@ -181,7 +182,7 @@ nsCSSClipPathInstance::CreateClipPathEllipse(DrawTarget* aDrawTarget,
|
|||
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");
|
||||
|
@ -202,7 +203,7 @@ nsCSSClipPathInstance::CreateClipPathEllipse(DrawTarget* aDrawTarget,
|
|||
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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче