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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { | 66 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { |
67 this->SkImageFilter::flatten(buffer); | 67 this->SkImageFilter::flatten(buffer); |
68 buffer.writeScalar(fDX); | 68 buffer.writeScalar(fDX); |
69 buffer.writeScalar(fDY); | 69 buffer.writeScalar(fDY); |
70 } | 70 } |
71 | 71 |
72 private: | 72 private: |
73 SimpleOffsetFilter(SkScalar dx, SkScalar dy, SkImageFilter* input) | 73 SimpleOffsetFilter(SkScalar dx, SkScalar dy, SkImageFilter* input) |
74 : SkImageFilter(input), fDX(dx), fDY(dy) {} | 74 : SkImageFilter(1, &input), fDX(dx), fDY(dy) {} |
75 | 75 |
76 SkScalar fDX, fDY; | 76 SkScalar fDX, fDY; |
77 }; | 77 }; |
78 | 78 |
79 SkFlattenable::Registrar registrar("SimpleOffsetFilter", | 79 SkFlattenable::Registrar registrar("SimpleOffsetFilter", |
80 SimpleOffsetFilter::CreateProc, | 80 SimpleOffsetFilter::CreateProc, |
81 SimpleOffsetFilter::GetFlattenableType()); | 81 SimpleOffsetFilter::GetFlattenableType()); |
82 | 82 |
83 class ImageFiltersGraphGM : public skiagm::GM { | 83 class ImageFiltersGraphGM : public skiagm::GM { |
84 public: | 84 public: |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 private: | 210 private: |
211 typedef GM INHERITED; | 211 typedef GM INHERITED; |
212 SkBitmap fBitmap; | 212 SkBitmap fBitmap; |
213 }; | 213 }; |
214 | 214 |
215 /////////////////////////////////////////////////////////////////////////////// | 215 /////////////////////////////////////////////////////////////////////////////// |
216 | 216 |
217 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } | 217 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } |
218 static skiagm::GMRegistry reg(MyFactory); | 218 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |