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

Unified Diff: src/core/SkGeometry.h

Issue 892703002: use conics for arcTo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix the legacy code-path for chrome Created 5 years, 10 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 | « no previous file | src/core/SkGeometry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGeometry.h
diff --git a/src/core/SkGeometry.h b/src/core/SkGeometry.h
index b14a2ddb986ad8c62b5bbb80cd25d3dbec5a54bb..ad4bffcb621d2f977c6e118ac3dc05efc8f64ab8 100644
--- a/src/core/SkGeometry.h
+++ b/src/core/SkGeometry.h
@@ -226,7 +226,6 @@ enum SkRotationDirection {
int SkBuildQuadArc(const SkVector& unitStart, const SkVector& unitStop,
SkRotationDirection, const SkMatrix*, SkPoint quadPoints[]);
-// experimental
struct SkConic {
SkConic() {}
SkConic(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w) {
@@ -248,6 +247,13 @@ struct SkConic {
fW = w;
}
+ void set(const SkPoint& p0, const SkPoint& p1, const SkPoint& p2, SkScalar w) {
+ fPts[0] = p0;
+ fPts[1] = p1;
+ fPts[2] = p2;
+ fW = w;
+ }
+
/**
* Given a t-value [0...1] return its position and/or tangent.
* If pos is not null, return its position at the t-value.
@@ -292,6 +298,12 @@ struct SkConic {
bool findMaxCurvature(SkScalar* t) const;
static SkScalar TransformW(const SkPoint[3], SkScalar w, const SkMatrix&);
+
+ enum {
+ kMaxConicsForArc = 5
+ };
+ static int BuildUnitArc(const SkVector& start, const SkVector& stop, SkRotationDirection,
+ const SkMatrix*, SkConic conics[kMaxConicsForArc]);
};
#include "SkTemplates.h"
« no previous file with comments | « no previous file | src/core/SkGeometry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698