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

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: Adapting code to sk_once changes Created 7 years, 1 month 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
« no previous file with comments | « src/core/SkOrderedReadBuffer.h ('k') | src/core/SkOrderedWriteBuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(SkEffectType et) { 271 SkFlattenable* SkOrderedReadBuffer::readFlattenable(SkFlattenable::Type ft) {
272 // 272 //
273 // TODO: confirm that et matches the factory we decide to use 273 // TODO: confirm that ft matches the factory we decide to use
274 // 274 //
275 275
276 SkFlattenable::Factory factory = NULL; 276 SkFlattenable::Factory factory = NULL;
277 277
278 if (fFactoryCount > 0) { 278 if (fFactoryCount > 0) {
279 int32_t index = fReader.readU32(); 279 int32_t index = fReader.readU32();
280 if (0 == index) { 280 if (0 == index) {
281 return NULL; // writer failed to give us the flattenable 281 return NULL; // writer failed to give us the flattenable
282 } 282 }
283 index -= 1; // we stored the index-base-1 283 index -= 1; // we stored the index-base-1
(...skipping 25 matching lines...) Expand all
309 if (sizeRecorded != sizeRead) { 309 if (sizeRecorded != sizeRead) {
310 // we could try to fix up the offset... 310 // we could try to fix up the offset...
311 sk_throw(); 311 sk_throw();
312 } 312 }
313 } else { 313 } else {
314 // we must skip the remaining data 314 // we must skip the remaining data
315 fReader.skip(sizeRecorded); 315 fReader.skip(sizeRecorded);
316 } 316 }
317 return obj; 317 return obj;
318 } 318 }
OLDNEW
« no previous file with comments | « src/core/SkOrderedReadBuffer.h ('k') | src/core/SkOrderedWriteBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698