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

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

Issue 1261773002: change getBounds to return 0000 iff there are zero points (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 @param verbs If not null, receives up to max verbs 267 @param verbs If not null, receives up to max verbs
268 @param max The maximum number of verbs to copy into verbs 268 @param max The maximum number of verbs to copy into verbs
269 @return the actual number of verbs in the path 269 @return the actual number of verbs in the path
270 */ 270 */
271 int getVerbs(uint8_t verbs[], int max) const; 271 int getVerbs(uint8_t verbs[], int max) const;
272 272
273 //! Swap contents of this and other. Guaranteed not to throw 273 //! Swap contents of this and other. Guaranteed not to throw
274 void swap(SkPath& other); 274 void swap(SkPath& other);
275 275
276 /** Returns the bounds of the path's points. If the path contains 0 or 1 276 /**
277 points, the bounds is set to (0,0,0,0), and isEmpty() will return true. 277 * Returns the bounds of the path's points. If the path contains zero point s/verbs, this
278 Note: this bounds may be larger than the actual shape, since curves 278 * will return the "empty" rect [0, 0, 0, 0].
279 do not extend as far as their control points. Additionally this bound 279 * Note: this bounds may be larger than the actual shape, since curves
280 can contain trailing MoveTo points (cf. isRect). 280 * do not extend as far as their control points. Additionally this bound en compases all points,
281 * even isolated moveTos either preceeding or following the last non-degene rate contour.
281 */ 282 */
282 const SkRect& getBounds() const { 283 const SkRect& getBounds() const {
283 return fPathRef->getBounds(); 284 return fPathRef->getBounds();
284 } 285 }
285 286
286 /** Calling this will, if the internal cache of the bounds is out of date, 287 /** Calling this will, if the internal cache of the bounds is out of date,
287 update it so that subsequent calls to getBounds will be instantaneous. 288 update it so that subsequent calls to getBounds will be instantaneous.
288 This also means that any copies or simple transformations of the path 289 This also means that any copies or simple transformations of the path
289 will inherit the cached bounds. 290 will inherit the cached bounds.
290 */ 291 */
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 void setPt(int index, SkScalar x, SkScalar y); 1002 void setPt(int index, SkScalar x, SkScalar y);
1002 1003
1003 friend class SkAutoPathBoundsUpdate; 1004 friend class SkAutoPathBoundsUpdate;
1004 friend class SkAutoDisableOvalCheck; 1005 friend class SkAutoDisableOvalCheck;
1005 friend class SkAutoDisableDirectionCheck; 1006 friend class SkAutoDisableDirectionCheck;
1006 friend class SkBench_AddPathTest; // perf test reversePathTo 1007 friend class SkBench_AddPathTest; // perf test reversePathTo
1007 friend class PathTest_Private; // unit test reversePathTo 1008 friend class PathTest_Private; // unit test reversePathTo
1008 }; 1009 };
1009 1010
1010 #endif 1011 #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