aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkStrokeRec.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-04-29 07:07:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 07:07:03 -0700
commit5668648e875abe0a064caabef432ade4745deb89 (patch)
treef1fda3f7ff71ddd1d5f963247c549690ae807149 /include/core/SkStrokeRec.h
parent24e912869499352e8947d3943acb43edd7ffded6 (diff)
Unify implementations of stroking radius calculationsns
Diffstat (limited to 'include/core/SkStrokeRec.h')
-rw-r--r--include/core/SkStrokeRec.h16
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.