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

Unified Diff: include/effects/SkBitmapSource.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/SkBicubicImageFilter.h ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkBitmapSource.h
diff --git a/include/effects/SkBitmapSource.h b/include/effects/SkBitmapSource.h
index fcc1db97bc758e74dd6737833f2a7b77c779b5c1..9740e0e6c690ae6eb0d4aad1538dfade3e3b032e 100644
--- a/include/effects/SkBitmapSource.h
+++ b/include/effects/SkBitmapSource.h
@@ -13,8 +13,13 @@
class SK_API SkBitmapSource : public SkImageFilter {
public:
- explicit SkBitmapSource(const SkBitmap& bitmap);
- SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect);
+ static SkBitmapSource* Create(const SkBitmap& bitmap) {
+ return SkNEW_ARGS(SkBitmapSource, (bitmap));
+ }
+ static SkBitmapSource* Create(const SkBitmap& bitmap, const SkRect& srcRect,
+ const SkRect& dstRect) {
+ return SkNEW_ARGS(SkBitmapSource, (bitmap, srcRect, dstRect));
+ }
virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVERRIDE;
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource)
@@ -26,6 +31,12 @@ protected:
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const SK_OVERRIDE;
+#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
+public:
+#endif
+ explicit SkBitmapSource(const SkBitmap& bitmap);
+ SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect);
+
private:
SkBitmap fBitmap;
SkRect fSrcRect, fDstRect;
« no previous file with comments | « include/effects/SkBicubicImageFilter.h ('k') | include/effects/SkBlurImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698