OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "SkPictureFlat.h" | 9 #include "SkPictureFlat.h" |
10 #include "SkPictureData.h" | 10 #include "SkPictureData.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 SkASSERT(fEncoder); | 465 SkASSERT(fEncoder); |
466 } | 466 } |
467 | 467 |
468 bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; } | 468 bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; } |
469 | 469 |
470 SkData* onEncodePixels(const SkImageInfo& info, const void* pixels, | 470 SkData* onEncodePixels(const SkImageInfo& info, const void* pixels, |
471 size_t rowBytes) SK_OVERRIDE { | 471 size_t rowBytes) SK_OVERRIDE { |
472 // Required by signature of EncodeBitmap. | 472 // Required by signature of EncodeBitmap. |
473 size_t unused; | 473 size_t unused; |
474 SkBitmap bm; | 474 SkBitmap bm; |
475 bm.installPixels(info, pixels, rowBytes); | 475 bm.installPixels(info, const_cast<void*>(pixels), rowBytes); |
476 return fEncoder(&unused, bm); | 476 return fEncoder(&unused, bm); |
477 } | 477 } |
478 | 478 |
479 private: | 479 private: |
480 SkPicture::EncodeBitmap fEncoder; | 480 SkPicture::EncodeBitmap fEncoder; |
481 }; | 481 }; |
482 | 482 |
483 void SkPicture::serialize(SkWStream* wStream, SkPicture::EncodeBitmap encoder) c
onst { | 483 void SkPicture::serialize(SkWStream* wStream, SkPicture::EncodeBitmap encoder) c
onst { |
484 EncodeBitmapSerializer serializer(encoder); | 484 EncodeBitmapSerializer serializer(encoder); |
485 this->serialize(wStream, &serializer); | 485 this->serialize(wStream, &serializer); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 SkPicture::SkPicture(const SkRect& cullRect, SkRecord* record, SnapshotArray* dr
awablePicts, | 533 SkPicture::SkPicture(const SkRect& cullRect, SkRecord* record, SnapshotArray* dr
awablePicts, |
534 SkBBoxHierarchy* bbh) | 534 SkBBoxHierarchy* bbh) |
535 : fUniqueID(next_picture_generation_id()) | 535 : fUniqueID(next_picture_generation_id()) |
536 , fCullRect(cullRect) | 536 , fCullRect(cullRect) |
537 , fRecord(SkRef(record)) | 537 , fRecord(SkRef(record)) |
538 , fBBH(SkSafeRef(bbh)) | 538 , fBBH(SkSafeRef(bbh)) |
539 , fDrawablePicts(drawablePicts) // take ownership | 539 , fDrawablePicts(drawablePicts) // take ownership |
540 , fAnalysis(*fRecord) | 540 , fAnalysis(*fRecord) |
541 {} | 541 {} |
OLD | NEW |