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

Unified Diff: src/effects/SkPictureImageFilter.cpp

Issue 311443003: Allow SkPictureImageFilter to be serialized when not run cross-process. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix comment Created 6 years, 7 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 | « samplecode/SampleFilterFuzz.cpp ('k') | tests/ImageFilterTest.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 a2f558f20287ddf6bea74bc371bf2b4fdc090576..af9466f977620b243b9a0c7b3f17a7b62e75aa3e 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -34,27 +34,27 @@ SkPictureImageFilter::~SkPictureImageFilter() {
SkPictureImageFilter::SkPictureImageFilter(SkReadBuffer& buffer)
: INHERITED(0, buffer),
fPicture(NULL) {
-#ifdef SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION
- if (buffer.readBool()) {
- fPicture = SkPicture::CreateFromBuffer(buffer);
+ if (!buffer.isCrossProcess()) {
+ if (buffer.readBool()) {
+ fPicture = SkPicture::CreateFromBuffer(buffer);
+ }
+ } else {
+ buffer.validate(!buffer.readBool());
}
-#else
- buffer.readBool();
-#endif
buffer.readRect(&fCropRect);
}
void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
-#ifdef SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION
- bool hasPicture = (fPicture != NULL);
- buffer.writeBool(hasPicture);
- if (hasPicture) {
- fPicture->flatten(buffer);
+ if (!buffer.isCrossProcess()) {
+ bool hasPicture = (fPicture != NULL);
+ buffer.writeBool(hasPicture);
+ if (hasPicture) {
+ fPicture->flatten(buffer);
+ }
+ } else {
+ buffer.writeBool(false);
}
-#else
- buffer.writeBool(false);
-#endif
buffer.writeRect(fCropRect);
}
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698