OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 | 8 |
9 #ifndef SkMorphologyImageFilter_DEFINED | 9 #ifndef SkMorphologyImageFilter_DEFINED |
10 #define SkMorphologyImageFilter_DEFINED | 10 #define SkMorphologyImageFilter_DEFINED |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRec
t, uniqueID)); | 61 return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRec
t, uniqueID)); |
62 } | 62 } |
63 | 63 |
64 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 64 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
65 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; | 65 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; |
66 #if SK_SUPPORT_GPU | 66 #if SK_SUPPORT_GPU |
67 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context
&, | 67 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context
&, |
68 SkBitmap* result, SkIPoint* offset) const SK_OVE
RRIDE; | 68 SkBitmap* result, SkIPoint* offset) const SK_OVE
RRIDE; |
69 #endif | 69 #endif |
70 | 70 |
| 71 SK_TO_STRING_OVERRIDE() |
71 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) | 72 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) |
72 | 73 |
73 protected: | 74 protected: |
74 SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cr
opRect* cropRect, uint32_t uniqueID) | 75 SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cr
opRect* cropRect, uint32_t uniqueID) |
75 : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {} | 76 : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {} |
76 private: | 77 private: |
77 typedef SkMorphologyImageFilter INHERITED; | 78 typedef SkMorphologyImageFilter INHERITED; |
78 }; | 79 }; |
79 | 80 |
80 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { | 81 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { |
81 public: | 82 public: |
82 static SkErodeImageFilter* Create(int radiusX, int radiusY, | 83 static SkErodeImageFilter* Create(int radiusX, int radiusY, |
83 SkImageFilter* input = NULL, | 84 SkImageFilter* input = NULL, |
84 const CropRect* cropRect = NULL, | 85 const CropRect* cropRect = NULL, |
85 uint32_t uniqueID = 0) { | 86 uint32_t uniqueID = 0) { |
86 if (radiusX < 0 || radiusY < 0) { | 87 if (radiusX < 0 || radiusY < 0) { |
87 return NULL; | 88 return NULL; |
88 } | 89 } |
89 return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect
, uniqueID)); | 90 return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect
, uniqueID)); |
90 } | 91 } |
91 | 92 |
92 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, | 93 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
93 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; | 94 SkBitmap* result, SkIPoint* offset) const SK_OVER
RIDE; |
94 #if SK_SUPPORT_GPU | 95 #if SK_SUPPORT_GPU |
95 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context
&, | 96 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context
&, |
96 SkBitmap* result, SkIPoint* offset) const SK_OVE
RRIDE; | 97 SkBitmap* result, SkIPoint* offset) const SK_OVE
RRIDE; |
97 #endif | 98 #endif |
98 | 99 |
| 100 SK_TO_STRING_OVERRIDE() |
99 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) | 101 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) |
100 | 102 |
101 protected: | 103 protected: |
102 SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cro
pRect* cropRect, uint32_t uniqueID) | 104 SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cro
pRect* cropRect, uint32_t uniqueID) |
103 : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {} | 105 : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {} |
104 | 106 |
105 private: | 107 private: |
106 typedef SkMorphologyImageFilter INHERITED; | 108 typedef SkMorphologyImageFilter INHERITED; |
107 }; | 109 }; |
108 | 110 |
109 #endif | 111 #endif |
OLD | NEW |