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 14 matching lines...) Expand all Loading... |
25 * number of pixels per row in each buffer. All buffers are 8888. | 25 * number of pixels per row in each buffer. All buffers are 8888. |
26 */ | 26 */ |
27 | 27 |
28 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius, | 28 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius, |
29 int width, int height, int srcStride, int dstStride); | 29 int width, int height, int srcStride, int dstStride); |
30 | 30 |
31 protected: | 31 protected: |
32 bool filterImageGeneric(Proc procX, Proc procY, | 32 bool filterImageGeneric(Proc procX, Proc procY, |
33 Proxy*, const SkBitmap& src, const SkMatrix&, | 33 Proxy*, const SkBitmap& src, const SkMatrix&, |
34 SkBitmap* result, SkIPoint* offset); | 34 SkBitmap* result, SkIPoint* offset); |
35 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer); | 35 SkMorphologyImageFilter(SkReadBuffer& buffer); |
36 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 36 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
37 #if SK_SUPPORT_GPU | 37 #if SK_SUPPORT_GPU |
38 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } | 38 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } |
39 bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src, | 39 bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src, |
40 const SkMatrix& ctm, SkBitmap* result, | 40 const SkMatrix& ctm, SkBitmap* result, |
41 SkIPoint* offset); | 41 SkIPoint* offset); |
42 #endif | 42 #endif |
43 | 43 |
44 SkISize radius() const { return fRadius; } | 44 SkISize radius() const { return fRadius; } |
45 | 45 |
46 private: | 46 private: |
(...skipping 11 matching lines...) Expand all Loading... |
58 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 58 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
59 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; | 59 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; |
60 #if SK_SUPPORT_GPU | 60 #if SK_SUPPORT_GPU |
61 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri
x& ctm, | 61 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri
x& ctm, |
62 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; | 62 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; |
63 #endif | 63 #endif |
64 | 64 |
65 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) | 65 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) |
66 | 66 |
67 protected: | 67 protected: |
68 SkDilateImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 68 SkDilateImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} |
69 | 69 |
70 private: | 70 private: |
71 typedef SkMorphologyImageFilter INHERITED; | 71 typedef SkMorphologyImageFilter INHERITED; |
72 }; | 72 }; |
73 | 73 |
74 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { | 74 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { |
75 public: | 75 public: |
76 SkErodeImageFilter(int radiusX, int radiusY, | 76 SkErodeImageFilter(int radiusX, int radiusY, |
77 SkImageFilter* input = NULL, | 77 SkImageFilter* input = NULL, |
78 const CropRect* cropRect = NULL) | 78 const CropRect* cropRect = NULL) |
79 : INHERITED(radiusX, radiusY, input, cropRect) {} | 79 : INHERITED(radiusX, radiusY, input, cropRect) {} |
80 | 80 |
81 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, | 81 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
82 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; | 82 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; |
83 #if SK_SUPPORT_GPU | 83 #if SK_SUPPORT_GPU |
84 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri
x& ctm, | 84 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri
x& ctm, |
85 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; | 85 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; |
86 #endif | 86 #endif |
87 | 87 |
88 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) | 88 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) |
89 | 89 |
90 protected: | 90 protected: |
91 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 91 SkErodeImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} |
92 | 92 |
93 private: | 93 private: |
94 typedef SkMorphologyImageFilter INHERITED; | 94 typedef SkMorphologyImageFilter INHERITED; |
95 }; | 95 }; |
96 | 96 |
97 #endif | 97 #endif |
OLD | NEW |