Index: src/effects/SkMergeImageFilter.cpp |
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp |
index d932d3ccce50a05ffd5689cece10a926d3a16ada..9e7f4e543c743f9cc1afb5f98c30ece44cff8ab8 100755 |
--- a/src/effects/SkMergeImageFilter.cpp |
+++ b/src/effects/SkMergeImageFilter.cpp |
@@ -140,3 +140,24 @@ |
buffer.writeByteArray(fModes, countInputs() * sizeof(fModes[0])); |
} |
} |
+ |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
+SkMergeImageFilter::SkMergeImageFilter(SkReadBuffer& buffer) |
+ : INHERITED(-1, buffer) { |
+ bool hasModes = buffer.readBool(); |
+ if (hasModes) { |
+ this->initAllocModes(); |
+ int nbInputs = countInputs(); |
+ size_t size = nbInputs * sizeof(fModes[0]); |
+ SkASSERT(buffer.getArrayCount() == size); |
+ if (buffer.validate(buffer.getArrayCount() == size) && |
+ buffer.readByteArray(fModes, size)) { |
+ for (int i = 0; i < nbInputs; ++i) { |
+ buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i])); |
+ } |
+ } |
+ } else { |
+ fModes = 0; |
+ } |
+} |
+#endif |