Index: src/core/SkFlattenableSerialization.cpp |
diff --git a/src/core/SkFlattenableSerialization.cpp b/src/core/SkFlattenableSerialization.cpp |
index c6870749e9d74f51caca647daba7507a2e5c0461..b98d935ca7d4ba4dfa48036f6ab17715f66336ab 100644 |
--- a/src/core/SkFlattenableSerialization.cpp |
+++ b/src/core/SkFlattenableSerialization.cpp |
@@ -8,14 +8,12 @@ |
#include "SkFlattenableSerialization.h" |
#include "SkData.h" |
-#include "SkFlattenable.h" |
-#include "SkImageFilter.h" |
-#include "SkOrderedReadBuffer.h" |
+#include "SkValidatingReadBuffer.h" |
#include "SkOrderedWriteBuffer.h" |
-SkData* SkSerializeFlattenable(SkFlattenable* flattenable) { |
+SkData* SkValidatingSerializeFlattenable(SkFlattenable* flattenable) { |
SkOrderedWriteBuffer writer(1024); |
- writer.setFlags(SkOrderedWriteBuffer::kCrossProcess_Flag); |
+ writer.setFlags(SkOrderedWriteBuffer::kValidation_Flag); |
writer.writeFlattenable(flattenable); |
uint32_t size = writer.bytesWritten(); |
void* data = sk_malloc_throw(size); |
@@ -23,8 +21,8 @@ SkData* SkSerializeFlattenable(SkFlattenable* flattenable) { |
return SkData::NewFromMalloc(data, size); |
} |
-// TODO: this guy should be renamed to ImageFilter, or take SkFlattenable::Type as a parameter. |
-SkFlattenable* SkDeserializeFlattenable(const void* data, size_t size) { |
- SkOrderedReadBuffer buffer(data, size); |
- return buffer.readImageFilter(); |
+SkFlattenable* SkValidatingDeserializeFlattenable(const void* data, size_t size, |
+ SkFlattenable::Type type) { |
+ SkValidatingReadBuffer buffer(data, size); |
+ return buffer.readFlattenable(type); |
} |