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

Unified Diff: src/core/SkPathIter.cpp

Issue 1126993003: experimental path-builder Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/SkPathBuilder.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPathIter.cpp
diff --git a/src/core/SkPathIter.cpp b/src/core/SkPathIter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ecbab92a8190031dc3311b89a91797a1fb8d87d8
--- /dev/null
+++ b/src/core/SkPathIter.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkPathIter.h"
+
+bool SkPathIter::next() {
+ if (fStopVerbs == fVerbs) {
+ return false;
+ }
+
+#if 0
+ const uint8_t gPtsPerVerb[] = {
+ 1, // Move
+ 1, // Line
+ 2, // Quad
+ 2, // Conic
+ 3, // Cubic
+ 0, // Close
+ };
+#endif
+
+ fCurrPts += fPrevPtsPerVerb;
+ SkPathVerb verb = (SkPathVerb)(*--fVerbs);
+#if 0
+ fPrevPtsPerVerb = gPtsPerVerb[verb];
+#elif 0
+ fPrevPtsPerVerb = ((verb >> 1) + 1) & -(kClose_SkPathVerb == verb);
+#else
+ fPrevPtsPerVerb = (verb >> 4) & 7;
+#endif
+ fNextPts += fPrevPtsPerVerb;
+ fConicW += (verb >> 7);//(kConic_SkPathVerb == verb);
+ return true;
+}
+
« no previous file with comments | « src/core/SkPathBuilder.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698