| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |