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

Unified Diff: include/effects/SkResizeImageFilter.h

Issue 182983003: Factory methods for heap-allocated SkImageFilter objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typo 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/SkResizeImageFilter.h
diff --git a/include/effects/SkResizeImageFilter.h b/include/effects/SkResizeImageFilter.h
index 0a8fb14647ce3185b7cbb6e5fc636b9d514f1103..9cb7bf3bb064120cc063be1e84a87c0504234e94 100644
--- a/include/effects/SkResizeImageFilter.h
+++ b/include/effects/SkResizeImageFilter.h
@@ -21,6 +21,8 @@
class SK_API SkResizeImageFilter : public SkImageFilter {
public:
+ virtual ~SkResizeImageFilter();
+
/** Construct a (scaling-only) resampling image filter.
* @param sx The x scale parameter to apply when resizing.
* @param sy The y scale parameter to apply when resizing.
@@ -28,10 +30,11 @@ public:
* @param input The input image filter. If NULL, the src bitmap
* passed to filterImage() is used instead.
*/
+ static SkResizeImageFilter* Create(SkScalar sx, SkScalar sy, SkPaint::FilterLevel filterLevel,
+ SkImageFilter* input = NULL) {
+ return SkNEW_ARGS(SkResizeImageFilter, (sx, sy, filterLevel, input));
+ }
- SkResizeImageFilter(SkScalar sx, SkScalar sy, SkPaint::FilterLevel filterLevel,
- SkImageFilter* input = NULL);
- virtual ~SkResizeImageFilter();
virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkResizeImageFilter)
@@ -45,6 +48,12 @@ protected:
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
SkIRect* dst) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkResizeImageFilter(SkScalar sx, SkScalar sy, SkPaint::FilterLevel filterLevel,
+ SkImageFilter* input = NULL);
Stephen White 2014/03/03 19:48:04 Note for the future: when we remove the #idef, we
Dominik Grewe 2014/03/04 10:29:00 Yes, will do that.
+
private:
SkScalar fSx, fSy;
SkPaint::FilterLevel fFilterLevel;

Powered by Google App Engine
This is Rietveld 408576698