OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
11 #include "SkColorPriv.h" | 11 #include "SkColorPriv.h" |
12 #include "SkShader.h" | 12 #include "SkShader.h" |
13 | 13 |
14 #include "SkBlurImageFilter.h" | 14 #include "SkBlurImageFilter.h" |
15 #include "SkColorFilterImageFilter.h" | 15 #include "SkColorFilterImageFilter.h" |
16 #include "SkDropShadowImageFilter.h" | 16 #include "SkDropShadowImageFilter.h" |
17 #include "SkTestImageFilters.h" | 17 #include "SkTestImageFilters.h" |
18 | 18 |
19 class FailImageFilter : public SkImageFilter { | 19 class FailImageFilter : public SkImageFilter { |
20 public: | 20 public: |
21 FailImageFilter() : INHERITED(0) {} | 21 FailImageFilter() : INHERITED(0) {} |
22 | 22 |
23 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) | 23 SK_DEFINE_FLATTENABLE_EXTERN(FailImageFilter) |
24 protected: | 24 protected: |
25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
26 SkBitmap* result, SkIPoint* offset) { | 26 SkBitmap* result, SkIPoint* offset) { |
27 return false; | 27 return false; |
28 } | 28 } |
29 | 29 |
30 FailImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 30 FailImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} |
31 | 31 |
32 private: | 32 private: |
33 typedef SkImageFilter INHERITED; | 33 typedef SkImageFilter INHERITED; |
34 }; | 34 }; |
35 | 35 |
36 // register the filter with the flattenable registry | 36 // register the filter with the flattenable registry |
37 static SkFlattenable::Registrar gFailImageFilterReg("FailImageFilter", | 37 static SkFlattenable::Registrar gFailImageFilterReg("FailImageFilter", |
38 FailImageFilter::CreateProc)
; | 38 FailImageFilter::CreateProc)
; |
39 | 39 |
40 class IdentityImageFilter : public SkImageFilter { | 40 class IdentityImageFilter : public SkImageFilter { |
41 public: | 41 public: |
42 IdentityImageFilter() : INHERITED(0) {} | 42 IdentityImageFilter() : INHERITED(0) {} |
43 | 43 |
44 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) | 44 SK_DEFINE_FLATTENABLE_EXTERN(IdentityImageFilter) |
45 protected: | 45 protected: |
46 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 46 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
47 SkBitmap* result, SkIPoint* offset) { | 47 SkBitmap* result, SkIPoint* offset) { |
48 *result = src; | 48 *result = src; |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 IdentityImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 52 IdentityImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} |
53 | 53 |
54 private: | 54 private: |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 } | 218 } |
219 | 219 |
220 private: | 220 private: |
221 typedef GM INHERITED; | 221 typedef GM INHERITED; |
222 }; | 222 }; |
223 | 223 |
224 /////////////////////////////////////////////////////////////////////////////// | 224 /////////////////////////////////////////////////////////////////////////////// |
225 | 225 |
226 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } | 226 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } |
227 static skiagm::GMRegistry reg(MyFactory); | 227 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |