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

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

Issue 1019493002: Remove uniqueID from all filter serialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Null out fUniqueID deserialization Created 5 years, 9 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 12 matching lines...) Expand all
23 * destination buffer, radius is the morphology radius, width and height are the bounds 23 * destination buffer, radius is the morphology radius, width and height are the bounds
24 * of the destination buffer (in pixels), and srcStride and dstStride are th e 24 * of the destination buffer (in pixels), and srcStride and dstStride are th e
25 * number of pixels per row in each buffer. All buffers are 8888. 25 * number of pixels per row in each buffer. All buffers are 8888.
26 */ 26 */
27 27
28 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius, 28 typedef void (*Proc)(const SkPMColor* src, SkPMColor* dst, int radius,
29 int width, int height, int srcStride, int dstStride); 29 int width, int height, int srcStride, int dstStride);
30 30
31 protected: 31 protected:
32 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, 32 SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input,
33 const CropRect* cropRect, uint32_t uniqueID); 33 const CropRect* cropRect);
34 bool filterImageGeneric(Proc procX, Proc procY, 34 bool filterImageGeneric(Proc procX, Proc procY,
35 Proxy*, const SkBitmap& src, const Context&, 35 Proxy*, const SkBitmap& src, const Context&,
36 SkBitmap* result, SkIPoint* offset) const; 36 SkBitmap* result, SkIPoint* offset) const;
37 void flatten(SkWriteBuffer&) const SK_OVERRIDE; 37 void flatten(SkWriteBuffer&) const SK_OVERRIDE;
38 #if SK_SUPPORT_GPU 38 #if SK_SUPPORT_GPU
39 bool canFilterImageGPU() const SK_OVERRIDE { return true; } 39 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 Context& ctm, SkBitmap* result, 41 const Context& ctm, SkBitmap* result,
42 SkIPoint* offset) const; 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 static SkDilateImageFilter* Create(int radiusX, int radiusY, 54 static SkDilateImageFilter* Create(int radiusX, int radiusY,
55 SkImageFilter* input = NULL, 55 SkImageFilter* input = NULL,
56 const CropRect* cropRect = NULL, 56 const CropRect* cropRect = NULL) {
57 uint32_t uniqueID = 0) {
58 if (radiusX < 0 || radiusY < 0) { 57 if (radiusX < 0 || radiusY < 0) {
59 return NULL; 58 return NULL;
60 } 59 }
61 return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRec t, uniqueID)); 60 return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRec t));
62 } 61 }
63 62
64 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 63 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
65 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE; 64 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
66 #if SK_SUPPORT_GPU 65 #if SK_SUPPORT_GPU
67 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context &, 66 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context &,
68 SkBitmap* result, SkIPoint* offset) const SK_OVE RRIDE; 67 SkBitmap* result, SkIPoint* offset) const SK_OVE RRIDE;
69 #endif 68 #endif
70 69
71 SK_TO_STRING_OVERRIDE() 70 SK_TO_STRING_OVERRIDE()
72 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) 71 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
73 72
74 protected: 73 protected:
75 SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cr opRect* cropRect, uint32_t uniqueID) 74 SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cr opRect* cropRect)
76 : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {} 75 : INHERITED(radiusX, radiusY, input, cropRect) {}
77 private: 76 private:
78 typedef SkMorphologyImageFilter INHERITED; 77 typedef SkMorphologyImageFilter INHERITED;
79 }; 78 };
80 79
81 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter { 80 class SK_API SkErodeImageFilter : public SkMorphologyImageFilter {
82 public: 81 public:
83 static SkErodeImageFilter* Create(int radiusX, int radiusY, 82 static SkErodeImageFilter* Create(int radiusX, int radiusY,
84 SkImageFilter* input = NULL, 83 SkImageFilter* input = NULL,
85 const CropRect* cropRect = NULL, 84 const CropRect* cropRect = NULL) {
86 uint32_t uniqueID = 0) {
87 if (radiusX < 0 || radiusY < 0) { 85 if (radiusX < 0 || radiusY < 0) {
88 return NULL; 86 return NULL;
89 } 87 }
90 return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect , uniqueID)); 88 return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect ));
91 } 89 }
92 90
93 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, 91 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
94 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE; 92 SkBitmap* result, SkIPoint* offset) const SK_OVER RIDE;
95 #if SK_SUPPORT_GPU 93 #if SK_SUPPORT_GPU
96 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context &, 94 virtual bool filterImageGPU(Proxy* proxy, const SkBitmap& src, const Context &,
97 SkBitmap* result, SkIPoint* offset) const SK_OVE RRIDE; 95 SkBitmap* result, SkIPoint* offset) const SK_OVE RRIDE;
98 #endif 96 #endif
99 97
100 SK_TO_STRING_OVERRIDE() 98 SK_TO_STRING_OVERRIDE()
101 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) 99 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
102 100
103 protected: 101 protected:
104 SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cro pRect* cropRect, uint32_t uniqueID) 102 SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const Cro pRect* cropRect)
105 : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {} 103 : INHERITED(radiusX, radiusY, input, cropRect) {}
106 104
107 private: 105 private:
108 typedef SkMorphologyImageFilter INHERITED; 106 typedef SkMorphologyImageFilter INHERITED;
109 }; 107 };
110 108
111 #endif 109 #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