Backed out 2 changesets (bug 1546894) for causing mochitest failures at test_canvas.html CLOSED TREE

Backed out changeset b3176ad6f3a7 (bug 1546894)
Backed out changeset 5bc7f1dbafe5 (bug 1546894)
This commit is contained in:
Mihai Alexandru Michis 2019-05-27 15:44:26 +03:00
parent 81f2affed9
commit 5d91cbb8ef
4 changed files with 11 additions and 23 deletions

View File

@ -17,7 +17,6 @@ void PathBuilderCapture::MoveTo(const Point& aPoint) {
op.mP1 = aPoint;
mPathOps.push_back(op);
mCurrentPoint = aPoint;
mFirstPoint = aPoint;
}
void PathBuilderCapture::LineTo(const Point& aPoint) {
@ -49,33 +48,28 @@ void PathBuilderCapture::QuadraticBezierTo(const Point& aCP1,
mCurrentPoint = aCP2;
}
void PathBuilderCapture::Arc(const Point& aCenter, float aRadius,
void PathBuilderCapture::Arc(const Point& aOrigin, float aRadius,
float aStartAngle, float aEndAngle,
bool aAntiClockwise) {
PathOp op;
op.mType = PathOp::OP_ARC;
op.mP1 = aCenter;
op.mP1 = aOrigin;
op.mRadius = aRadius;
op.mStartAngle = aStartAngle;
op.mEndAngle = aEndAngle;
op.mAntiClockwise = aAntiClockwise;
mPathOps.push_back(op);
mCurrentPoint = Point(aCenter.x + aRadius * cosf(aEndAngle),
aCenter.y + aRadius * sinf(aEndAngle));
}
void PathBuilderCapture::Close() {
PathOp op;
op.mType = PathOp::OP_CLOSE;
mPathOps.push_back(op);
mCurrentPoint = mFirstPoint;
}
Point PathBuilderCapture::CurrentPoint() const { return mCurrentPoint; }
already_AddRefed<Path> PathBuilderCapture::Finish() {
mCurrentPoint = Point(0.0, 0.0);
mFirstPoint = Point(0.0, 0.0);
return MakeAndAddRef<PathCapture>(std::move(mPathOps), mFillRule, mDT,
mCurrentPoint);
}

View File

@ -62,7 +62,6 @@ class PathBuilderCapture : public PathBuilder {
FillRule mFillRule;
std::vector<PathOp> mPathOps;
Point mCurrentPoint;
Point mFirstPoint;
RefPtr<DrawTarget> mDT;
};

View File

@ -36,8 +36,6 @@ void PathBuilderSkia::SetFillRule(FillRule aFillRule) {
void PathBuilderSkia::MoveTo(const Point& aPoint) {
mPath.moveTo(SkFloatToScalar(aPoint.x), SkFloatToScalar(aPoint.y));
mCurrentPoint = aPoint;
mFirstPoint = aPoint;
}
void PathBuilderSkia::LineTo(const Point& aPoint) {
@ -46,7 +44,6 @@ void PathBuilderSkia::LineTo(const Point& aPoint) {
} else {
mPath.lineTo(SkFloatToScalar(aPoint.x), SkFloatToScalar(aPoint.y));
}
mCurrentPoint = aPoint;
}
void PathBuilderSkia::BezierTo(const Point& aCP1, const Point& aCP2,
@ -57,7 +54,6 @@ void PathBuilderSkia::BezierTo(const Point& aCP1, const Point& aCP2,
mPath.cubicTo(SkFloatToScalar(aCP1.x), SkFloatToScalar(aCP1.y),
SkFloatToScalar(aCP2.x), SkFloatToScalar(aCP2.y),
SkFloatToScalar(aCP3.x), SkFloatToScalar(aCP3.y));
mCurrentPoint = aCP3;
}
void PathBuilderSkia::QuadraticBezierTo(const Point& aCP1, const Point& aCP2) {
@ -66,13 +62,9 @@ void PathBuilderSkia::QuadraticBezierTo(const Point& aCP1, const Point& aCP2) {
}
mPath.quadTo(SkFloatToScalar(aCP1.x), SkFloatToScalar(aCP1.y),
SkFloatToScalar(aCP2.x), SkFloatToScalar(aCP2.y));
mCurrentPoint = aCP2;
}
void PathBuilderSkia::Close() {
mPath.close();
mCurrentPoint = mFirstPoint;
}
void PathBuilderSkia::Close() { mPath.close(); }
void PathBuilderSkia::Arc(const Point& aOrigin, float aRadius,
float aStartAngle, float aEndAngle,
@ -81,11 +73,16 @@ void PathBuilderSkia::Arc(const Point& aOrigin, float aRadius,
aAntiClockwise);
}
Point PathBuilderSkia::CurrentPoint() const { return mCurrentPoint; }
Point PathBuilderSkia::CurrentPoint() const {
int pointCount = mPath.countPoints();
if (!pointCount) {
return Point(0, 0);
}
SkPoint point = mPath.getPoint(pointCount - 1);
return Point(SkScalarToFloat(point.fX), SkScalarToFloat(point.fY));
}
already_AddRefed<Path> PathBuilderSkia::Finish() {
mCurrentPoint = Point(0.0, 0.0);
mFirstPoint = Point(0.0, 0.0);
return MakeAndAddRef<PathSkia>(mPath, mFillRule);
}

View File

@ -42,8 +42,6 @@ class PathBuilderSkia : public PathBuilder {
void SetFillRule(FillRule aFillRule);
SkPath mPath;
Point mCurrentPoint;
Point mFirstPoint;
FillRule mFillRule;
};