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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/core/SkPathRef.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPath_DEFINED 8 #ifndef SkPath_DEFINED
9 #define SkPath_DEFINED 9 #define SkPath_DEFINED
10 10
(...skipping 19 matching lines...) Expand all
30 SkPath(); 30 SkPath();
31 SkPath(const SkPath&); 31 SkPath(const SkPath&);
32 ~SkPath(); 32 ~SkPath();
33 33
34 SkPath& operator=(const SkPath&); 34 SkPath& operator=(const SkPath&);
35 friend SK_API bool operator==(const SkPath&, const SkPath&); 35 friend SK_API bool operator==(const SkPath&, const SkPath&);
36 friend bool operator!=(const SkPath& a, const SkPath& b) { 36 friend bool operator!=(const SkPath& a, const SkPath& b) {
37 return !(a == b); 37 return !(a == b);
38 } 38 }
39 39
40 /** Return true if the paths contain an equal array of verbs and weights. Pa ths
41 * with equal verb counts can be readily interpolated. If the paths contain one
42 * or more conics, the conics' weights must also match.
43 *
44 * @param compare The path to compare.
45 *
46 * @return true if the paths have the same verbs and weights.
47 */
48 bool isInterpolatable(const SkPath& compare) const;
49
50 /** Interpolate between two paths with same-sized point arrays.
51 * The out path contains the verbs and weights of this path.
52 * The out points are a weighted average of this path and the ending path.
53 *
54 * @param ending The path to interpolate between.
55 * @param weight The weight, from 0 to 1. The output points are set to
56 * (this->points * weight) + ending->points * (1 - weight).
57 * @return true if the paths could be interpolated.
58 */
59 bool interpolate(const SkPath& ending, SkScalar weight, SkPath* out) const;
60
40 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK 61 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
41 /** Returns true if the caller is the only owner of the underlying path data */ 62 /** Returns true if the caller is the only owner of the underlying path data */
42 bool unique() const { return fPathRef->unique(); } 63 bool unique() const { return fPathRef->unique(); }
43 #endif 64 #endif
44 65
45 enum FillType { 66 enum FillType {
46 /** Specifies that "inside" is computed by a non-zero sum of signed 67 /** Specifies that "inside" is computed by a non-zero sum of signed
47 edge crossings 68 edge crossings
48 */ 69 */
49 kWinding_FillType, 70 kWinding_FillType,
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1164
1144 friend class SkAutoPathBoundsUpdate; 1165 friend class SkAutoPathBoundsUpdate;
1145 friend class SkAutoDisableOvalCheck; 1166 friend class SkAutoDisableOvalCheck;
1146 friend class SkAutoDisableDirectionCheck; 1167 friend class SkAutoDisableDirectionCheck;
1147 friend class SkBench_AddPathTest; // perf test reversePathTo 1168 friend class SkBench_AddPathTest; // perf test reversePathTo
1148 friend class PathTest_Private; // unit test reversePathTo 1169 friend class PathTest_Private; // unit test reversePathTo
1149 friend class ForceIsRRect_Private; // unit test isRRect 1170 friend class ForceIsRRect_Private; // unit test isRRect
1150 }; 1171 };
1151 1172
1152 #endif 1173 #endif
OLDNEW
« 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