Index: src/core/SkReadBuffer.cpp |
diff --git a/src/core/SkReadBuffer.cpp b/src/core/SkReadBuffer.cpp |
index f220b5a9e61581b35772b5514c1c6fd307e56d8d..c7bda21a4b159cf790eb74a78a2f145c3fec5df1 100644 |
--- a/src/core/SkReadBuffer.cpp |
+++ b/src/core/SkReadBuffer.cpp |
@@ -348,9 +348,16 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) { |
} |
factory = fFactoryArray[index]; |
} else { |
- factory = (SkFlattenable::Factory)readFunctionPtr(); |
- if (nullptr == factory) { |
- return nullptr; // writer failed to give us the flattenable |
+ SkString name; |
+ this->readString(&name); |
+ |
+ // Check if a custom Factory has been specified for this flattenable. |
reed1
2016/04/11 15:07:48
Is this order (checking custom first) important? D
msarett
2016/04/19 18:03:50
Yes I think we should check custom first. I've th
|
+ factory = getCustomFactory(name.c_str()); |
+ if (!factory) { |
+ factory = SkFlattenable::NameToFactory(name.c_str()); |
+ if (!factory) { |
+ return nullptr; // writer failed to give us the flattenable |
+ } |
} |
} |