Lines Matching full:blob
39 sk_sp<TextBlob> blob = this->findOrCreateBlob(viewMatrix, glyphRunList, paint, in drawGlyphRunList() local
42 blob->draw(canvas, clip, viewMatrix, glyphRunList.origin(), paint, sdc); in drawGlyphRunList()
53 sk_sp<TextBlob> blob = this->findOrCreateBlob(viewMatrix, glyphRunList, paint, in drawGlyphRunList() local
56 blob->draw(canvas, glyphRunList.origin(), paint, device); in drawGlyphRunList()
69 sk_sp<TextBlob> blob; in findOrCreateBlob() local
71 blob = this->find(key); in findOrCreateBlob()
74 if (blob == nullptr || !blob->canReuse(paint, positionMatrix)) { in findOrCreateBlob()
75 if (blob != nullptr) { in findOrCreateBlob()
76 // We have to remake the blob because changes may invalidate our masks. in findOrCreateBlob()
77 this->remove(blob.get()); in findOrCreateBlob()
80 blob = TextBlob::Make( in findOrCreateBlob()
85 blob->addKey(key); in findOrCreateBlob()
86 // The blob may already have been created on a different thread. Use the first one in findOrCreateBlob()
88 blob = this->addOrReturnExisting(glyphRunList, blob); in findOrCreateBlob()
92 return blob; in findOrCreateBlob()
96 const GlyphRunList& glyphRunList, sk_sp<TextBlob> blob) { in addOrReturnExisting() argument
98 blob = this->internalAdd(std::move(blob)); in addOrReturnExisting()
100 return blob; in addOrReturnExisting()
110 sk_sp<TextBlob> blob = idEntry->find(key); in find() local
111 TextBlob* blobPtr = blob.get(); in find()
116 return blob; in find()
119 void TextBlobRedrawCoordinator::remove(TextBlob* blob) { in remove() argument
121 this->internalRemove(blob); in remove()
124 void TextBlobRedrawCoordinator::internalRemove(TextBlob* blob) { in internalRemove() argument
125 auto id = blob->key().fUniqueID; in internalRemove()
129 sk_sp<TextBlob> stillExists = idEntry->find(blob->key()); in internalRemove()
130 if (blob == stillExists.get()) { in internalRemove()
131 fCurrentSize -= blob->size(); in internalRemove()
132 fBlobList.remove(blob); in internalRemove()
133 idEntry->removeBlob(blob); in internalRemove()
169 // remove all blob entries from the LRU list in internalPurgeStaleBlobs()
170 for (const auto& blob : idEntry->fBlobs) { in internalPurgeStaleBlobs() local
171 fCurrentSize -= blob->size(); in internalPurgeStaleBlobs()
172 fBlobList.remove(blob.get()); in internalPurgeStaleBlobs()
190 void TextBlobRedrawCoordinator::internalCheckPurge(TextBlob* blob) { in internalCheckPurge() argument
191 // First, purge all stale blob IDs. in internalCheckPurge()
199 while (fCurrentSize > fSizeBudget && (lruBlob = iter.get()) && lruBlob != blob) { in internalCheckPurge()
200 // Backup the iterator before removing and unrefing the blob in internalCheckPurge()
214 sk_sp<TextBlob> TextBlobRedrawCoordinator::internalAdd(sk_sp<TextBlob> blob) { in internalAdd() argument
215 auto id = blob->key().fUniqueID; in internalAdd()
221 if (sk_sp<TextBlob> alreadyIn = idEntry->find(blob->key()); alreadyIn) { in internalAdd()
222 blob = std::move(alreadyIn); in internalAdd()
224 fBlobList.addToHead(blob.get()); in internalAdd()
225 fCurrentSize += blob->size(); in internalAdd()
226 idEntry->addBlob(blob); in internalAdd()
229 this->internalCheckPurge(blob.get()); in internalAdd()
230 return blob; in internalAdd()
242 void TextBlobRedrawCoordinator::BlobIDCacheEntry::addBlob(sk_sp<TextBlob> blob) { in addBlob() argument
243 SkASSERT(blob); in addBlob()
244 SkASSERT(blob->key().fUniqueID == fID); in addBlob()
245 SkASSERT(!this->find(blob->key())); in addBlob()
247 fBlobs.emplace_back(std::move(blob)); in addBlob()
250 void TextBlobRedrawCoordinator::BlobIDCacheEntry::removeBlob(TextBlob* blob) { in removeBlob() argument
251 SkASSERT(blob); in removeBlob()
252 SkASSERT(blob->key().fUniqueID == fID); in removeBlob()
254 auto index = this->findBlobIndex(blob->key()); in removeBlob()