Index: src/effects/SkPictureImageFilter.cpp |
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp |
index c78b2499ec1cc35fd0542edeb9f9ec4e77999aa7..6e76231867e785e56d5dfde34685f6cd5815b180 100644 |
--- a/src/effects/SkPictureImageFilter.cpp |
+++ b/src/effects/SkPictureImageFilter.cpp |
@@ -34,13 +34,27 @@ |
SkPictureImageFilter::SkPictureImageFilter(SkReadBuffer& buffer) |
: INHERITED(0, buffer), |
fPicture(NULL) { |
- // FIXME: unflatten picture here. |
+#ifdef SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION |
+ if (buffer.readBool()) { |
+ fPicture = SkPicture::CreateFromBuffer(buffer); |
+ } |
+#else |
+ buffer.readBool(); |
+#endif |
buffer.readRect(&fRect); |
} |
void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |
- // FIXME: flatten picture here. |
+#ifdef SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION |
+ bool hasPicture = (fPicture != NULL); |
+ buffer.writeBool(hasPicture); |
+ if (hasPicture) { |
+ fPicture->flatten(buffer); |
+ } |
+#else |
+ buffer.writeBool(false); |
+#endif |
buffer.writeRect(fRect); |
} |