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()); | |
37 } | 36 } |
38 }; | 37 }; |
39 static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy, sk_sp<SkImageFilt
er> input) { | 38 static sk_sp<SkImageFilter> Make(SkScalar dx, SkScalar dy, sk_sp<SkImageFilt
er> input) { |
40 return sk_sp<SkImageFilter>(new SimpleOffsetFilter(dx, dy, std::move(inp
ut))); | 39 return sk_sp<SkImageFilter>(new SimpleOffsetFilter(dx, dy, std::move(inp
ut))); |
41 } | 40 } |
42 | 41 |
43 SK_TO_STRING_OVERRIDE() | 42 SK_TO_STRING_OVERRIDE() |
44 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter); | 43 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter); |
45 | 44 |
46 protected: | 45 protected: |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 257 } |
259 | 258 |
260 sk_sp<SkImage> fImage; | 259 sk_sp<SkImage> fImage; |
261 | 260 |
262 typedef GM INHERITED; | 261 typedef GM INHERITED; |
263 }; | 262 }; |
264 | 263 |
265 /////////////////////////////////////////////////////////////////////////////// | 264 /////////////////////////////////////////////////////////////////////////////// |
266 | 265 |
267 DEF_GM(return new ImageFiltersGraphGM;) | 266 DEF_GM(return new ImageFiltersGraphGM;) |
OLD | NEW |