Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: src/gpu/GrBatchFontCache.cpp

Issue 1087203004: Store pointers to GrGlyph directly in BitmapTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@atdfopt2
Patch Set: adding comment Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrBatchFontCache.h ('k') | src/gpu/GrTextBlobCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatchFontCache.cpp
diff --git a/src/gpu/GrBatchFontCache.cpp b/src/gpu/GrBatchFontCache.cpp
index 653649ac7832b8c10cdd77fc961be214571749fc..7e44fa52368fd671d45bc717c3a1d628267d0e22 100644
--- a/src/gpu/GrBatchFontCache.cpp
+++ b/src/gpu/GrBatchFontCache.cpp
@@ -74,7 +74,7 @@ GrBatchFontCache::GrBatchFontCache(GrContext* context)
GrBatchFontCache::~GrBatchFontCache() {
SkTDynamicHash<GrBatchTextStrike, GrFontDescKey>::Iter iter(&fCache);
while (!iter.done()) {
- SkDELETE(&(*iter));
+ (*iter).unref();
++iter;
}
for (int i = 0; i < kMaskFormatCount; ++i) {
@@ -85,7 +85,7 @@ GrBatchFontCache::~GrBatchFontCache() {
void GrBatchFontCache::freeAll() {
SkTDynamicHash<GrBatchTextStrike, GrFontDescKey>::Iter iter(&fCache);
while (!iter.done()) {
- SkDELETE(&(*iter));
+ (*iter).unref();
++iter;
}
fCache.rewind();
@@ -118,7 +118,8 @@ void GrBatchFontCache::HandleEviction(GrBatchAtlas::AtlasID id, void* ptr) {
// triggered the eviction
if (strike != fontCache->fPreserveStrike && 0 == strike->fAtlasedGlyphs) {
fontCache->fCache.remove(*(strike->fFontScalerKey));
- SkDELETE(strike);
+ strike->fIsAbandoned = true;
+ strike->unref();
}
}
}
@@ -155,7 +156,8 @@ void GrBatchFontCache::dump() const {
GrBatchTextStrike::GrBatchTextStrike(GrBatchFontCache* cache, const GrFontDescKey* key)
: fFontScalerKey(SkRef(key))
, fPool(9/*start allocations at 512 bytes*/)
- , fAtlasedGlyphs(0) {
+ , fAtlasedGlyphs(0)
+ , fIsAbandoned(false) {
fBatchFontCache = cache; // no need to ref, it won't go away before we do
}
« no previous file with comments | « src/gpu/GrBatchFontCache.h ('k') | src/gpu/GrTextBlobCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698