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

Unified Diff: include/effects/SkDisplacementMapEffect.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/SkComposeImageFilter.h ('k') | include/effects/SkDropShadowImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkDisplacementMapEffect.h
diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h
index 5de4814951a6afb0f299ed90a1db9bf24b8e3e5c..59549dc7184dd3fd9bfdfb2e1244f6d6cabfb6ff 100644
--- a/include/effects/SkDisplacementMapEffect.h
+++ b/include/effects/SkDisplacementMapEffect.h
@@ -18,18 +18,20 @@ public:
kR_ChannelSelectorType,
kG_ChannelSelectorType,
kB_ChannelSelectorType,
- kA_ChannelSelectorType,
- kKeyBits = 3 // Max value is 4, so 3 bits are required at most
+ kA_ChannelSelectorType
};
- SkDisplacementMapEffect(ChannelSelectorType xChannelSelector,
- ChannelSelectorType yChannelSelector,
- SkScalar scale, SkImageFilter* displacement,
- SkImageFilter* color = NULL,
- const CropRect* cropRect = NULL);
-
~SkDisplacementMapEffect();
+ static SkDisplacementMapEffect* Create(ChannelSelectorType xChannelSelector,
+ ChannelSelectorType yChannelSelector,
+ SkScalar scale, SkImageFilter* displacement,
+ SkImageFilter* color = NULL,
+ const CropRect* cropRect = NULL) {
+ return SkNEW_ARGS(SkDisplacementMapEffect, (xChannelSelector, yChannelSelector, scale,
+ displacement, color, cropRect));
+ }
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect)
virtual bool onFilterImage(Proxy* proxy,
@@ -52,6 +54,15 @@ protected:
explicit SkDisplacementMapEffect(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkDisplacementMapEffect(ChannelSelectorType xChannelSelector,
+ ChannelSelectorType yChannelSelector,
+ SkScalar scale, SkImageFilter* displacement,
+ SkImageFilter* color = NULL,
+ const CropRect* cropRect = NULL);
+
private:
ChannelSelectorType fXChannelSelector;
ChannelSelectorType fYChannelSelector;
« no previous file with comments | « include/effects/SkComposeImageFilter.h ('k') | include/effects/SkDropShadowImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698