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

Unified Diff: src/effects/SkPictureImageFilter.cpp

Issue 143163005: Revert of Revert "Serialization of SkPictureImageFilter" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698