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

Unified Diff: src/core/SkOrderedWriteBuffer.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Adapting code to sk_once changes Created 7 years, 2 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 | « src/core/SkOrderedReadBuffer.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkOrderedWriteBuffer.cpp
diff --git a/src/core/SkOrderedWriteBuffer.cpp b/src/core/SkOrderedWriteBuffer.cpp
index 9c31b4c4d7309c71b775376a8422da0bd19bd91c..1c15e43ef02eb08d7d434c2b893e0a1488f069ab 100644
--- a/src/core/SkOrderedWriteBuffer.cpp
+++ b/src/core/SkOrderedWriteBuffer.cpp
@@ -270,7 +270,10 @@ void SkOrderedWriteBuffer::writeFlattenable(const 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
+ } else if (fFactorySet != NULL || fNamedFactorySet != NULL) {
this->write32(0);
} else {
this->writeFunctionPtr(NULL);
@@ -290,7 +293,9 @@ void SkOrderedWriteBuffer::writeFlattenable(const 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->getTypeName());
+ } else if (fFactorySet) {
this->write32(fFactorySet->add(factory));
} else if (fNamedFactorySet) {
int32_t index = fNamedFactorySet->find(factory);
« no previous file with comments | « src/core/SkOrderedReadBuffer.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698