aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkFlattenableSerialization.h2
-rw-r--r--src/core/SkValidatingReadBuffer.cpp8
2 files changed, 2 insertions, 8 deletions
diff --git a/include/core/SkFlattenableSerialization.h b/include/core/SkFlattenableSerialization.h
index ffb1b5ae97..c5ff06ac88 100644
--- a/include/core/SkFlattenableSerialization.h
+++ b/include/core/SkFlattenableSerialization.h
@@ -14,6 +14,6 @@ class SkData;
SK_API SkData* SkValidatingSerializeFlattenable(SkFlattenable*);
SK_API SkFlattenable* SkValidatingDeserializeFlattenable(const void* data, size_t size,
- SkFlattenable::Type type);
+ SkFlattenable::Type type = SkFlattenable::kSkUnused_Type);
#endif
diff --git a/src/core/SkValidatingReadBuffer.cpp b/src/core/SkValidatingReadBuffer.cpp
index ad4b6c409e..c80192f8b2 100644
--- a/src/core/SkValidatingReadBuffer.cpp
+++ b/src/core/SkValidatingReadBuffer.cpp
@@ -222,20 +222,14 @@ bool SkValidatingReadBuffer::validateAvailable(size_t size) {
return this->validate((size <= SK_MaxU32) && fReader.isAvailable(static_cast<uint32_t>(size)));
}
-SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type type) {
+SkFlattenable* SkValidatingReadBuffer::readFlattenable(SkFlattenable::Type) {
SkString name;
this->readString(&name);
if (fError) {
return nullptr;
}
- // Is this the type we wanted ?
const char* cname = name.c_str();
- SkFlattenable::Type baseType;
- if (!SkFlattenable::NameToType(cname, &baseType) || (baseType != type)) {
- return nullptr;
- }
-
SkFlattenable::Factory factory = SkFlattenable::NameToFactory(cname);
if (nullptr == factory) {
return nullptr; // writer failed to give us the flattenable