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

Side by Side Diff: include/core/SkImageFilter.h

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 #ifndef SkImageFilter_DEFINED 8 #ifndef SkImageFilter_DEFINED
9 #define SkImageFilter_DEFINED 9 #define SkImageFilter_DEFINED
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter) 200 SK_DEFINE_FLATTENABLE_TYPE(SkImageFilter)
201 201
202 protected: 202 protected:
203 class Common { 203 class Common {
204 public: 204 public:
205 Common() {} 205 Common() {}
206 ~Common(); 206 ~Common();
207 207
208 bool unflatten(SkReadBuffer&, int expectedInputs = -1); 208 bool unflatten(SkReadBuffer&, int expectedInputs = -1);
209 209
210 CropRect cropRect() const { return fCropRect; } 210 const CropRect& cropRect() const { return fCropRect; }
211 int inputCount() const { return fInputs.count(); } 211 int inputCount() const { return fInputs.count(); }
212 SkImageFilter** inputs() const { return fInputs.get(); } 212 SkImageFilter** inputs() const { return fInputs.get(); }
213 213
214 // If the caller wants a copy of the inputs, call this and it will trans fer ownership 214 // If the caller wants a copy of the inputs, call this and it will trans fer ownership
215 // of the unflattened input filters to the caller. This is just a short- cut for copying 215 // of the unflattened input filters to the caller. This is just a short- cut for copying
216 // the inputs, calling ref() on each, and then waiting for Common's dest ructor to call 216 // the inputs, calling ref() on each, and then waiting for Common's dest ructor to call
217 // unref() on each. 217 // unref() on each.
218 void detachInputs(SkImageFilter** inputs); 218 void detachInputs(SkImageFilter** inputs);
219 219
220 private: 220 private:
(...skipping 10 matching lines...) Expand all
231 231
232 /** 232 /**
233 * Constructs a new SkImageFilter read from an SkReadBuffer object. 233 * Constructs a new SkImageFilter read from an SkReadBuffer object.
234 * 234 *
235 * @param inputCount The exact number of inputs expected for this SkImag eFilter object. 235 * @param inputCount The exact number of inputs expected for this SkImag eFilter object.
236 * -1 can be used if the filter accepts any number of inputs. 236 * -1 can be used if the filter accepts any number of inputs.
237 * @param rb SkReadBuffer object from which the SkImageFilter is read. 237 * @param rb SkReadBuffer object from which the SkImageFilter is read.
238 */ 238 */
239 explicit SkImageFilter(int inputCount, SkReadBuffer& rb); 239 explicit SkImageFilter(int inputCount, SkReadBuffer& rb);
240 240
241 virtual void flatten(SkWriteBuffer& wb) const SK_OVERRIDE; 241 void flattenCommon(SkWriteBuffer&) const;
Stephen White 2014/07/17 21:29:00 Now that we have a flattenCommon(), would it make
242 242
243 /** 243 /**
244 * This is the virtual which should be overridden by the derived class 244 * This is the virtual which should be overridden by the derived class
245 * to perform image filtering. 245 * to perform image filtering.
246 * 246 *
247 * src is the original primitive bitmap. If the filter has a connected 247 * src is the original primitive bitmap. If the filter has a connected
248 * input, it should recurse on that input and use that in place of src. 248 * input, it should recurse on that input and use that in place of src.
249 * 249 *
250 * The matrix is the current matrix on the canvas. 250 * The matrix is the current matrix on the canvas.
251 * 251 *
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 const SkIRect& bounds) const; 308 const SkIRect& bounds) const;
309 309
310 private: 310 private:
311 typedef SkFlattenable INHERITED; 311 typedef SkFlattenable INHERITED;
312 int fInputCount; 312 int fInputCount;
313 SkImageFilter** fInputs; 313 SkImageFilter** fInputs;
314 CropRect fCropRect; 314 CropRect fCropRect;
315 }; 315 };
316 316
317 #endif 317 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698