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

Side by Side Diff: src/core/SkFlattenableBuffers.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Serialization with strings as ID 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkFlattenableBuffers.h" 8 #include "SkFlattenableBuffers.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
11 11
12 SkFlattenableReadBuffer::SkFlattenableReadBuffer() { 12 SkFlattenableReadBuffer::SkFlattenableReadBuffer() :
13 fError(false) {
mtklein 2013/10/07 19:29:56 This is what makes me think fError doesn't really
13 // Set default values. These should be explicitly set by our client 14 // Set default values. These should be explicitly set by our client
14 // via setFlags() if the buffer came from serialization. 15 // via setFlags() if the buffer came from serialization.
15 fFlags = 0; 16 fFlags = 0;
16 #ifdef SK_SCALAR_IS_FLOAT 17 #ifdef SK_SCALAR_IS_FLOAT
17 fFlags |= kScalarIsFloat_Flag; 18 fFlags |= kScalarIsFloat_Flag;
18 #endif 19 #endif
19 if (8 == sizeof(void*)) { 20 if (8 == sizeof(void*)) {
20 fFlags |= kPtrIs64Bit_Flag; 21 fFlags |= kPtrIs64Bit_Flag;
21 } 22 }
22 } 23 }
(...skipping 24 matching lines...) Expand all
47 this->writeByteArray(ptrStorage, sizeof(void*)); 48 this->writeByteArray(ptrStorage, sizeof(void*));
48 } 49 }
49 50
50 void SkFlattenableWriteBuffer::writePaint(const SkPaint& paint) { 51 void SkFlattenableWriteBuffer::writePaint(const SkPaint& paint) {
51 paint.flatten(*this); 52 paint.flatten(*this);
52 } 53 }
53 54
54 void SkFlattenableWriteBuffer::flattenObject(SkFlattenable* obj, SkFlattenableWr iteBuffer& buffer) { 55 void SkFlattenableWriteBuffer::flattenObject(SkFlattenable* obj, SkFlattenableWr iteBuffer& buffer) {
55 obj->flatten(buffer); 56 obj->flatten(buffer);
56 } 57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698