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

Unified Diff: src/core/SkStroke.cpp

Issue 1176953002: move SkPath direction-as-computed into SkPathPriv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
Index: src/core/SkStroke.cpp
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp
index 22963159158a0a9e5152304604d4c34b7e7c898b..86c0571c4b8fd618827999a5ec07513affc3a332 100644
--- a/src/core/SkStroke.cpp
+++ b/src/core/SkStroke.cpp
@@ -7,7 +7,7 @@
#include "SkStrokerPriv.h"
#include "SkGeometry.h"
-#include "SkPath.h"
+#include "SkPathPriv.h"
enum {
kTangent_RecursiveLimit,
@@ -1344,7 +1344,7 @@ DONE:
stroker.done(dst, lastSegment == SkPath::kLine_Verb);
if (fDoFill) {
- if (src.cheapIsDirection(SkPath::kCCW_Direction)) {
+ if (SkPathPriv::CheapIsFirstDirection(src, SkPathPriv::kCCW_FirstDirection)) {
dst->reverseAddPath(src);
} else {
dst->addPath(src);
@@ -1379,8 +1379,8 @@ DONE:
}
static SkPath::Direction reverse_direction(SkPath::Direction dir) {
- SkASSERT(SkPath::kUnknown_Direction != dir);
- return SkPath::kCW_Direction == dir ? SkPath::kCCW_Direction : SkPath::kCW_Direction;
+ static const SkPath::Direction gOpposite[] = { SkPath::kCCW_Direction, SkPath::kCW_Direction };
+ return gOpposite[dir];
}
static void addBevel(SkPath* path, const SkRect& r, const SkRect& outer, SkPath::Direction dir) {

Powered by Google App Engine
This is Rietveld 408576698