| 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 624 |
| 625 // fRecord OK | 625 // fRecord OK |
| 626 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi
erarchy* bbh) | 626 SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHi
erarchy* bbh) |
| 627 : fCullWidth(width) | 627 : fCullWidth(width) |
| 628 , fCullHeight(height) | 628 , fCullHeight(height) |
| 629 , fRecord(optimized(record)) | 629 , fRecord(optimized(record)) |
| 630 , fBBH(SkSafeRef(bbh)) | 630 , fBBH(SkSafeRef(bbh)) |
| 631 , fAnalysis(*fRecord) { | 631 , fAnalysis(*fRecord) { |
| 632 // TODO: delay as much of this work until just before first playback? | 632 // TODO: delay as much of this work until just before first playback? |
| 633 if (fBBH.get()) { | 633 if (fBBH.get()) { |
| 634 SkRecordFillBounds(*fRecord, fBBH.get()); | 634 SkRecordFillBounds(this->cullRect(), *fRecord, fBBH.get()); |
| 635 } | 635 } |
| 636 this->needsNewGenID(); | 636 this->needsNewGenID(); |
| 637 } | 637 } |
| 638 | 638 |
| 639 // Note that we are assuming that this entry point will only be called from | 639 // Note that we are assuming that this entry point will only be called from |
| 640 // one thread. Currently the only client of this method is | 640 // one thread. Currently the only client of this method is |
| 641 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single | 641 // SkGpuDevice::EXPERIMENTAL_optimize which should be only called from a single |
| 642 // thread. | 642 // thread. |
| 643 void SkPicture::addDeletionListener(DeletionListener* listener) const { | 643 void SkPicture::addDeletionListener(DeletionListener* listener) const { |
| 644 SkASSERT(listener); | 644 SkASSERT(listener); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 658 int SkPicture::approximateOpCount() const { | 658 int SkPicture::approximateOpCount() const { |
| 659 SkASSERT(fRecord.get() || fData.get()); | 659 SkASSERT(fRecord.get() || fData.get()); |
| 660 if (fRecord.get()) { | 660 if (fRecord.get()) { |
| 661 return fRecord->count(); | 661 return fRecord->count(); |
| 662 } | 662 } |
| 663 if (fData.get()) { | 663 if (fData.get()) { |
| 664 return fData->opCount(); | 664 return fData->opCount(); |
| 665 } | 665 } |
| 666 return 0; | 666 return 0; |
| 667 } | 667 } |
| OLD | NEW |