diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 15:43:50 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-24 15:43:50 +0000 |
commit | 0ded88d431a1872e21986984f009db2e84f52738 (patch) | |
tree | 31050e07a32353fcbd687ee79c6b8b051baf7961 /include/effects/SkMorphologyImageFilter.h | |
parent | 94ecb66c4920018c833d8bbbbb8b51d18e1c5d56 (diff) |
[Reland of r13154, since the Housekeeping bot seems to have reverted it in r13155. Next time I'll put the "do not disturb" sign on my commit.]
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
Committed: https://code.google.com/p/skia/source/detail?r=13154
BUG=skia:
Review URL: https://codereview.chromium.org/135013004
git-svn-id: http://skia.googlecode.com/svn/trunk@13168 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects/SkMorphologyImageFilter.h')
-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; } |