Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: src/core/SkWriteBuffer.cpp

Issue 190843002: getFactory() must return a factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: invert Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkWriteBuffer.cpp
diff --git a/src/core/SkWriteBuffer.cpp b/src/core/SkWriteBuffer.cpp
index 450c30ed5cdeeabe3628f3d5e0154462fd4beee2..cca7d8170ac52684b94ae4bf846fe43419bb03c5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698