sk_sp<SkPicture> SkRecordedDrawable::onMakePictureSnapshot() { // TODO: should we plumb-down the BBHFactory and recordFlags from our host // PictureRecorder?
std::unique_ptr<SkBigPicture::SnapshotArray> pictList{
fDrawableList ? fDrawableList->newDrawableSnapshot() : nullptr
};
size_t subPictureBytes = 0; for (int i = 0; pictList && i < pictList->count(); i++) {
subPictureBytes += pictList->begin()[i]->approximateBytesUsed();
} return sk_make_sp<SkBigPicture>(fBounds, fRecord, std::move(pictList), fBBH, subPictureBytes);
}
void SkRecordedDrawable::flatten(SkWriteBuffer& buffer) const { // Write the bounds.
buffer.writeRect(fBounds);
// Create an SkPictureRecord to record the draw commands.
SkPictInfo info;
SkPictureRecord pictureRecord(SkISize::Make(fBounds.width(), fBounds.height()), 0);
// If the query contains the whole picture, don't bother with the bounding box hierarchy.
SkBBoxHierarchy* bbh; if (pictureRecord.getLocalClipBounds().contains(fBounds)) {
bbh = nullptr;
} else {
bbh = fBBH.get();
}
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.