1 #ifndef _SkTestImageFilters_h 2 #define _SkTestImageFilters_h 3 4 #include "SkImageFilter.h" 5 #include "SkPoint.h" 6 7 // Fun mode that scales down (only) and then scales back up to look pixelated 8 class SK_API SkDownSampleImageFilter : public SkImageFilter { 9 public: 10 SkDownSampleImageFilter(SkScalar scale) : INHERITED(0), fScale(scale) {} 11 12 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDownSampleImageFilter) 13 14 protected: 15 SkDownSampleImageFilter(SkFlattenableReadBuffer& buffer); 16 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 17 18 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 19 SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; 20 21 private: 22 SkScalar fScale; 23 24 typedef SkImageFilter INHERITED; 25 }; 26 27 #endif 28