diff options
author | bsalomon <bsalomon@google.com> | 2016-04-29 07:07:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-29 07:07:03 -0700 |
commit | 5668648e875abe0a064caabef432ade4745deb89 (patch) | |
tree | f1fda3f7ff71ddd1d5f963247c549690ae807149 /include/core/SkStrokeRec.h | |
parent | 24e912869499352e8947d3943acb43edd7ffded6 (diff) |
Unify implementations of stroking radius calculationsns
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1928133002
Review-Url: https://codereview.chromium.org/1928133002
Diffstat (limited to 'include/core/SkStrokeRec.h')
-rw-r--r-- | include/core/SkStrokeRec.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/core/SkStrokeRec.h b/include/core/SkStrokeRec.h index 22981a5d9e..9a49a3da7d 100644 --- a/include/core/SkStrokeRec.h +++ b/include/core/SkStrokeRec.h @@ -99,6 +99,22 @@ public: void applyToPaint(SkPaint* paint) const; /** + * Gives a conservative value for the outset that should applied to a + * geometries bounds to account for any inflation due to applying this + * strokeRec to the geometry. + */ + SkScalar getInflationRadius() const; + + /** + * Equivalent to: + * SkStrokeRec rec(paint, style); + * rec.getInflationRadius(); + * This does not account for other effects on the paint (i.e. path + * effect). + */ + static SkScalar GetInflationRadius(const SkPaint&, SkPaint::Style); + + /** * Compare if two SkStrokeRecs have an equal effect on a path. * Equal SkStrokeRecs produce equal paths. Equality of produced * paths does not take the ResScale parameter into account. |