diff options
author | 2012-08-20 17:24:16 +0000 | |
---|---|---|
committer | 2012-08-20 17:24:16 +0000 | |
commit | 17bb458fe897411218d8c9781770948d4398b723 (patch) | |
tree | d2396f5677b678aaac5d344d68bd4916677f3e05 /src | |
parent | b00a85b7f30c9c3dc549524205631b9f2f429cf8 (diff) |
Add fast path in arcTo and addArc for 0==sweep && 0|360==sweepAngle
http://codereview.appspot.com/6463071/
git-svn-id: http://skia.googlecode.com/svn/trunk@5190 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPath.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 674ba980f6..8184345a5b 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -933,6 +933,16 @@ void SkPath::addCircle(SkScalar x, SkScalar y, SkScalar r, Direction dir) { static int build_arc_points(const SkRect& oval, SkScalar startAngle, SkScalar sweepAngle, SkPoint pts[kSkBuildQuadArcStorage]) { + + if (0 == sweepAngle && + (0 == startAngle || SkIntToScalar(360) == startAngle)) { + // Chrome uses this path to move into and out of ovals. If not + // treated as a special case the moves can distort the oval's + // bounding box (and break the circle special case). + pts[0].set(oval.fRight, oval.centerY()); + return 1; + } + SkVector start, stop; start.fY = SkScalarSinCos(SkDegreesToRadians(startAngle), &start.fX); |