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

Unified Diff: src/effects/SkPictureImageFilter.cpp

Issue 834673006: Require explicit disabling of cross process pictureimagefilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unit test Created 5 years, 11 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 | « no previous file | 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 37d86ce0d2be256bd82e12fcdda26d8f8326823c..391af1116927aca5903923a65b28aa780e52f5ed 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -39,12 +39,15 @@ SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) {
SkAutoTUnref<SkPicture> picture;
SkRect cropRect;
- if (!buffer.isCrossProcess()) {
+#ifdef SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS
+ if (buffer.isCrossProcess()) {
+ buffer.validate(!buffer.readBool());
+ } else
+#endif
+ {
if (buffer.readBool()) {
picture.reset(SkPicture::CreateFromBuffer(buffer));
}
- } else {
- buffer.validate(!buffer.readBool());
}
buffer.readRect(&cropRect);
PictureResolution pictureResolution;
@@ -68,14 +71,17 @@ SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) {
}
void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const {
- if (!buffer.isCrossProcess()) {
+#ifdef SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS
+ if (buffer.isCrossProcess()) {
+ buffer.writeBool(false);
+ } else
+#endif
+ {
bool hasPicture = (fPicture != NULL);
buffer.writeBool(hasPicture);
if (hasPicture) {
fPicture->flatten(buffer);
}
- } else {
- buffer.writeBool(false);
}
buffer.writeRect(fCropRect);
buffer.writeInt(fPictureResolution);
« no previous file with comments | « no previous file | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698