29 fActivelyRecording =
false;
40 fBBH = std::move(bbh);
45 fRecorder->reset(fRecord.
get(), cullRect);
46 fActivelyRecording =
true;
51 return this->
beginRecording(bounds, factory ? (*factory)() :
nullptr);
55 return fActivelyRecording ? fRecorder.get() :
nullptr;
68 fActivelyRecording =
false;
69 fRecorder->restoreToCount(1);
71 if (fRecord->
count() == 0) {
72 return sk_make_sp<SkEmptyPicture>();
79 std::unique_ptr<SkBigPicture::SnapshotArray> pictList{
92 for (
int i = 0;
i < fRecord->
count();
i++) {
100 size_t subPictureBytes = fRecorder->approxBytesUsedBySubPictures();
101 for (
int i = 0; pictList &&
i < pictList->count();
i++) {
102 subPictureBytes += pictList->begin()[
i]->approximateBytesUsed();
104 return sk_make_sp<SkBigPicture>(fCullRect,
112 fCullRect = cullRect;
117void SkPictureRecorder::partialReplay(
SkCanvas* canvas)
const {
118 if (
nullptr == canvas) {
122 int drawableCount = 0;
126 drawableCount = drawableList->
count();
127 drawables = drawableList->
begin();
129 SkRecordDraw(*fRecord, canvas,
nullptr, drawables, drawableCount,
nullptr,
nullptr);
133 fActivelyRecording =
false;
134 fRecorder->restoreToCount(1);
146 sk_make_sp<SkRecordedDrawable>(std::move(fRecord), std::move(fBBH),
147 fRecorder->detachDrawableList(), fCullRect);
void SkRecordFillBounds(const SkRect &cullRect, const SkRecord &record, SkRect bounds[], SkBBoxHierarchy::Metadata meta[])
void SkRecordDraw(const SkRecord &record, SkCanvas *canvas, SkPicture const *const drawablePicts[], SkDrawable *const drawables[], int drawableCount, const SkBBoxHierarchy *bbh, SkPicture::AbortCallback *callback)
void SkRecordOptimize(SkRecord *record)
virtual void insert(const SkRect[], int N)=0
SkBigPicture::SnapshotArray * newDrawableSnapshot()
SkDrawable *const * begin() const
SkRect cullRect() const override
size_t approximateBytesUsed() const override
void playback(SkCanvas *, AbortCallback *) const override
int approximateOpCount(bool nested) const override
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPictureWithCull(const SkRect &cullRect)
SkCanvas * getRecordingCanvas()
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkDrawable > finishRecordingAsDrawable()
void reset(T *ptr=nullptr)
Optional< SkRect > bounds
static constexpr SkRect MakeEmpty()
bool contains(SkScalar x, SkScalar y) const
void join(const SkRect &r)