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

Unified Diff: src/effects/SkPictureImageFilter.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkPixelXorXfermode.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 508f53edc2ac815ff62aa88dfbc504bb3fc43063..a1958f384e08dc25581e8cd07f69b67dd46436d2 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -31,6 +31,7 @@ SkPictureImageFilter::~SkPictureImageFilter() {
SkSafeUnref(fPicture);
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkPictureImageFilter::SkPictureImageFilter(SkReadBuffer& buffer)
: INHERITED(0, buffer),
fPicture(NULL) {
@@ -43,9 +44,25 @@ SkPictureImageFilter::SkPictureImageFilter(SkReadBuffer& buffer)
}
buffer.readRect(&fCropRect);
}
+#endif
+
+SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SkAutoTUnref<SkPicture> picture;
+ SkRect cropRect;
+
+ if (!buffer.isCrossProcess()) {
+ if (buffer.readBool()) {
+ picture.reset(SkPicture::CreateFromBuffer(buffer));
+ }
+ } else {
+ buffer.validate(!buffer.readBool());
+ }
+ buffer.readRect(&cropRect);
+
+ return Create(picture, cropRect);
+}
void SkPictureImageFilter::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
if (!buffer.isCrossProcess()) {
bool hasPicture = (fPicture != NULL);
buffer.writeBool(hasPicture);
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/effects/SkPixelXorXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698