Index: src/effects/SkOffsetImageFilter.cpp |
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp |
index 57f36db113ca066c6bcb00019c17eb53076659a6..fcf09cc4eb54374228916526beb7c0fba6788995 100644 |
--- a/src/effects/SkOffsetImageFilter.cpp |
+++ b/src/effects/SkOffsetImageFilter.cpp |
@@ -91,6 +91,13 @@ bool SkOffsetImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm |
return true; |
} |
+SkFlattenable* SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) { |
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
+ SkPoint offset; |
+ buffer.readPoint(&offset); |
+ return Create(offset.x(), offset.y(), common.getInput(0), &common.cropRect()); |
+} |
+ |
void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |
buffer.writePoint(fOffset); |
@@ -102,9 +109,11 @@ SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter |
fOffset.set(dx, dy); |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkOffsetImageFilter::SkOffsetImageFilter(SkReadBuffer& buffer) |
: INHERITED(1, buffer) { |
buffer.readPoint(&fOffset); |
buffer.validate(SkScalarIsFinite(fOffset.fX) && |
SkScalarIsFinite(fOffset.fY)); |
} |
+#endif |