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

Side by Side Diff: include/effects/SkMorphologyImageFilter.h

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 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 | « include/effects/SkMergeImageFilter.h ('k') | include/effects/SkOffsetImageFilter.h » ('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 "SkImageFilter.h" 12 #include "SkImageFilter.h"
13 #include "SkSize.h" 13 #include "SkSize.h"
14 14
15 class SK_API SkMorphologyImageFilter : public SkImageFilter { 15 class SK_API SkMorphologyImageFilter : public SkImageFilter {
16 public: 16 public:
17 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, cons t SkIRect* cropRect); 17 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, cons t CropRect* cropRect);
18 18
19 protected: 19 protected:
20 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer); 20 SkMorphologyImageFilter(SkFlattenableReadBuffer& buffer);
21 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 21 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
22 #if SK_SUPPORT_GPU 22 #if SK_SUPPORT_GPU
23 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } 23 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
24 #endif 24 #endif
25 25
26 SkISize radius() const { return fRadius; } 26 SkISize radius() const { return fRadius; }
27 27
28 private: 28 private:
29 SkISize fRadius; 29 SkISize fRadius;
30 typedef SkImageFilter INHERITED; 30 typedef SkImageFilter INHERITED;
31 }; 31 };
32 32
33 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter { 33 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter {
34 public: 34 public:
35 SkDilateImageFilter(int radiusX, int radiusY, 35 SkDilateImageFilter(int radiusX, int radiusY,
36 SkImageFilter* input = NULL, 36 SkImageFilter* input = NULL,
37 const SkIRect* cropRect = NULL) 37 const CropRect* cropRect = NULL)
38 : INHERITED(radiusX, radiusY, input, cropRect) {} 38 : INHERITED(radiusX, radiusY, input, cropRect) {}
39 39
40 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 40 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
41 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 41 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
42 #if SK_SUPPORT_GPU 42 #if SK_SUPPORT_GPU
43 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm, 43 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm,
44 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 44 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
45 #endif 45 #endif
46 46
47 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) 47 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
48 48
49 protected: 49 protected:
50 SkDilateImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 50 SkDilateImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
51 51
52 private: 52 private:
53 typedef SkMorphologyImageFilter INHERITED; 53 typedef SkMorphologyImageFilter INHERITED;
54 }; 54 };
55 55
56 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { 56 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter {
57 public: 57 public:
58 SkErodeImageFilter(int radiusX, int radiusY, 58 SkErodeImageFilter(int radiusX, int radiusY,
59 SkImageFilter* input = NULL, 59 SkImageFilter* input = NULL,
60 const SkIRect* cropRect = NULL) 60 const CropRect* cropRect = NULL)
61 : INHERITED(radiusX, radiusY, input, cropRect) {} 61 : INHERITED(radiusX, radiusY, input, cropRect) {}
62 62
63 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 63 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
64 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 64 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
65 #if SK_SUPPORT_GPU 65 #if SK_SUPPORT_GPU
66 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm, 66 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm,
67 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 67 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE;
68 #endif 68 #endif
69 69
70 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) 70 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
71 71
72 protected: 72 protected:
73 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 73 SkErodeImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
74 74
75 private: 75 private:
76 typedef SkMorphologyImageFilter INHERITED; 76 typedef SkMorphologyImageFilter INHERITED;
77 }; 77 };
78 78
79 #endif 79 #endif
OLDNEW
« no previous file with comments | « include/effects/SkMergeImageFilter.h ('k') | include/effects/SkOffsetImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698