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

Unified Diff: include/core/SkPath.h

Issue 1703943003: add interp path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add test to error if conics don't match Created 4 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 | include/core/SkPathRef.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPath.h
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 7c6fd35d5af8798c74e499644b606c435081d40f..c0095bbe6e8f152409b8b34a4df2bb6be295945c 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -37,6 +37,27 @@ public:
return !(a == b);
}
+ /** Return true if the paths contain an equal array of verbs and weights. Paths
+ * with equal verb counts can be readily interpolated. If the paths contain one
+ * or more conics, the conics' weights must also match.
+ *
+ * @param compare The path to compare.
+ *
+ * @return true if the paths have the same verbs and weights.
+ */
+ bool isInterpolatable(const SkPath& compare) const;
+
+ /** Interpolate between two paths with same-sized point arrays.
+ * The out path contains the verbs and weights of this path.
+ * The out points are a weighted average of this path and the ending path.
+ *
+ * @param ending The path to interpolate between.
+ * @param weight The weight, from 0 to 1. The output points are set to
+ * (this->points * weight) + ending->points * (1 - weight).
+ * @return true if the paths could be interpolated.
+ */
+ bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const;
+
#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
/** Returns true if the caller is the only owner of the underlying path data */
bool unique() const { return fPathRef->unique(); }
« no previous file with comments | « no previous file | include/core/SkPathRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698