| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 char magic[sizeof(kMagic)]; | 277 char magic[sizeof(kMagic)]; |
| 278 stream->read(magic, sizeof(kMagic)); | 278 stream->read(magic, sizeof(kMagic)); |
| 279 if (0 != memcmp(magic, kMagic, sizeof(kMagic))) { | 279 if (0 != memcmp(magic, kMagic, sizeof(kMagic))) { |
| 280 return false; | 280 return false; |
| 281 } | 281 } |
| 282 | 282 |
| 283 SkPictInfo info; | 283 SkPictInfo info; |
| 284 if (!stream->read(&info, sizeof(SkPictInfo))) { | 284 if (!stream->read(&info, sizeof(SkPictInfo))) { |
| 285 return false; | 285 return false; |
| 286 } | 286 } |
| 287 if (PICTURE_VERSION != info.fVersion | 287 if (PICTURE_VERSION != info.fVersion) { |
| 288 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V13_AND_ALL_OTHER_INSTANCES_TO
O | |
| 289 // V13 is backwards compatible with V12 | |
| 290 && PRIOR_PRIOR_PICTURE_VERSION != info.fVersion // TODO: remove when .s
kps regenerated | |
| 291 #endif | |
| 292 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V14_AND_ALL_OTHER_INSTANCES_TO
O | |
| 293 // V14 is backwards compatible with V13 | |
| 294 && PRIOR_PICTURE_VERSION2 != info.fVersion // TODO: remove when .skps r
egenerated | |
| 295 #endif | |
| 296 ) { | |
| 297 return false; | 288 return false; |
| 298 } | 289 } |
| 299 | 290 |
| 300 if (pInfo != NULL) { | 291 if (pInfo != NULL) { |
| 301 *pInfo = info; | 292 *pInfo = info; |
| 302 } | 293 } |
| 303 return true; | 294 return true; |
| 304 } | 295 } |
| 305 | 296 |
| 306 SkPicture::SkPicture(SkPicturePlayback* playback, int width, int height) | 297 SkPicture::SkPicture(SkPicturePlayback* playback, int width, int height) |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 364 } |
| 374 | 365 |
| 375 #ifdef SK_BUILD_FOR_ANDROID | 366 #ifdef SK_BUILD_FOR_ANDROID |
| 376 void SkPicture::abortPlayback() { | 367 void SkPicture::abortPlayback() { |
| 377 if (NULL == fPlayback) { | 368 if (NULL == fPlayback) { |
| 378 return; | 369 return; |
| 379 } | 370 } |
| 380 fPlayback->abort(); | 371 fPlayback->abort(); |
| 381 } | 372 } |
| 382 #endif | 373 #endif |
| OLD | NEW |