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

Unified Diff: include/effects/SkDropShadowImageFilter.h

Issue 182983003: Factory methods for heap-allocated SkImageFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 6 years, 9 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
« no previous file with comments | « include/effects/SkDisplacementMapEffect.h ('k') | include/effects/SkMagnifierImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkDropShadowImageFilter.h
diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h
index aba2017eef6d61f648ece238e97de36958e052c0..58043862941e84f5a20a1261fe6995e10a0a8c03 100644
--- a/include/effects/SkDropShadowImageFilter.h
+++ b/include/effects/SkDropShadowImageFilter.h
@@ -11,8 +11,17 @@
class SK_API SkDropShadowImageFilter : public SkImageFilter {
public:
- SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigma, SkColor, SkImageFilter* input = NULL);
- SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor, SkImageFilter* input = NULL, const CropRect* cropRect = NULL);
+ static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy, SkScalar sigma,
+ SkColor color, SkImageFilter* input = NULL) {
+ return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigma, color, input));
+ }
+ static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy,
+ SkScalar sigmaX, SkScalar sigmaY, SkColor color,
+ SkImageFilter* input = NULL,
+ const CropRect* cropRect = NULL) {
+ return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY,
+ color, input, cropRect));
+ }
virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDropShadowImageFilter)
@@ -23,7 +32,13 @@ protected:
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
SkIRect* dst) const SK_OVERRIDE;
-
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigma, SkColor,
+ SkImageFilter* input = NULL);
+ SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor,
+ SkImageFilter* input = NULL, const CropRect* cropRect = NULL);
private:
SkScalar fDx, fDy, fSigmaX, fSigmaY;
« no previous file with comments | « include/effects/SkDisplacementMapEffect.h ('k') | include/effects/SkMagnifierImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698