Index: src/effects/SkTileImageFilter.cpp |
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp |
index 73c0a581e98e5ae57c7e3cbcd7c92195a6d33a4c..64492e22753b73d3d4e77368370df1f940c4a66b 100644 |
--- a/src/effects/SkTileImageFilter.cpp |
+++ b/src/effects/SkTileImageFilter.cpp |
@@ -16,6 +16,14 @@ |
#include "SkShader.h" |
#include "SkValidationUtils.h" |
+SkTileImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect& dstRect, |
+ SkImageFilter* input) { |
+ if (!SkIsValidRect(srcRect) || !SkIsValidRect(dstRect)) { |
+ return NULL; |
+ } |
+ return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input)); |
+} |
+ |
bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, |
const Context& ctx, |
SkBitmap* dst, SkIPoint* offset) const { |
@@ -86,12 +94,22 @@ bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, |
return true; |
} |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkTileImageFilter::SkTileImageFilter(SkReadBuffer& buffer) |
: INHERITED(1, buffer) { |
buffer.readRect(&fSrcRect); |
buffer.readRect(&fDstRect); |
buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect(fDstRect)); |
} |
+#endif |
+ |
+SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) { |
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
+ SkRect src, dst; |
+ buffer.readRect(&src); |
+ buffer.readRect(&dst); |
+ return Create(src, dst, common.getInput(0)); |
+} |
void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |