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

Side by Side Diff: include/effects/SkTestImageFilters.h

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify xfermodes, fix SkLayerDrawLooper Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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 // 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
8 class SK_API SkDownSampleImageFilter : public SkImageFilter { 8 class SK_API SkDownSampleImageFilter : public SkImageFilter {
9 public: 9 public:
10 static SkDownSampleImageFilter* Create(SkScalar scale, SkImageFilter* input = NULL) { 10 static SkDownSampleImageFilter* Create(SkScalar scale, SkImageFilter* input = NULL) {
11 return SkNEW_ARGS(SkDownSampleImageFilter, (scale, input)); 11 return SkNEW_ARGS(SkDownSampleImageFilter, (scale, input));
12 } 12 }
13 13
14 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDownSampleImageFilter) 14 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDownSampleImageFilter)
15 15
16 protected: 16 protected:
17 SkDownSampleImageFilter(SkScalar scale, SkImageFilter* input) 17 SkDownSampleImageFilter(SkScalar scale, SkImageFilter* input)
18 : INHERITED(1, &input), fScale(scale) {} 18 : INHERITED(1, &input), fScale(scale) {}
19 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
19 SkDownSampleImageFilter(SkReadBuffer& buffer); 20 SkDownSampleImageFilter(SkReadBuffer& buffer);
21 #endif
20 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 22 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
21 23
22 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 24 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
23 SkBitmap* result, SkIPoint* loc) const SK_OVERRID E; 25 SkBitmap* result, SkIPoint* loc) const SK_OVERRID E;
24 26
25 private: 27 private:
26 SkScalar fScale; 28 SkScalar fScale;
27 29
28 typedef SkImageFilter INHERITED; 30 typedef SkImageFilter INHERITED;
29 }; 31 };
30 32
31 #endif 33 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698