Chromium Code Reviews| Index: include/effects/SkMorphologyImageFilter.h |
| diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h |
| index 880fc2ec2c4334fb42d3ecfd8c97627b24d1dbdb..7d9f40dc42e1fcd79630889a5ef0454ed06ff532 100644 |
| --- a/include/effects/SkMorphologyImageFilter.h |
| +++ b/include/effects/SkMorphologyImageFilter.h |
| @@ -9,18 +9,42 @@ |
| #ifndef SkMorphologyImageFilter_DEFINED |
| #define SkMorphologyImageFilter_DEFINED |
| +#include "SkColor.h" |
| #include "SkImageFilter.h" |
| #include "SkSize.h" |
| +/** |
| + * All morphology procs have the same signature: src is the source buffer, dst the |
| + * destination buffer, radius is the morphology radius, width and height are the bounds |
| + * of the destination buffer (in pixels), and srcStride and dstStride are the |
| + * number of pixels per row in each buffer. All buffers are 8888. |
| + */ |
| + |
| +typedef void (*SkMorphologyProc)(const SkPMColor* src, SkPMColor* dst, int radius, |
|
reed1
2014/01/22 21:17:16
Does this definition need to be public, or is it p
Stephen White
2014/01/22 21:36:42
I needed it to reference it from filterImageGeneri
|
| + int width, int height, int srcStride, int dstStride); |
| + |
| +enum SkMorphologyProcType { |
| + kDilateX_SkMorphologyProcType, |
| + kDilateY_SkMorphologyProcType, |
| + kErodeX_SkMorphologyProcType, |
| + kErodeY_SkMorphologyProcType |
| +}; |
| + |
| class SK_API SkMorphologyImageFilter : public SkImageFilter { |
| public: |
| SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect); |
| protected: |
| + bool filterImageGeneric(SkMorphologyProc procX, SkMorphologyProc procY, |
| + Proxy*, const SkBitmap& src, const SkMatrix&, |
| + SkBitmap* result, SkIPoint* offset); |
| SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer); |
| virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
| #if SK_SUPPORT_GPU |
| virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } |
| + bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src, |
| + const SkMatrix& ctm, SkBitmap* result, |
| + SkIPoint* offset); |
| #endif |
| SkISize radius() const { return fRadius; } |