Chromium Code Reviews| Index: src/core/SkOrderedWriteBuffer.cpp |
| diff --git a/src/core/SkOrderedWriteBuffer.cpp b/src/core/SkOrderedWriteBuffer.cpp |
| index 64f52193acaf7c55dab611a5b53f41f13685fd7e..fd39a8e52102ba984cef59d07cd4bf703f020883 100644 |
| --- a/src/core/SkOrderedWriteBuffer.cpp |
| +++ b/src/core/SkOrderedWriteBuffer.cpp |
| @@ -270,7 +270,10 @@ void SkOrderedWriteBuffer::writeFlattenable(SkFlattenable* flattenable) { |
| factory = flattenable->getFactory(); |
| } |
| if (NULL == factory) { |
| - if (fFactorySet != NULL || fNamedFactorySet != NULL) { |
| + if (this->isValidating()) { |
| + this->writeString(""); |
| + SkASSERT(NULL == flattenable); // We shouldn't get in here in this scenario |
|
sugoi1
2013/10/07 15:54:08
I made a small change here, since NULL flattenable
mtklein
2013/10/07 19:29:56
Huh. Have you seen a NULL flattenable come throug
sugoi1
2013/10/08 20:23:10
Yes, in SkXfermodeImageFilter, fMode can be NULL,
|
| + } else if (fFactorySet != NULL || fNamedFactorySet != NULL) { |
| this->write32(0); |
| } else { |
| this->writeFunctionPtr(NULL); |
| @@ -290,7 +293,9 @@ void SkOrderedWriteBuffer::writeFlattenable(SkFlattenable* flattenable) { |
| * name. SkGPipe uses this technique so it can write the name to its |
| * stream before writing the flattenable. |
| */ |
| - if (fFactorySet) { |
| + if (this->isValidating()) { |
| + this->writeString(flattenable->getFlattenableName()); |
| + } else if (fFactorySet) { |
| this->write32(fFactorySet->add(factory)); |
| } else if (fNamedFactorySet) { |
| int32_t index = fNamedFactorySet->find(factory); |