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

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: Fix android build 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
15 class SK_API SkMorphologyImageFilter : public SkImageFilter { 16 class SK_API SkMorphologyImageFilter : public SkImageFilter {
16 public: 17 public:
17 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, cons t CropRect* cropRect); 18 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, cons t CropRect* cropRect);
18 19
20 /**
21 * All morphology procs have the same signature: src is the source buffer, d st the
22 * destination buffer, radius is the morphology radius, width and height are the bounds
23 * of the destination buffer (in pixels), and srcStride and dstStride are th e
24 * number of pixels per row in each buffer. All buffers are 8888.
25 */
26
27 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius,
28 int width, int height, int srcStride, int dstStride);
29
19 protected: 30 protected:
31 bool filterImageGeneric(Proc procX, Proc procY,
32 Proxy*, const SkBitmap& src, const SkMatrix&,
33 SkBitmap* result, SkIPoint* offset);
20 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer); 34 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer);
21 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 35 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
22 #if SK_SUPPORT_GPU 36 #if SK_SUPPORT_GPU
23 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } 37 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
38 bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src,
39 const SkMatrix& ctm, SkBitmap* result,
40 SkIPoint* offset);
24 #endif 41 #endif
25 42
26 SkISize radius() const { return fRadius; } 43 SkISize radius() const { return fRadius; }
27 44
28 private: 45 private:
29 SkISize fRadius; 46 SkISize fRadius;
30 typedef SkImageFilter INHERITED; 47 typedef SkImageFilter INHERITED;
31 }; 48 };
32 49
33 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter { 50 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) 87 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
71 88
72 protected: 89 protected:
73 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 90 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
74 91
75 private: 92 private:
76 typedef SkMorphologyImageFilter INHERITED; 93 typedef SkMorphologyImageFilter INHERITED;
77 }; 94 };
78 95
79 #endif 96 #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