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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 467 |
468 if (NULL != data) { | 468 if (NULL != data) { |
469 stream->writeBool(true); | 469 stream->writeBool(true); |
470 data->serialize(stream, encoder); | 470 data->serialize(stream, encoder); |
471 } else { | 471 } else { |
472 stream->writeBool(false); | 472 stream->writeBool(false); |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 // fRecord OK | 476 // fRecord OK |
477 void SkPicture::WriteTagSize(SkWriteBuffer& buffer, uint32_t tag, size_t size) { | |
478 buffer.writeUInt(tag); | |
479 buffer.writeUInt(SkToU32(size)); | |
480 } | |
481 | |
482 // fRecord OK | |
483 void SkPicture::WriteTagSize(SkWStream* stream, uint32_t tag, size_t size) { | |
484 stream->write32(tag); | |
485 stream->write32(SkToU32(size)); | |
486 } | |
487 | |
488 // fRecord OK | |
489 void SkPicture::flatten(SkWriteBuffer& buffer) const { | 477 void SkPicture::flatten(SkWriteBuffer& buffer) const { |
490 const SkPictureData* data = fData.get(); | 478 const SkPictureData* data = fData.get(); |
491 | 479 |
492 // If we're a new-format picture, backport to old format for serialization. | 480 // If we're a new-format picture, backport to old format for serialization. |
493 SkAutoTDelete<SkPicture> oldFormat; | 481 SkAutoTDelete<SkPicture> oldFormat; |
494 if (NULL == data && NULL != fRecord.get()) { | 482 if (NULL == data && NULL != fRecord.get()) { |
495 oldFormat.reset(backport(*fRecord, fWidth, fHeight)); | 483 oldFormat.reset(backport(*fRecord, fWidth, fHeight)); |
496 data = oldFormat->fData.get(); | 484 data = oldFormat->fData.get(); |
497 SkASSERT(NULL != data); | 485 SkASSERT(NULL != data); |
498 } | 486 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 543 } |
556 | 544 |
557 // fRecord OK | 545 // fRecord OK |
558 SkPicture::SkPicture(int width, int height, SkRecord* record) | 546 SkPicture::SkPicture(int width, int height, SkRecord* record) |
559 : fWidth(width) | 547 : fWidth(width) |
560 , fHeight(height) | 548 , fHeight(height) |
561 , fRecord(record) | 549 , fRecord(record) |
562 , fRecordWillPlayBackBitmaps(SkRecordWillPlaybackBitmaps(*record)) { | 550 , fRecordWillPlayBackBitmaps(SkRecordWillPlaybackBitmaps(*record)) { |
563 this->needsNewGenID(); | 551 this->needsNewGenID(); |
564 } | 552 } |
OLD | NEW |