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;
}
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);
canvas.clear(0x0);
canvas.drawPicture(crossProcessPicture);
pixel = *bitmap.getAddr32(0, 0);
+#ifdef SK_DISALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS
// The result here should not be green, since the filter draws nothing.
REPORTER_ASSERT(reporter, pixel != SK_ColorGREEN);
+#else
+ REPORTER_ASSERT(reporter, pixel == SK_ColorGREEN);
+#endif
}
DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) {