sk_sp<SkPicture> SkPictureRecorder::finishRecordingAsPicture() {
fActivelyRecording = false;
fRecorder->restoreToCount(1); // If we were missing any restores, add them now.
if (fRecord->count() == 0) { return sk_make_sp<SkEmptyPicture>();
}
// TODO: delay as much of this work until just before first playback?
SkRecordOptimize(fRecord.get());
// Now that we've calculated content bounds, we can update fCullRect, often trimming it.
SkRect bbhBound = SkRect::MakeEmpty(); for (int i = 0; i < fRecord->count(); i++) {
bbhBound.join(bounds[i]);
}
SkASSERT((bbhBound.isEmpty() || fCullRect.contains(bbhBound))
|| (bbhBound.isEmpty() && fCullRect.isEmpty()));
fCullRect = bbhBound;
}
size_t subPictureBytes = fRecorder->approxBytesUsedBySubPictures(); for (int i = 0; pictList && i < pictList->count(); i++) {
subPictureBytes += pictList->begin()[i]->approximateBytesUsed();
} return sk_make_sp<SkBigPicture>(fCullRect,
std::move(fRecord),
std::move(pictList),
std::move(fBBH),
subPictureBytes);
}
sk_sp<SkDrawable> SkPictureRecorder::finishRecordingAsDrawable() {
fActivelyRecording = false;
fRecorder->restoreToCount(1); // If we were missing any restores, add them now.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.