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

Unified Diff: include/effects/SkTileImageFilter.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/SkTestImageFilters.h ('k') | include/effects/SkXfermodeImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkTileImageFilter.h
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h
index 390e00c9a47af2ac4b81842481b3c187fd6a70da..4bc2a200916eae71d38b11b0bc43ec05849ba52d 100644
--- a/include/effects/SkTileImageFilter.h
+++ b/include/effects/SkTileImageFilter.h
@@ -14,13 +14,15 @@ class SK_API SkTileImageFilter : public SkImageFilter {
typedef SkImageFilter INHERITED;
public:
- /** Tile image filter constructor
+ /** Create a tile image filter
@param srcRect Defines the pixels to tile
@param dstRect Defines the pixels where tiles are drawn
@param input Input from which the subregion defined by srcRect will be tiled
*/
- SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input)
- : INHERITED(input), fSrcRect(srcRect), fDstRect(dstRect) {}
+ static SkTileImageFilter* Create(const SkRect& srcRect, const SkRect& dstRect,
+ SkImageFilter* input) {
+ return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input));
+ }
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm,
SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE;
@@ -32,6 +34,12 @@ protected:
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input)
+ : INHERITED(input), fSrcRect(srcRect), fDstRect(dstRect) {}
+
private:
SkRect fSrcRect;
SkRect fDstRect;
« no previous file with comments | « include/effects/SkTestImageFilters.h ('k') | include/effects/SkXfermodeImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698