Index: include/core/SkImageFilter.h |
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h |
index cd34ba3f91bd55664c05ce46a6e268003e22ba8f..3fd046e7daaa70bfc8c42adcac55d01e93d21385 100644 |
--- a/include/core/SkImageFilter.h |
+++ b/include/core/SkImageFilter.h |
@@ -205,12 +205,21 @@ protected: |
Common() {} |
~Common(); |
+ /** |
+ * Attempt to unflatten the cropRect and the expected number of input filters. |
+ * If any number of input filters is valid, pass -1. |
+ * If this fails (i.e. corrupt buffer or contents) then return false and common will |
+ * be left uninitialized. |
+ * If this returns true, then inputCount() is the number of found input filters, each |
+ * of which may be NULL or a valid imagefilter. |
+ */ |
bool unflatten(SkReadBuffer&, int expectedInputs = -1); |
- CropRect cropRect() const { return fCropRect; } |
+ const CropRect& cropRect() const { return fCropRect; } |
int inputCount() const { return fInputs.count(); } |
SkImageFilter** inputs() const { return fInputs.get(); } |
- |
+ SkImageFilter* inputAt(int index) const { return fInputs[index]; } |
+ |
// If the caller wants a copy of the inputs, call this and it will transfer ownership |
// of the unflattened input filters to the caller. This is just a short-cut for copying |
// the inputs, calling ref() on each, and then waiting for Common's destructor to call |
@@ -238,7 +247,7 @@ protected: |
*/ |
explicit SkImageFilter(int inputCount, SkReadBuffer& rb); |
- virtual void flatten(SkWriteBuffer& wb) const SK_OVERRIDE; |
+ void flattenCommon(SkWriteBuffer&) const; |
/** |
* This is the virtual which should be overridden by the derived class |