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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 *fDeletionListeners.append() = SkRef(listener); | 448 *fDeletionListeners.append() = SkRef(listener); |
449 } | 449 } |
450 | 450 |
451 void SkPicture::callDeletionListeners() { | 451 void SkPicture::callDeletionListeners() { |
452 for (int i = 0; i < fDeletionListeners.count(); ++i) { | 452 for (int i = 0; i < fDeletionListeners.count(); ++i) { |
453 fDeletionListeners[i]->onDeletion(this->uniqueID()); | 453 fDeletionListeners[i]->onDeletion(this->uniqueID()); |
454 } | 454 } |
455 | 455 |
456 fDeletionListeners.unrefAll(); | 456 fDeletionListeners.unrefAll(); |
457 } | 457 } |
| 458 |
| 459 // fRecord OK |
| 460 int SkPicture::approximateOpCount() const { |
| 461 SkASSERT(fRecord.get() || fData.get()); |
| 462 if (fRecord.get()) { |
| 463 return fRecord->count(); |
| 464 } |
| 465 if (fData.get()) { |
| 466 return fData->opCount(); |
| 467 } |
| 468 return 0; |
| 469 } |
OLD | NEW |