OLD | NEW |
1 #ifndef _SkTestImageFilters_h | 1 #ifndef _SkTestImageFilters_h |
2 #define _SkTestImageFilters_h | 2 #define _SkTestImageFilters_h |
3 | 3 |
4 #include "SkImageFilter.h" | 4 #include "SkImageFilter.h" |
5 #include "SkPoint.h" | 5 #include "SkPoint.h" |
6 | 6 |
7 class SK_API SkComposeImageFilter : public SkImageFilter { | |
8 public: | |
9 SkComposeImageFilter(SkImageFilter* outer, SkImageFilter* inner) : INHERITED
(outer, inner) {} | |
10 virtual ~SkComposeImageFilter(); | |
11 | |
12 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeImageFilter) | |
13 | |
14 protected: | |
15 SkComposeImageFilter(SkFlattenableReadBuffer& buffer); | |
16 | |
17 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | |
18 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; | |
19 virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) SK_OV
ERRIDE; | |
20 | |
21 private: | |
22 typedef SkImageFilter INHERITED; | |
23 }; | |
24 | |
25 /////////////////////////////////////////////////////////////////////////////// | |
26 | |
27 // Fun mode that scales down (only) and then scales back up to look pixelated | 7 // Fun mode that scales down (only) and then scales back up to look pixelated |
28 class SK_API SkDownSampleImageFilter : public SkImageFilter { | 8 class SK_API SkDownSampleImageFilter : public SkImageFilter { |
29 public: | 9 public: |
30 SkDownSampleImageFilter(SkScalar scale) : INHERITED(0), fScale(scale) {} | 10 SkDownSampleImageFilter(SkScalar scale) : INHERITED(0), fScale(scale) {} |
31 | 11 |
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDownSampleImageFilter) | 12 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDownSampleImageFilter) |
33 | 13 |
34 protected: | 14 protected: |
35 SkDownSampleImageFilter(SkFlattenableReadBuffer& buffer); | 15 SkDownSampleImageFilter(SkFlattenableReadBuffer& buffer); |
36 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 16 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
37 | 17 |
38 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 18 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
39 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; | 19 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; |
40 | 20 |
41 private: | 21 private: |
42 SkScalar fScale; | 22 SkScalar fScale; |
43 | 23 |
44 typedef SkImageFilter INHERITED; | 24 typedef SkImageFilter INHERITED; |
45 }; | 25 }; |
46 | 26 |
47 #endif | 27 #endif |
OLD | NEW |