add textblob cache freeall
BUG=skia: Review URL: https://codereview.chromium.org/1088683004
This commit is contained in:
parent
8dc7c3a839
commit
26ffc00bfa
@ -193,6 +193,7 @@ void GrContext::abandonContext() {
|
||||
fBatchFontCache->freeAll();
|
||||
fFontCache->freeAll();
|
||||
fLayerCache->freeAll();
|
||||
fTextBlobCache->freeAll();
|
||||
}
|
||||
|
||||
void GrContext::resetContext(uint32_t state) {
|
||||
|
@ -10,11 +10,7 @@
|
||||
static const int kVerticesPerGlyph = 4;
|
||||
|
||||
GrTextBlobCache::~GrTextBlobCache() {
|
||||
SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache);
|
||||
while (!iter.done()) {
|
||||
(&(*iter))->unref();
|
||||
++iter;
|
||||
}
|
||||
this->freeAll();
|
||||
}
|
||||
|
||||
GrAtlasTextContext::BitmapTextBlob* GrTextBlobCache::createBlob(int glyphCount, int runCount,
|
||||
@ -48,3 +44,12 @@ GrAtlasTextContext::BitmapTextBlob* GrTextBlobCache::createBlob(int glyphCount,
|
||||
#endif
|
||||
return cacheBlob;
|
||||
}
|
||||
|
||||
void GrTextBlobCache::freeAll() {
|
||||
SkTDynamicHash<BitmapTextBlob, BitmapTextBlob::Key>::Iter iter(&fCache);
|
||||
while (!iter.done()) {
|
||||
(&(*iter))->unref();
|
||||
++iter;
|
||||
}
|
||||
fCache.rewind();
|
||||
}
|
||||
|
@ -115,6 +115,8 @@ public:
|
||||
fBlobList.addToHead(blob);
|
||||
}
|
||||
|
||||
void freeAll();
|
||||
|
||||
private:
|
||||
// TODO move to SkTextBlob
|
||||
void BlobGlyphCount(int* glyphCount, int* runCount, const SkTextBlob* blob) {
|
||||
|
Loading…
Reference in New Issue
Block a user