| 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 16 matching lines...) Expand all Loading... |
| 27 public: | 27 public: |
| 28 class Registrar { | 28 class Registrar { |
| 29 public: | 29 public: |
| 30 Registrar() { | 30 Registrar() { |
| 31 SkFlattenable::Register("SimpleOffsetFilter", | 31 SkFlattenable::Register("SimpleOffsetFilter", |
| 32 SimpleOffsetFilter::CreateProc, | 32 SimpleOffsetFilter::CreateProc, |
| 33 SimpleOffsetFilter::GetFlattenableType()); | 33 SimpleOffsetFilter::GetFlattenableType()); |
| 34 } | 34 } |
| 35 }; | 35 }; |
| 36 static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkImageFilter* input)
{ | 36 static SkImageFilter* Create(SkScalar dx, SkScalar dy, SkImageFilter* input)
{ |
| 37 return SkNEW_ARGS(SimpleOffsetFilter, (dx, dy, input)); | 37 return new SimpleOffsetFilter(dx, dy, input); |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context&
ctx, | 40 virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context&
ctx, |
| 41 SkBitmap* dst, SkIPoint* offset) const override { | 41 SkBitmap* dst, SkIPoint* offset) const override { |
| 42 SkBitmap source = src; | 42 SkBitmap source = src; |
| 43 SkImageFilter* input = getInput(0); | 43 SkImageFilter* input = getInput(0); |
| 44 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 44 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
| 45 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset))
{ | 45 if (input && !input->filterImage(proxy, src, ctx, &source, &srcOffset))
{ |
| 46 return false; | 46 return false; |
| 47 } | 47 } |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 private: | 225 private: |
| 226 typedef GM INHERITED; | 226 typedef GM INHERITED; |
| 227 SkBitmap fBitmap; | 227 SkBitmap fBitmap; |
| 228 }; | 228 }; |
| 229 | 229 |
| 230 /////////////////////////////////////////////////////////////////////////////// | 230 /////////////////////////////////////////////////////////////////////////////// |
| 231 | 231 |
| 232 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } | 232 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } |
| 233 static skiagm::GMRegistry reg(MyFactory); | 233 static skiagm::GMRegistry reg(MyFactory); |
| OLD | NEW |