diff options
author | 2017-02-03 11:34:13 -0500 | |
---|---|---|
committer | 2017-02-03 17:26:43 +0000 | |
commit | 8d3196bdfcf478982bec9885d21e1d664ab9a72b (patch) | |
tree | 565d17927c9bb022cdb7bf10108bf7fc52b7a5db /include | |
parent | 20f00784b8500ccb68f0e402eeccd9bbf2707040 (diff) |
expose new tight-bounds method on SkPath
BUG=skia:
Change-Id: Ie50df49c1758af203042a84dc2cd505046373d2c
Reviewed-on: https://skia-review.googlesource.com/7996
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPath.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 486a993231..8bdfbc48b8 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -358,6 +358,19 @@ public: } /** + * Computes a bounds that is conservatively "snug" around the path. This assumes that the + * path will be filled. It does not attempt to collapse away contours that are logically + * empty (e.g. moveTo(x, y) + lineTo(x, y)) but will include them in the calculation. + * + * It differs from getBounds() in that it will look at the snug bounds of curves, whereas + * getBounds() just returns the bounds of the control-points. Thus computing this may be + * slower than just calling getBounds(). + * + * If the path is empty (i.e. no points or verbs), it will return SkRect::MakeEmpty(). + */ + SkRect computeTightBounds() const; + + /** * Does a conservative test to see whether a rectangle is inside a path. Currently it only * will ever return true for single convex contour paths. The empty-status of the rect is not * considered (e.g. a rect that is a point can be inside a path). Points or line segments where |