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

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

Issue 148883011: Make SkImageFilter methods const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More fixes to gm/ Created 6 years, 10 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
« 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
(...skipping 14 matching lines...) Expand all
25 * of the destination buffer (in pixels), and srcStride and dstStride are th e 25 * of the destination buffer (in pixels), and srcStride and dstStride are th e
26 * number of pixels per row in each buffer. All buffers are 8888. 26 * number of pixels per row in each buffer. All buffers are 8888.
27 */ 27 */
28 28
29 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius, 29 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius,
30 int width, int height, int srcStride, int dstStride); 30 int width, int height, int srcStride, int dstStride);
31 31
32 protected: 32 protected:
33 bool filterImageGeneric(Proc procX, Proc procY, 33 bool filterImageGeneric(Proc procX, Proc procY,
34 Proxy*, const SkBitmap& src, const SkMatrix&, 34 Proxy*, const SkBitmap& src, const SkMatrix&,
35 SkBitmap* result, SkIPoint* offset); 35 SkBitmap* result, SkIPoint* offset) const;
36 SkMorphologyImageFilter(SkReadBuffer& buffer); 36 SkMorphologyImageFilter(SkReadBuffer& buffer);
37 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 37 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
38 #if SK_SUPPORT_GPU 38 #if SK_SUPPORT_GPU
39 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; } 39 virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
40 bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src, 40 bool filterImageGPUGeneric(bool dilate, Proxy* proxy, const SkBitmap& src,
41 const SkMatrix& ctm, SkBitmap* result, 41 const SkMatrix& ctm, SkBitmap* result,
42 SkIPoint* offset); 42 SkIPoint* offset) const;
43 #endif 43 #endif
44 44
45 SkISize radius() const { return fRadius; } 45 SkISize radius() const { return fRadius; }
46 46
47 private: 47 private:
48 SkISize fRadius; 48 SkISize fRadius;
49 typedef SkImageFilter INHERITED; 49 typedef SkImageFilter INHERITED;
50 }; 50 };
51 51
52 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter { 52 class SK_API SkDilateImageFilter : public SkMorphologyImageFilter {
53 public: 53 public:
54 SkDilateImageFilter(int radiusX, int radiusY, 54 SkDilateImageFilter(int radiusX, int radiusY,
55 SkImageFilter* input = NULL, 55 SkImageFilter* input = NULL,
56 const CropRect* cropRect = NULL) 56 const CropRect* cropRect = NULL)
57 : INHERITED(radiusX, radiusY, input, cropRect) {} 57 : INHERITED(radiusX, radiusY, input, cropRect) {}
58 58
59 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 59 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
60 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 60 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
61 #if SK_SUPPORT_GPU 61 #if SK_SUPPORT_GPU
62 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm, 62 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm,
63 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 63 SkBitmap* result, SkIPoint* offset) const SK_OVE RRIDE;
64 #endif 64 #endif
65 65
66 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) 66 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
67 67
68 protected: 68 protected:
69 SkDilateImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} 69 SkDilateImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {}
70 70
71 private: 71 private:
72 typedef SkMorphologyImageFilter INHERITED; 72 typedef SkMorphologyImageFilter INHERITED;
73 }; 73 };
74 74
75 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { 75 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter {
76 public: 76 public:
77 SkErodeImageFilter(int radiusX, int radiusY, 77 SkErodeImageFilter(int radiusX, int radiusY,
78 SkImageFilter* input = NULL, 78 SkImageFilter* input = NULL,
79 const CropRect* cropRect = NULL) 79 const CropRect* cropRect = NULL)
80 : INHERITED(radiusX, radiusY, input, cropRect) {} 80 : INHERITED(radiusX, radiusY, input, cropRect) {}
81 81
82 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 82 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
83 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 83 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
84 #if SK_SUPPORT_GPU 84 #if SK_SUPPORT_GPU
85 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm, 85 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const SkMatri x& ctm,
86 SkBitmap* result, SkIPoint* offset) SK_OVERRIDE; 86 SkBitmap* result, SkIPoint* offset) const SK_OVE RRIDE;
87 #endif 87 #endif
88 88
89 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) 89 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
90 90
91 protected: 91 protected:
92 SkErodeImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} 92 SkErodeImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {}
93 93
94 private: 94 private:
95 typedef SkMorphologyImageFilter INHERITED; 95 typedef SkMorphologyImageFilter INHERITED;
96 }; 96 };
97 97
98 #endif 98 #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