Chromium Code Reviews| Index: include/core/SkPathEffect.h |
| diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h |
| index 86ccf86a9223eedb59dfb7361102bfb067177868..25175d5d5aaf40e37c1e81740deead9a6502170c 100644 |
| --- a/include/core/SkPathEffect.h |
| +++ b/include/core/SkPathEffect.h |
| @@ -104,6 +104,37 @@ public: |
| const SkStrokeRec&, const SkMatrix&, |
| const SkRect* cullR) const; |
| + /** |
|
bsalomon
2014/03/28 14:57:22
Maybe I'm alone in this but I'd feel better about
|
| + * If the PathEffect is a DashedPathEffect asADash will return kDash_DashType and None |
| + * otherwise. If a non NULL info is passed in the various DashInfo will be filled |
| + * in if the PathEffect is a DashedPathEffect. If passed in info has an fCount equal or |
| + * greater to that of the effect, it will memcpy the values of fIntervals into the info. |
| + * Thus the general approach will be call asADash once with default info to get DashType |
| + * and fCount. If it is a DashPathEffect, allocate space for the intervals in info, then call |
| + * asAGradient again with the same info and fIntervals will get copied in. |
|
bsalomon
2014/03/28 14:57:22
asAGradient -> asADash
|
| + * |
| + * None: |
|
reed1
2014/03/28 14:52:53
This part of the dox could be attached/associated
|
| + * info is ignored. |
| + * Dash: |
| + * uses all info. |
| + */ |
| + |
| + enum DashType { |
| + kNone_DashType, |
| + kDash_DashType, |
| + }; |
| + |
| + struct DashInfo { |
| + SkScalar* fIntervals; //!< Length of on/off intervals for dashed lines |
| + // Even values represent ons, and odds offs |
| + int32_t fCount; //!< Number of intervals in the dash. Should be even number |
| + SkScalar fPhase; //!< Offset into the dashed interval pattern |
| + // mod the sum of all intervals |
| + bool fScaleToFit; |
|
bsalomon
2014/03/28 14:57:22
Of all the fields, this one needs a comment :) I'm
|
| + }; |
| + |
| + virtual DashType asADash(DashInfo* info) const; |
| + |
| SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect) |
| protected: |