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

Unified Diff: src/core/SkPath.cpp

Issue 1228383002: compute convexity for very small paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix path documentation Created 5 years, 5 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 | « include/core/SkPath.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 9381f48f3bf7952822725ab347fe8236d6dff7c8..05fc7305cefc183780baebc3467bfbf5a7b71c97 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1612,7 +1612,7 @@ const SkPoint& SkPath::Iter::cons_moveTo() {
}
}
-void SkPath::Iter::consumeDegenerateSegments() {
+void SkPath::Iter::consumeDegenerateSegments(bool exact) {
// We need to step over anything that will not move the current draw point
// forward before the next move is seen
const uint8_t* lastMoveVerb = 0;
@@ -1643,7 +1643,7 @@ void SkPath::Iter::consumeDegenerateSegments() {
break;
case kLine_Verb:
- if (!IsLineDegenerate(lastPt, fPts[0])) {
+ if (!IsLineDegenerate(lastPt, fPts[0], exact)) {
if (lastMoveVerb) {
fVerbs = lastMoveVerb;
fPts = lastMovePt;
@@ -1659,7 +1659,7 @@ void SkPath::Iter::consumeDegenerateSegments() {
case kConic_Verb:
case kQuad_Verb:
- if (!IsQuadDegenerate(lastPt, fPts[0], fPts[1])) {
+ if (!IsQuadDegenerate(lastPt, fPts[0], fPts[1], exact)) {
if (lastMoveVerb) {
fVerbs = lastMoveVerb;
fPts = lastMovePt;
@@ -1675,7 +1675,7 @@ void SkPath::Iter::consumeDegenerateSegments() {
break;
case kCubic_Verb:
- if (!IsCubicDegenerate(lastPt, fPts[0], fPts[1], fPts[2])) {
+ if (!IsCubicDegenerate(lastPt, fPts[0], fPts[1], fPts[2], exact)) {
if (lastMoveVerb) {
fVerbs = lastMoveVerb;
fPts = lastMovePt;
@@ -2116,7 +2116,7 @@ struct Convexicator {
SkScalar lengthSqd = vec.lengthSqd();
if (!SkScalarIsFinite(lengthSqd)) {
fIsFinite = false;
- } else if (!SkScalarNearlyZero(lengthSqd, SK_ScalarNearlyZero*SK_ScalarNearlyZero)) {
+ } else if (lengthSqd) {
fPriorPt = fLastPt;
fLastPt = fCurrPt;
fCurrPt = pt;
@@ -2253,7 +2253,7 @@ SkPath::Convexity SkPath::internalGetConvexity() const {
if (!isFinite()) {
return kUnknown_Convexity;
}
- while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
+ while ((verb = iter.next(pts, true, true)) != SkPath::kDone_Verb) {
switch (verb) {
case kMove_Verb:
if (++contourCount > 1) {
« no previous file with comments | « include/core/SkPath.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698