Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: src/core/SkPicture.cpp

Issue 748803005: SkPicture::SnapshotArray doesn't really stand to benefit from refcounting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698