diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-07 13:43:38 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-07 13:43:38 +0000 |
commit | 2b75f4279a237ceea929ff8ac019f7fbd3ad08b5 (patch) | |
tree | f02fe79694898b528571016bc460a5aff3dd5dd7 /include | |
parent | 9c49bc3e643c435677727c1c0904c4a7cb7a6907 (diff) |
add asABlur() to maskfilters, so devices like gpu and pdf can query them.
git-svn-id: http://skia.googlecode.com/svn/trunk@1816 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkMaskFilter.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h index 641ad83886..84a8fd0c3a 100644 --- a/include/core/SkMaskFilter.h +++ b/include/core/SkMaskFilter.h @@ -72,6 +72,28 @@ public: virtual void flatten(SkFlattenableWriteBuffer& ) {} + enum BlurType { + kNone_BlurType, //!< this maskfilter is not a blur + kNormal_BlurType, //!< fuzzy inside and outside + kSolid_BlurType, //!< solid inside, fuzzy outside + kOuter_BlurType, //!< nothing inside, fuzzy outside + kInner_BlurType, //!< fuzzy inside, nothing outside + }; + + struct BlurInfo { + SkScalar fRadius; + bool fIgnoreTransform; + bool fHighQuality; + }; + + /** + * Optional method for maskfilters that can be described as a blur. If so, + * they return the corresponding BlurType and set the fields in BlurInfo + * (if not null). If they cannot be described as a blur, they return + * kNone_BlurType and ignore the info parameter. + */ + virtual BlurType asABlur(BlurInfo*); + protected: // empty for now, but lets get our subclass to remember to init us for the future SkMaskFilter(SkFlattenableReadBuffer&) {} |