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

Unified Diff: src/effects/SkPictureImageFilter.cpp

Issue 138063005: Serialization of SkPictureImageFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Code ifdefed out 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
« src/core/SkPicturePlayback.cpp ('K') | « src/core/SkPicturePlayback.cpp ('k') | no next file » | 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 ae9576043f994c3142294fde0dbcb30acf750a3a..66494fbc7143bf56850f62f1eab90be84e9f5e8d 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -34,13 +34,23 @@ SkPictureImageFilter::~SkPictureImageFilter() {
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);
+ }
+#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);
Stephen White 2014/02/05 16:44:39 Maybe we should just writeBool(false) (and readBoo
sugoi1 2014/02/05 16:48:58 Good idea, I'll do that.
+ if (hasPicture) {
+ fPicture->flatten(buffer);
+ }
+#endif
buffer.writeRect(fRect);
}
« src/core/SkPicturePlayback.cpp ('K') | « src/core/SkPicturePlayback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698