diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-23 18:45:23 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-23 18:45:23 +0000 |
commit | 76d4d04b18a773061559533a3b774a82ddc94d0f (patch) | |
tree | 3d59803f296480315e39d2a8996b0a848221d5bf /include | |
parent | 9e63883725f2733fd05cbe7104f28e0ff5383db6 (diff) |
Refactor SkMorphologyImageFilter, CPU and GPU paths. This required making opts/ dependent on effects/, so that we could use the SkMorphologyProc type in SkMorphologyImageFilter.h.
Correctness and performance covered by existing tests; no change in functionality.
R=bsalomon@google.com, djsollen@google.com, reed@google.com
Review URL: https://codereview.chromium.org/135013004
git-svn-id: http://skia.googlecode.com/svn/trunk@13154 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/effects/SkMorphologyImageFilter.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h index 880fc2ec2c..3a55199939 100644 --- a/include/effects/SkMorphologyImageFilter.h +++ b/include/effects/SkMorphologyImageFilter.h @@ -9,6 +9,7 @@ #ifndef SkMorphologyImageFilter_DEFINED #define SkMorphologyImageFilter_DEFINED +#include "SkColor.h" #include "SkImageFilter.h" #include "SkSize.h" @@ -16,11 +17,27 @@ class SK_API SkMorphologyImageFilter : public SkImageFilter { public: SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect); + /** + * 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 (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius, + int width, int height, int srcStride, int dstStride); + protected: + bool filterImageGeneric(Proc procX, Proc 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; } |