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

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

Issue 24826002: Allow creating a picture from skp to fail. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix debugger. 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
« no previous file with comments | « debugger/QT/SkDebuggerGUI.cpp ('k') | src/core/SkPicturePlayback.h » ('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 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
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 9
10 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro c) { 303 SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro c) {
304 SkPictInfo info; 304 SkPictInfo info;
305 305
306 if (!StreamIsSKP(stream, &info)) { 306 if (!StreamIsSKP(stream, &info)) {
307 return NULL; 307 return NULL;
308 } 308 }
309 309
310 SkPicturePlayback* playback; 310 SkPicturePlayback* playback;
311 // Check to see if there is a playback to recreate. 311 // Check to see if there is a playback to recreate.
312 if (stream->readBool()) { 312 if (stream->readBool()) {
313 playback = SkNEW_ARGS(SkPicturePlayback, (stream, info, proc)); 313 playback = SkPicturePlayback::CreateFromStream(stream, info, proc);
314 if (NULL == playback) {
315 return NULL;
316 }
314 } else { 317 } else {
315 playback = NULL; 318 playback = NULL;
316 } 319 }
317 320
318 return SkNEW_ARGS(SkPicture, (playback, info.fWidth, info.fHeight)); 321 return SkNEW_ARGS(SkPicture, (playback, info.fWidth, info.fHeight));
319 } 322 }
320 323
321 void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const { 324 void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
322 SkPicturePlayback* playback = fPlayback; 325 SkPicturePlayback* playback = fPlayback;
323 326
(...skipping 28 matching lines...) Expand all
352 } 355 }
353 356
354 #ifdef SK_BUILD_FOR_ANDROID 357 #ifdef SK_BUILD_FOR_ANDROID
355 void SkPicture::abortPlayback() { 358 void SkPicture::abortPlayback() {
356 if (NULL == fPlayback) { 359 if (NULL == fPlayback) {
357 return; 360 return;
358 } 361 }
359 fPlayback->abort(); 362 fPlayback->abort();
360 } 363 }
361 #endif 364 #endif
OLDNEW
« no previous file with comments | « debugger/QT/SkDebuggerGUI.cpp ('k') | src/core/SkPicturePlayback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698