/* * Attaching a data to to a SkResourceCache (only one at a time) enables the data to be * unlocked when the cache is the only owner, thus freeing it to be purged (assuming the * data is backed by a SkDiscardableMemory). * * When attached, it also automatically attempts to "lock" the data when the first client * ref's the data (typically from a find(key, visitor) call). * * Thus the data will always be "locked" when a non-cache has a ref on it (whether or not * the lock succeeded to recover the memory -- check data() to see if it is nullptr).
*/
/* * Call when adding this instance to a SkResourceCache::Rec subclass * (typically in the Rec's constructor).
*/ void attachToCacheAndRef() const { this->internalRef(true); }
/* * Call when removing this instance from a SkResourceCache::Rec subclass * (typically in the Rec's destructor).
*/ void detachFromCacheAndUnref() const { this->internalUnref(true); }
};
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.