diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-07 14:52:09 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-07 14:52:09 +0000 |
commit | 210a6aa8bd0c8031b2990caaa956b0ed5ce275ed (patch) | |
tree | 33d7a297167a42dc87620bb9ecdcc584d16a2731 /src/core/SkWriteBuffer.cpp | |
parent | 7fc2228795537a6202a4c25e63eada30dbcaf698 (diff) |
getFactory() must return a factory.
BUG=348821
R=reed@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/190843002
git-svn-id: http://skia.googlecode.com/svn/trunk@13702 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkWriteBuffer.cpp')
-rw-r--r-- | src/core/SkWriteBuffer.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp index 450c30ed5c..cca7d8170a 100644 --- a/src/core/SkWriteBuffer.cpp +++ b/src/core/SkWriteBuffer.cpp @@ -270,15 +270,9 @@ void SkWriteBuffer::writeFlattenable(const SkFlattenable* flattenable) { * The distinction is important, since 0-index is 32bits (always), but a * 0-functionptr might be 32 or 64 bits. */ - - SkFlattenable::Factory factory = NULL; - if (flattenable) { - factory = flattenable->getFactory(); - } - if (NULL == factory) { + if (NULL == flattenable) { if (this->isValidating()) { this->writeString(""); - SkASSERT(NULL == flattenable); // We shouldn't get in here in this scenario } else if (fFactorySet != NULL || fNamedFactorySet != NULL) { this->write32(0); } else { @@ -287,6 +281,9 @@ void SkWriteBuffer::writeFlattenable(const SkFlattenable* flattenable) { return; } + SkFlattenable::Factory factory = flattenable->getFactory(); + SkASSERT(factory != NULL); + /* * We can write 1 of 3 versions of the flattenable: * 1. function-ptr : this is the fastest for the reader, but assumes that |