OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 9 |
10 #include "SkArithmeticMode.h" | 10 #include "SkArithmeticMode.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "SkXfermodeImageFilter.h" | 25 #include "SkXfermodeImageFilter.h" |
26 | 26 |
27 // More closely models how Blink's OffsetFilter works as of 10/23/13. SkOffsetIm
ageFilter doesn't | 27 // More closely models how Blink's OffsetFilter works as of 10/23/13. SkOffsetIm
ageFilter doesn't |
28 // perform a draw and this one does. | 28 // perform a draw and this one does. |
29 class SimpleOffsetFilter : public SkImageFilter { | 29 class SimpleOffsetFilter : public SkImageFilter { |
30 public: | 30 public: |
31 class Registrar { | 31 class Registrar { |
32 public: | 32 public: |
33 Registrar() { | 33 Registrar() { |
34 SkFlattenable::Register("SimpleOffsetFilter", | 34 SkFlattenable::Register("SimpleOffsetFilter", |
35 SimpleOffsetFilter::CreateProc); | 35 SimpleOffsetFilter::CreateProc, |
| 36 SimpleOffsetFilter::GetFlattenableType()); |
36 } | 37 } |
37 }; | 38 }; |
38 static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy, sk_sp<SkImageFilt
er> input) { | 39 static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy, sk_sp<SkImageFilt
er> input) { |
39 return sk_sp<SkImageFilter>(new SimpleOffsetFilter(dx, dy, std::move(inp
ut))); | 40 return sk_sp<SkImageFilter>(new SimpleOffsetFilter(dx, dy, std::move(inp
ut))); |
40 } | 41 } |
41 | 42 |
42 SK_TO_STRING_OVERRIDE() | 43 SK_TO_STRING_OVERRIDE() |
43 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter); | 44 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter); |
44 | 45 |
45 protected: | 46 protected: |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 254 } |
254 | 255 |
255 sk_sp<SkImage> fImage; | 256 sk_sp<SkImage> fImage; |
256 | 257 |
257 typedef GM INHERITED; | 258 typedef GM INHERITED; |
258 }; | 259 }; |
259 | 260 |
260 /////////////////////////////////////////////////////////////////////////////// | 261 /////////////////////////////////////////////////////////////////////////////// |
261 | 262 |
262 DEF_GM(return new ImageFiltersGraphGM;) | 263 DEF_GM(return new ImageFiltersGraphGM;) |
OLD | NEW |