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

Side by Side Diff: include/core/SkPath.h

Issue 694503003: Implement conics for NVPR (Closed) Base URL: https://skia.googlesource.com/skia.git@hairline-test-fix-unskip-nvpr
Patch Set: cleanup Created 6 years, 1 month 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkPath_DEFINED 10 #ifndef SkPath_DEFINED
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 /** Returns the number of verbs in the path. Up to max verbs are copied. The 274 /** Returns the number of verbs in the path. Up to max verbs are copied. The
275 verbs are copied as one byte per verb. 275 verbs are copied as one byte per verb.
276 276
277 @param verbs If not null, receives up to max verbs 277 @param verbs If not null, receives up to max verbs
278 @param max The maximum number of verbs to copy into verbs 278 @param max The maximum number of verbs to copy into verbs
279 @return the actual number of verbs in the path 279 @return the actual number of verbs in the path
280 */ 280 */
281 int getVerbs(uint8_t verbs[], int max) const; 281 int getVerbs(uint8_t verbs[], int max) const;
282 282
283 /** Return the number of conic weights in the path
284 */
285 int countConicWeights() const;
reed1 2014/11/12 14:06:39 ick ich, do we really need to make these two apis
Kimmo Kinnunen 2014/11/19 16:25:39 Done.
286
287 /** Return the weight of index'th conic. If the index is out of range
288 (i.e. is not 0 <= index < countConicWeights()) then the returned weight
289 will be zero.
290 */
291 SkScalar getConicWeight(int index) const;
292
293
283 //! Swap contents of this and other. Guaranteed not to throw 294 //! Swap contents of this and other. Guaranteed not to throw
284 void swap(SkPath& other); 295 void swap(SkPath& other);
285 296
286 /** Returns the bounds of the path's points. If the path contains 0 or 1 297 /** Returns the bounds of the path's points. If the path contains 0 or 1
287 points, the bounds is set to (0,0,0,0), and isEmpty() will return true. 298 points, the bounds is set to (0,0,0,0), and isEmpty() will return true.
288 Note: this bounds may be larger than the actual shape, since curves 299 Note: this bounds may be larger than the actual shape, since curves
289 do not extend as far as their control points. 300 do not extend as far as their control points.
290 */ 301 */
291 const SkRect& getBounds() const { 302 const SkRect& getBounds() const {
292 return fPathRef->getBounds(); 303 return fPathRef->getBounds();
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 * Returns a mask, where each bit corresponding to a SegmentMask is 841 * Returns a mask, where each bit corresponding to a SegmentMask is
831 * set if the path contains 1 or more segments of that type. 842 * set if the path contains 1 or more segments of that type.
832 * Returns 0 for an empty path (no segments). 843 * Returns 0 for an empty path (no segments).
833 */ 844 */
834 uint32_t getSegmentMasks() const { return fPathRef->getSegmentMasks(); } 845 uint32_t getSegmentMasks() const { return fPathRef->getSegmentMasks(); }
835 846
836 enum Verb { 847 enum Verb {
837 kMove_Verb, //!< iter.next returns 1 point 848 kMove_Verb, //!< iter.next returns 1 point
838 kLine_Verb, //!< iter.next returns 2 points 849 kLine_Verb, //!< iter.next returns 2 points
839 kQuad_Verb, //!< iter.next returns 3 points 850 kQuad_Verb, //!< iter.next returns 3 points
840 kConic_Verb, //!< iter.next returns 3 points + iter.conicWeight() 851 kConic_Verb, //!< iter.next returns 2 points + iter.conicWeight()
841 kCubic_Verb, //!< iter.next returns 4 points 852 kCubic_Verb, //!< iter.next returns 4 points
842 kClose_Verb, //!< iter.next returns 1 point (contour's moveTo pt) 853 kClose_Verb, //!< iter.next returns 1 point (contour's moveTo pt)
843 kDone_Verb, //!< iter.next returns 0 points 854 kDone_Verb, //!< iter.next returns 0 points
844 }; 855 };
845 856
846 /** Iterate through all of the segments (lines, quadratics, cubics) of 857 /** Iterate through all of the segments (lines, quadratics, cubics) of
847 each contours in a path. 858 each contours in a path.
848 859
849 The iterator cleans up the segments along the way, removing degenerate 860 The iterator cleans up the segments along the way, removing degenerate
850 segments and adding close verbs where necessary. When the forceClose 861 segments and adding close verbs where necessary. When the forceClose
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 } 1071 }
1061 1072
1062 friend class SkAutoPathBoundsUpdate; 1073 friend class SkAutoPathBoundsUpdate;
1063 friend class SkAutoDisableOvalCheck; 1074 friend class SkAutoDisableOvalCheck;
1064 friend class SkAutoDisableDirectionCheck; 1075 friend class SkAutoDisableDirectionCheck;
1065 friend class SkBench_AddPathTest; // perf test reversePathTo 1076 friend class SkBench_AddPathTest; // perf test reversePathTo
1066 friend class PathTest_Private; // unit test reversePathTo 1077 friend class PathTest_Private; // unit test reversePathTo
1067 }; 1078 };
1068 1079
1069 #endif 1080 #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