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 /src/effects | |
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 'src/effects')
-rw-r--r-- | src/effects/SkBlurMaskFilter.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 41e04b8a53..c53e04a1f5 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -27,11 +27,10 @@ public: // overrides from SkMaskFilter virtual SkMask::Format getFormat(); virtual bool filterMask(SkMask* dst, const SkMask& src, const SkMatrix& matrix, SkIPoint* margin); + virtual BlurType asABlur(BlurInfo*); // overrides from SkFlattenable - // This method is not exported to java. virtual Factory getFactory(); - // This method is not exported to java. virtual void flatten(SkFlattenableWriteBuffer&); static SkFlattenable* CreateProc(SkFlattenableReadBuffer&); @@ -138,6 +137,22 @@ void SkBlurMaskFilterImpl::flatten(SkFlattenableWriteBuffer& buffer) buffer.write32(fBlurFlags); } +static const SkMaskFilter::BlurType gBlurStyle2BlurType[] = { + SkMaskFilter::kNormal_BlurType, + SkMaskFilter::kSolid_BlurType, + SkMaskFilter::kOuter_BlurType, + SkMaskFilter::kInner_BlurType, +}; + +SkMaskFilter::BlurType SkBlurMaskFilterImpl::asABlur(BlurInfo* info) { + if (info) { + info->fRadius = fRadius; + info->fIgnoreTransform = SkToBool(fBlurFlags & SkBlurMaskFilter::kIgnoreTransform_BlurFlag); + info->fHighQuality = SkToBool(fBlurFlags & SkBlurMaskFilter::kHighQuality_BlurFlag); + } + return gBlurStyle2BlurType[fBlurStyle]; +} + /////////////////////////////////////////////////////////////////////////////// static SkFlattenable::Registrar gReg("SkBlurMaskFilter", |