aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathUtils.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-06-10 14:23:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-10 14:23:15 -0700
commit026beb52a29a620290fcfb24f1e7e9e75547b80f (patch)
tree42e589685254a3026b21ec1e28f285e00f4cdbb4 /src/gpu/GrPathUtils.cpp
parentde50d9b94291589edf349e7a0f2aac6ac523de7b (diff)
SkPath::Direction serves two masters:
- input param to addFoo (e.g. addRect), where only CW or CCW are valid) - output param from computing functions, that sometimes return kUnknown This CL's intent is to split these into distinct enums/features: - Direction (public) loses kUnknown, and is only used for input - FirstDirection (private) is used for computing the first direction we see when analyzing a contour BUG=skia: Review URL: https://codereview.chromium.org/1176953002
Diffstat (limited to 'src/gpu/GrPathUtils.cpp')
-rw-r--r--src/gpu/GrPathUtils.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 3e2c3bfe66..21d115569b 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -365,16 +365,16 @@ bool is_point_within_cubic_tangents(const SkPoint& a,
const SkVector& ab,
const SkVector& dc,
const SkPoint& d,
- SkPath::Direction dir,
+ SkPathPriv::FirstDirection dir,
const SkPoint p) {
SkVector ap = p - a;
SkScalar apXab = ap.cross(ab);
- if (SkPath::kCW_Direction == dir) {
+ if (SkPathPriv::kCW_FirstDirection == dir) {
if (apXab > 0) {
return false;
}
} else {
- SkASSERT(SkPath::kCCW_Direction == dir);
+ SkASSERT(SkPathPriv::kCCW_FirstDirection == dir);
if (apXab < 0) {
return false;
}
@@ -382,12 +382,12 @@ bool is_point_within_cubic_tangents(const SkPoint& a,
SkVector dp = p - d;
SkScalar dpXdc = dp.cross(dc);
- if (SkPath::kCW_Direction == dir) {
+ if (SkPathPriv::kCW_FirstDirection == dir) {
if (dpXdc < 0) {
return false;
}
} else {
- SkASSERT(SkPath::kCCW_Direction == dir);
+ SkASSERT(SkPathPriv::kCCW_FirstDirection == dir);
if (dpXdc > 0) {
return false;
}
@@ -398,7 +398,7 @@ bool is_point_within_cubic_tangents(const SkPoint& a,
void convert_noninflect_cubic_to_quads(const SkPoint p[4],
SkScalar toleranceSqd,
bool constrainWithinTangents,
- SkPath::Direction dir,
+ SkPathPriv::FirstDirection dir,
SkTArray<SkPoint, true>* quads,
int sublevel = 0) {
@@ -546,7 +546,7 @@ void convert_noninflect_cubic_to_quads(const SkPoint p[4],
void GrPathUtils::convertCubicToQuads(const SkPoint p[4],
SkScalar tolScale,
bool constrainWithinTangents,
- SkPath::Direction dir,
+ SkPathPriv::FirstDirection dir,
SkTArray<SkPoint, true>* quads) {
SkPoint chopped[10];
int count = SkChopCubicAtInflections(p, chopped);