aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-04-04 10:02:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-04 10:02:58 -0700
commitefdfd51b68a300d5c6e28743fe0344ca05d1cec9 (patch)
tree3cd04d31a56219559e89f6eded6f7a894eb700ba /include/effects
parent175cf0e51b9fbb075588c4d29e7e4257cea6f4ad (diff)
switch maskfilters to sk_sp
Diffstat (limited to 'include/effects')
-rw-r--r--include/effects/SkBlurDrawLooper.h4
-rw-r--r--include/effects/SkBlurMaskFilter.h16
-rw-r--r--include/effects/SkEmbossMaskFilter.h8
3 files changed, 21 insertions, 7 deletions
diff --git a/include/effects/SkBlurDrawLooper.h b/include/effects/SkBlurDrawLooper.h
index 49b0c51f25..9b87683f04 100644
--- a/include/effects/SkBlurDrawLooper.h
+++ b/include/effects/SkBlurDrawLooper.h
@@ -46,8 +46,6 @@ public:
}
#endif
- virtual ~SkBlurDrawLooper();
-
SkDrawLooper::Context* createContext(SkCanvas*, void* storage) const override;
size_t contextSize() const override { return sizeof(BlurDrawLooperContext); }
@@ -64,7 +62,7 @@ protected:
bool asABlurShadow(BlurShadowRec*) const override;
private:
- SkMaskFilter* fBlur;
+ sk_sp<SkMaskFilter> fBlur;
sk_sp<SkColorFilter> fColorFilter;
SkScalar fDx, fDy, fSigma;
SkColor fBlurColor;
diff --git a/include/effects/SkBlurMaskFilter.h b/include/effects/SkBlurMaskFilter.h
index 356475ed4c..3ba91774f0 100644
--- a/include/effects/SkBlurMaskFilter.h
+++ b/include/effects/SkBlurMaskFilter.h
@@ -37,7 +37,8 @@ public:
* @param flags Flags to use - defaults to none
* @return The new blur maskfilter
*/
- static SkMaskFilter* Create(SkBlurStyle style, SkScalar sigma, uint32_t flags = kNone_BlurFlag);
+ static sk_sp<SkMaskFilter> Make(SkBlurStyle style, SkScalar sigma,
+ uint32_t flags = kNone_BlurFlag);
/** Create an emboss maskfilter
@param blurSigma standard deviation of the Gaussian blur to apply
@@ -47,13 +48,22 @@ public:
@param specular coefficient for specular highlights (e.g. 8)
@return the emboss maskfilter
*/
- static SkMaskFilter* CreateEmboss(SkScalar blurSigma, const SkScalar direction[3],
- SkScalar ambient, SkScalar specular);
+ static sk_sp<SkMaskFilter> MakeEmboss(SkScalar blurSigma, const SkScalar direction[3],
+ SkScalar ambient, SkScalar specular);
+#ifdef SK_SUPPORT_LEGACY_MASKFILTER_PTR
+ static SkMaskFilter* Create(SkBlurStyle style, SkScalar sigma, uint32_t flags = kNone_BlurFlag){
+ return Make(style, sigma, flags).release();
+ }
+ static SkMaskFilter* CreateEmboss(SkScalar blurSigma, const SkScalar direction[3],
+ SkScalar ambient, SkScalar specular) {
+ return MakeEmboss(blurSigma, direction, ambient, specular).release();
+ }
SK_ATTR_DEPRECATED("use sigma version")
static SkMaskFilter* CreateEmboss(const SkScalar direction[3],
SkScalar ambient, SkScalar specular,
SkScalar blurRadius);
+#endif
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
diff --git a/include/effects/SkEmbossMaskFilter.h b/include/effects/SkEmbossMaskFilter.h
index 72020bf3ce..8a34282451 100644
--- a/include/effects/SkEmbossMaskFilter.h
+++ b/include/effects/SkEmbossMaskFilter.h
@@ -23,7 +23,13 @@ public:
uint8_t fSpecular; // exponent, 4.4 right now
};
- static SkMaskFilter* Create(SkScalar blurSigma, const Light& light);
+ static sk_sp<SkMaskFilter> Make(SkScalar blurSigma, const Light& light);
+
+#ifdef SK_SUPPORT_LEGACY_MASKFILTER_PTR
+ static SkMaskFilter* Create(SkScalar blurSigma, const Light& light) {
+ return Make(blurSigma, light).release();
+ }
+#endif
// overrides from SkMaskFilter
// This method is not exported to java.