Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: include/effects/SkEmbossMaskFilter.h

Issue 173633003: Factory methods for heap-allocated SkMaskFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/effects/SkEmbossMaskFilter.h
diff --git a/include/effects/SkEmbossMaskFilter.h b/include/effects/SkEmbossMaskFilter.h
index 263c5e054509cb16007767be48c0d45d4cba0968..cc0004dc49ecf00c990c64baa6c432f83791d999 100644
--- a/include/effects/SkEmbossMaskFilter.h
+++ b/include/effects/SkEmbossMaskFilter.h
@@ -23,10 +23,14 @@ public:
uint8_t fSpecular; // exponent, 4.4 right now
};
- SkEmbossMaskFilter(SkScalar blurSigma, const Light& light);
+ static SkEmbossMaskFilter* Create(SkScalar blurSigma, const Light& light) {
+ return SkNEW_ARGS(SkEmbossMaskFilter, (blurSigma, light));
+ }
SK_ATTR_DEPRECATED("use sigma version")
- SkEmbossMaskFilter(const Light& light, SkScalar blurRadius);
+ static SkEmbossMaskFilter* Create(const Light& light, SkScalar blurRadius) {
scroggo 2014/02/20 14:17:07 No need to create a factory for the deprecated con
Dominik Grewe 2014/02/20 16:38:11 Done.
+ return SkNEW_ARGS(SkEmbossMaskFilter, (light, blurRadius));
+ }
// overrides from SkMaskFilter
// This method is not exported to java.
@@ -42,6 +46,12 @@ protected:
SkEmbossMaskFilter(SkReadBuffer&);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkEmbossMaskFilter(SkScalar blurSigma, const Light& light);
+ SkEmbossMaskFilter(const Light& light, SkScalar blurRadius);
scroggo 2014/02/20 14:17:07 This constructor can be removed entirely (once you
Dominik Grewe 2014/02/20 16:38:11 Done.
+
private:
Light fLight;
SkScalar fBlurSigma;

Powered by Google App Engine
This is Rietveld 408576698