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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 bool SkPicture::hasText() const { return fAnalysis.fHasText; } | 516 bool SkPicture::hasText() const { return fAnalysis.fHasText; } |
517 bool SkPicture::willPlayBackBitmaps() const { return fAnalysis.fWillPlaybackBitm
aps; } | 517 bool SkPicture::willPlayBackBitmaps() const { return fAnalysis.fWillPlaybackBitm
aps; } |
518 int SkPicture::approximateOpCount() const { return fRecord->count(); } | 518 int SkPicture::approximateOpCount() const { return fRecord->count(); } |
519 | 519 |
520 SkPicture::SkPicture(const SkRect& cullRect, SkRecord* record, SnapshotArray* dr
awablePicts, | 520 SkPicture::SkPicture(const SkRect& cullRect, SkRecord* record, SnapshotArray* dr
awablePicts, |
521 SkBBoxHierarchy* bbh) | 521 SkBBoxHierarchy* bbh) |
522 : fUniqueID(next_picture_generation_id()) | 522 : fUniqueID(next_picture_generation_id()) |
523 , fCullRect(cullRect) | 523 , fCullRect(cullRect) |
524 , fRecord(record) | 524 , fRecord(record) |
525 , fBBH(SkSafeRef(bbh)) | 525 , fBBH(SkSafeRef(bbh)) |
526 , fDrawablePicts(SkSafeRef(drawablePicts)) | 526 , fDrawablePicts(drawablePicts) |
527 , fAnalysis(*fRecord) | 527 , fAnalysis(*fRecord) |
528 {} | 528 {} |
529 | 529 |
530 // Note that we are assuming that this entry point will only be called from | 530 // Note that we are assuming that this entry point will only be called from |
531 // one thread. Currently the only client of this method is | 531 // one thread. Currently the only client of this method is |
532 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single | 532 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single |
533 // thread. | 533 // thread. |
534 void SkPicture::addDeletionListener(DeletionListener* listener) const { | 534 void SkPicture::addDeletionListener(DeletionListener* listener) const { |
535 SkASSERT(listener); | 535 SkASSERT(listener); |
536 | 536 |
537 *fDeletionListeners.append() = SkRef(listener); | 537 *fDeletionListeners.append() = SkRef(listener); |
538 } | 538 } |
539 | 539 |
540 void SkPicture::callDeletionListeners() { | 540 void SkPicture::callDeletionListeners() { |
541 for (int i = 0; i < fDeletionListeners.count(); ++i) { | 541 for (int i = 0; i < fDeletionListeners.count(); ++i) { |
542 fDeletionListeners[i]->onDeletion(this->uniqueID()); | 542 fDeletionListeners[i]->onDeletion(this->uniqueID()); |
543 } | 543 } |
544 | 544 |
545 fDeletionListeners.unrefAll(); | 545 fDeletionListeners.unrefAll(); |
546 } | 546 } |
OLD | NEW |