| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #ifndef SkDisplacementMapEffect_DEFINED | 8 #ifndef SkDisplacementMapEffect_DEFINED |
| 9 #define SkDisplacementMapEffect_DEFINED | 9 #define SkDisplacementMapEffect_DEFINED |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 ~SkDisplacementMapEffect(); | 31 ~SkDisplacementMapEffect(); |
| 32 | 32 |
| 33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect) | 33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect) |
| 34 | 34 |
| 35 virtual bool onFilterImage(Proxy* proxy, | 35 virtual bool onFilterImage(Proxy* proxy, |
| 36 const SkBitmap& src, | 36 const SkBitmap& src, |
| 37 const SkMatrix& ctm, | 37 const SkMatrix& ctm, |
| 38 SkBitmap* dst, | 38 SkBitmap* dst, |
| 39 SkIPoint* offset) SK_OVERRIDE; | 39 SkIPoint* offset) SK_OVERRIDE; |
| 40 virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVER
RIDE; |
| 41 |
| 40 #if SK_SUPPORT_GPU | 42 #if SK_SUPPORT_GPU |
| 41 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } | 43 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } |
| 42 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri
x& ctm, | 44 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri
x& ctm, |
| 43 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; | 45 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; |
| 44 #endif | 46 #endif |
| 45 | 47 |
| 46 protected: | 48 protected: |
| 47 explicit SkDisplacementMapEffect(SkFlattenableReadBuffer& buffer); | 49 explicit SkDisplacementMapEffect(SkFlattenableReadBuffer& buffer); |
| 48 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 50 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 ChannelSelectorType fXChannelSelector; | 53 ChannelSelectorType fXChannelSelector; |
| 52 ChannelSelectorType fYChannelSelector; | 54 ChannelSelectorType fYChannelSelector; |
| 53 SkScalar fScale; | 55 SkScalar fScale; |
| 54 typedef SkImageFilter INHERITED; | 56 typedef SkImageFilter INHERITED; |
| 55 SkImageFilter* getDisplacementInput() { return getInput(0); } | 57 SkImageFilter* getDisplacementInput() { return getInput(0); } |
| 56 SkImageFilter* getColorInput() { return getInput(1); } | 58 SkImageFilter* getColorInput() { return getInput(1); } |
| 59 const SkImageFilter* getDisplacementInput() const { return getInput(0); } |
| 60 const SkImageFilter* getColorInput() const { return getInput(1); } |
| 57 }; | 61 }; |
| 58 | 62 |
| 59 #endif | 63 #endif |
| OLD | NEW |