Chromium Code Reviews| 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 |
|
Stephen White
2014/03/03 19:48:04
Might want to give Robert a heads-up that this wil
Dominik Grewe
2014/03/04 10:29:00
This is already included in that file (via the new
|
| +public: |
| +#endif |
| + explicit SkBitmapSource(const SkBitmap& bitmap); |
| + SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect); |
| + |
| private: |
| SkBitmap fBitmap; |
| SkRect fSrcRect, fDstRect; |