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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gyp/opts.gyp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 11
12 #include "SkColor.h"
12 #include "SkImageFilter.h" 13 #include "SkImageFilter.h"
13 #include "SkSize.h" 14 #include "SkSize.h"
14 15
16 /**
17 * All morphology procs have the same signature: src is the source buffer, dst t he
18 * destination buffer, radius is the morphology radius, width and height are the bounds
19 * of the destination buffer (in pixels), and srcStride and dstStride are the
20 * number of pixels per row in each buffer. All buffers are 8888.
21 */
22
23 typedef void (*SkMorphologyProc)(const SkPMColor* src, SkPMColor* dst, int radiu s,
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
24 int width, int height, int srcStride, int dstSt ride);
25
26 enum SkMorphologyProcType {
27 kDilateX_SkMorphologyProcType,
28 kDilateY_SkMorphologyProcType,
29 kErodeX_SkMorphologyProcType,
30 kErodeY_SkMorphologyProcType
31 };
32
15 class SK_API SkMorphologyImageFilter : public SkImageFilter { 33 class SK_API SkMorphologyImageFilter : public SkImageFilter {
16 public: 34 public:
17 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, cons t CropRect* cropRect); 35 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, cons t CropRect* cropRect);
18 36
19 protected: 37 protected:
38 bool filterImageGeneric(SkMorphologyProc procX, SkMorphologyProc procY,
39 Proxy*, const SkBitmap& src, const SkMatrix&,
40 SkBitmap* result, SkIPoint* offset);
20 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer); 41 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer);
21 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 42 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
22 #if SK_SUPPORT_GPU 43 #if SK_SUPPORT_GPU
23 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } 44 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
45 bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src,
46 const SkMatrix& ctm, SkBitmap* result,
47 SkIPoint* offset);
24 #endif 48 #endif
25 49
26 SkISize radius() const { return fRadius; } 50 SkISize radius() const { return fRadius; }
27 51
28 private: 52 private:
29 SkISize fRadius; 53 SkISize fRadius;
30 typedef SkImageFilter INHERITED; 54 typedef SkImageFilter INHERITED;
31 }; 55 };
32 56
33 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter { 57 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) 94 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
71 95
72 protected: 96 protected:
73 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 97 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
74 98
75 private: 99 private:
76 typedef SkMorphologyImageFilter INHERITED; 100 typedef SkMorphologyImageFilter INHERITED;
77 }; 101 };
78 102
79 #endif 103 #endif
OLDNEW
« 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