Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: include/effects/SkMorphologyImageFilter.h

Issue 135013004: Refactor SkMorphologyImageFilter, CPU and GPU paths. This required making opts/ dependent on effect… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove a stray "virtual". Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/opts.gyp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; }
« no previous file with comments | « gyp/opts.gyp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698