Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: src/utils/SkParsePath.cpp

Issue 1613303002: Add svg path arcto (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use enums for arcto's sweep and largeArc params Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkParsePath.cpp
diff --git a/src/utils/SkParsePath.cpp b/src/utils/SkParsePath.cpp
index 3eb9e1ef798e26abfcbe6c87345e75592919a712..c0f39aa06fd74b93d4989234472ea4c7496211cf 100644
--- a/src/utils/SkParsePath.cpp
+++ b/src/utils/SkParsePath.cpp
@@ -64,6 +64,7 @@ static const char* find_scalar(const char str[], SkScalar* value,
if (isRelative) {
*value += relative;
}
+ str = skip_sep(str);
return str;
}
@@ -156,6 +157,17 @@ bool SkParsePath::FromSVGString(const char data[], SkPath* result) {
lastc = points[0];
c = points[1];
break;
+ case 'A': {
+ SkPoint radii;
+ data = find_points(data, &radii, 1, false, nullptr);
+ SkScalar angle, largeArc, sweep;
+ data = find_scalar(data, &angle, false, 0);
+ data = find_scalar(data, &largeArc, false, 0);
+ data = find_scalar(data, &sweep, false, 0);
+ data = find_points(data, &points[0], 1, relative, &c);
+ path.arcTo(radii, angle, (SkPath::ArcSize) SkToBool(largeArc),
+ (SkPath::Direction) !SkToBool(sweep), points[0]);
+ } break;
case 'Z':
path.close();
#if 0 // !!! still a bug?
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698