class SkBlender; class SkData; class SkImage; class SkM44; class SkMaskFilter; class SkMatrix; class SkPath; class SkRRect; class SkRegion; class SkString; class SkTypeface; struct SkPoint3;
/** * Returns true IFF the version is older than the specified version.
*/ bool isVersionLT(SkPicturePriv::Version targetVersion) const {
SkASSERT(targetVersion > 0); return fVersion > 0 && fVersion < targetVersion;
}
uint32_t getVersion() const { return fVersion; }
/** This may be called at most once; most clients of SkReadBuffer should not mess with it. */ void setVersion(int version) {
SkASSERT(0 == fVersion || version == fVersion);
fVersion = version;
}
// helpers to get info about arrays and binary data
uint32_t getArrayCount();
// If there is a real error (e.g. data is corrupted) this returns null. If the image cannot // be created (e.g. it was not originally encoded) then this returns an image that doesn't // draw.
sk_sp<SkImage> readImage();
sk_sp<SkTypeface> readTypeface();
/** * Call this with a pre-loaded array of Factories, in the same order as * were created/written by the writer. SkPicture uses this.
*/ void setFactoryPlayback(SkFlattenable::Factory array[], int count) {
fFactoryArray = array;
fFactoryCount = count;
}
/** * If isValid is false, sets the buffer to be "invalid". Returns true if the buffer * is still valid.
*/ bool validate(bool isValid) { if (!isValid) {
this->setInvalid();
} return !fError;
}
/** * Helper function to do a preflight check before a large allocation or read. * Returns true if there is enough bytes in the buffer to read n elements of T. * If not, the buffer will be "invalid" and false will be returned.
*/ template <typename T> bool validateCanReadN(size_t n) { return this->validate(n <= (this->available() / sizeof(T)));
}
// Utilities that mark the buffer invalid if the requested value is out-of-range
// If the read value is outside of the range, validate(false) is called, and min // is returned, else the value is returned.
int32_t checkInt(int min, int max);
template <typename T> T checkRange(T min, T max) { returnstatic_cast<T>(this->checkInt(static_cast<int32_t>(min), static_cast<int32_t>(max)));
}
// These are always 4-byte aligned constchar* fCurr = nullptr; // current position within buffer constchar* fStop = nullptr; // end of buffer constchar* fBase = nullptr; // beginning of buffer
// Only used if we do not have an fFactoryArray.
skia_private::THashMap<uint32_t, SkFlattenable::Factory> fFlattenableDict;
int fVersion = 0;
sk_sp<SkTypeface>* fTFArray = nullptr; int fTFCount = 0;
SkFlattenable::Factory* fFactoryArray = nullptr; int fFactoryCount = 0;
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.