Index: src/effects/SkBlurMaskFilter.cpp |
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp |
index 2bed2fe8d6e3ee1d3d2ccf48bf2c5af0083bd03d..5dffd6fd1f1d571eb6b2fac407eebd6cba8a5684 100644 |
--- a/src/effects/SkBlurMaskFilter.cpp |
+++ b/src/effects/SkBlurMaskFilter.cpp |
@@ -59,6 +59,7 @@ public: |
#endif |
virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; |
+ virtual bool asABlur(BlurRec*) const SK_OVERRIDE; |
SK_TO_STRING_OVERRIDE() |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlurMaskFilterImpl) |
@@ -87,6 +88,11 @@ private: |
SkBlurStyle fBlurStyle; |
uint32_t fBlurFlags; |
+ SkBlurQuality getQuality() const { |
+ return (fBlurFlags & SkBlurMaskFilter::kHighQuality_BlurFlag) ? |
+ kHigh_SkBlurQuality : kLow_SkBlurQuality; |
+ } |
+ |
SkBlurMaskFilterImpl(SkReadBuffer&); |
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
@@ -145,16 +151,24 @@ SkMask::Format SkBlurMaskFilterImpl::getFormat() const { |
return SkMask::kA8_Format; |
} |
+bool SkBlurMaskFilterImpl::asABlur(BlurRec* rec) const { |
+ if (fBlurFlags & SkBlurMaskFilter::kIgnoreTransform_BlurFlag) { |
+ return false; |
+ } |
+ |
+ if (rec) { |
+ rec->fSigma = fSigma; |
+ rec->fStyle = fBlurStyle; |
+ rec->fQuality = this->getQuality(); |
+ } |
+ return true; |
+} |
+ |
bool SkBlurMaskFilterImpl::filterMask(SkMask* dst, const SkMask& src, |
const SkMatrix& matrix, |
SkIPoint* margin) const{ |
SkScalar sigma = this->computeXformedSigma(matrix); |
- |
- SkBlurQuality blurQuality = |
- (fBlurFlags & SkBlurMaskFilter::kHighQuality_BlurFlag) ? |
- kHigh_SkBlurQuality : kLow_SkBlurQuality; |
- |
- return SkBlurMask::BoxBlur(dst, src, sigma, fBlurStyle, blurQuality, margin); |
+ return SkBlurMask::BoxBlur(dst, src, sigma, fBlurStyle, this->getQuality(), margin); |
} |
bool SkBlurMaskFilterImpl::filterRectMask(SkMask* dst, const SkRect& r, |