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

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

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: New serialization method Created 7 years, 3 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 8
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkErrorInternals.h" 10 #include "SkErrorInternals.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (index) { 261 if (index) {
262 SkDebugf("====== typeface index %d\n", index); 262 SkDebugf("====== typeface index %d\n", index);
263 } 263 }
264 return NULL; 264 return NULL;
265 } else { 265 } else {
266 SkASSERT(fTFArray); 266 SkASSERT(fTFArray);
267 return fTFArray[index - 1]; 267 return fTFArray[index - 1];
268 } 268 }
269 } 269 }
270 270
271 SkFlattenable* SkOrderedReadBuffer::readFlattenable() { 271 SkFlattenable* SkOrderedReadBuffer::readFlattenable(SkFlattenable::Type) {
mtklein 2013/09/24 22:52:18 A little // We ignore this Type parameter here bec
sugoi1 2013/09/25 21:15:27 Done.
272 SkFlattenable::Factory factory = NULL; 272 SkFlattenable::Factory factory = NULL;
273 273
274 if (fFactoryCount > 0) { 274 if (fFactoryCount > 0) {
275 int32_t index = fReader.readU32(); 275 int32_t index = fReader.readU32();
276 if (0 == index) { 276 if (0 == index) {
277 return NULL; // writer failed to give us the flattenable 277 return NULL; // writer failed to give us the flattenable
278 } 278 }
279 index -= 1; // we stored the index-base-1 279 index -= 1; // we stored the index-base-1
280 SkASSERT(index < fFactoryCount); 280 SkASSERT(index < fFactoryCount);
281 factory = fFactoryArray[index]; 281 factory = fFactoryArray[index];
(...skipping 23 matching lines...) Expand all
305 if (sizeRecorded != sizeRead) { 305 if (sizeRecorded != sizeRead) {
306 // we could try to fix up the offset... 306 // we could try to fix up the offset...
307 sk_throw(); 307 sk_throw();
308 } 308 }
309 } else { 309 } else {
310 // we must skip the remaining data 310 // we must skip the remaining data
311 fReader.skip(sizeRecorded); 311 fReader.skip(sizeRecorded);
312 } 312 }
313 return obj; 313 return obj;
314 } 314 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698