From daaafa6e81860e3dc52660ba019c336f0a43f1e7 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Tue, 29 Apr 2014 15:20:16 +0000 Subject: add asAShadowBlur for android to drawlooper BUG=skia: R=djsollen@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/253633003 git-svn-id: http://skia.googlecode.com/svn/trunk@14431 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/effects/SkBlurDrawLooper.h | 5 ++++- include/effects/SkEmbossMaskFilter.h | 4 +--- include/effects/SkLayerDrawLooper.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'include/effects') diff --git a/include/effects/SkBlurDrawLooper.h b/include/effects/SkBlurDrawLooper.h index fe945c3801..75ed80e679 100644 --- a/include/effects/SkBlurDrawLooper.h +++ b/include/effects/SkBlurDrawLooper.h @@ -61,10 +61,12 @@ protected: SkBlurDrawLooper(SkReadBuffer&); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; + virtual bool asABlurShadow(BlurShadowRec*) const SK_OVERRIDE; + private: SkMaskFilter* fBlur; SkColorFilter* fColorFilter; - SkScalar fDx, fDy; + SkScalar fDx, fDy, fSigma; SkColor fBlurColor; uint32_t fBlurFlags; @@ -86,6 +88,7 @@ private: }; void init(SkScalar sigma, SkScalar dx, SkScalar dy, SkColor color, uint32_t flags); + void initEffects(); typedef SkDrawLooper INHERITED; }; diff --git a/include/effects/SkEmbossMaskFilter.h b/include/effects/SkEmbossMaskFilter.h index eb8f8117a4..65dbbe7a59 100644 --- a/include/effects/SkEmbossMaskFilter.h +++ b/include/effects/SkEmbossMaskFilter.h @@ -23,9 +23,7 @@ public: uint8_t fSpecular; // exponent, 4.4 right now }; - static SkEmbossMaskFilter* Create(SkScalar blurSigma, const Light& light) { - return SkNEW_ARGS(SkEmbossMaskFilter, (blurSigma, light)); - } + static SkEmbossMaskFilter* Create(SkScalar blurSigma, const Light& light); // overrides from SkMaskFilter // This method is not exported to java. diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h index fe660a8aae..ac56e288dc 100644 --- a/include/effects/SkLayerDrawLooper.h +++ b/include/effects/SkLayerDrawLooper.h @@ -77,6 +77,8 @@ public: virtual size_t contextSize() const SK_OVERRIDE { return sizeof(LayerDrawLooperContext); } + virtual bool asABlurShadow(BlurShadowRec* rec) const SK_OVERRIDE; + SK_TO_STRING_OVERRIDE() /// Implements Flattenable. -- cgit v1.2.3