| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkTileImageFilter_DEFINED | 8 #ifndef SkTileImageFilter_DEFINED |
| 9 #define SkTileImageFilter_DEFINED | 9 #define SkTileImageFilter_DEFINED |
| 10 | 10 |
| 11 #include "SkImageFilter.h" | 11 #include "SkImageFilter.h" |
| 12 | 12 |
| 13 class SK_API SkTileImageFilter : public SkImageFilter { | 13 class SK_API SkTileImageFilter : public SkImageFilter { |
| 14 typedef SkImageFilter INHERITED; | 14 typedef SkImageFilter INHERITED; |
| 15 | 15 |
| 16 public: | 16 public: |
| 17 /** Create a tile image filter | 17 /** Create a tile image filter |
| 18 @param srcRect Defines the pixels to tile | 18 @param srcRect Defines the pixels to tile |
| 19 @param dstRect Defines the pixels where tiles are drawn | 19 @param dstRect Defines the pixels where tiles are drawn |
| 20 @param input Input from which the subregion defined by srcRect will b
e tiled | 20 @param input Input from which the subregion defined by srcRect will b
e tiled |
| 21 */ | 21 */ |
| 22 static SkTileImageFilter* Create(const SkRect& srcRect, const SkRect& dstRec
t, | 22 static SkTileImageFilter* Create(const SkRect& srcRect, const SkRect& dstRec
t, |
| 23 SkImageFilter* input) { | 23 SkImageFilter* input) { |
| 24 return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input)); | 24 return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const SkMatrix
& ctm, | 27 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context&
ctx, |
| 28 SkBitmap* dst, SkIPoint* offset) const SK_OVERRID
E; | 28 SkBitmap* dst, SkIPoint* offset) const SK_OVERRID
E; |
| 29 | 29 |
| 30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter) | 30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter) |
| 31 | 31 |
| 32 protected: | 32 protected: |
| 33 explicit SkTileImageFilter(SkReadBuffer& buffer); | 33 explicit SkTileImageFilter(SkReadBuffer& buffer); |
| 34 | 34 |
| 35 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; | 35 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; |
| 36 | 36 |
| 37 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS | 37 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
| 38 public: | 38 public: |
| 39 #endif | 39 #endif |
| 40 SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilte
r* input) | 40 SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilte
r* input) |
| 41 : INHERITED(input), fSrcRect(srcRect), fDstRect(dstRect) {} | 41 : INHERITED(input), fSrcRect(srcRect), fDstRect(dstRect) {} |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 SkRect fSrcRect; | 44 SkRect fSrcRect; |
| 45 SkRect fDstRect; | 45 SkRect fDstRect; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #endif | 48 #endif |
| OLD | NEW |