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

Unified Diff: src/gpu/GrTextStrike.cpp

Issue 355673002: Rename GrAtlasMgr to GrAtlas (and other cleanup) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 6 years, 6 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/GrTextStrike.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextStrike.cpp
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index b03d14f96fd950e24a2b3533e420da18a9325bc9..fb9d631b601ad1397aa8473252d421676f631ab5 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -32,7 +32,7 @@ static int g_PurgeCount = 0;
GrFontCache::GrFontCache(GrGpu* gpu) : fGpu(gpu) {
gpu->ref();
for (int i = 0; i < kAtlasCount; ++i) {
- fAtlasMgr[i] = NULL;
+ fAtlases[i] = NULL;
}
fHead = fTail = NULL;
@@ -41,7 +41,7 @@ GrFontCache::GrFontCache(GrGpu* gpu) : fGpu(gpu) {
GrFontCache::~GrFontCache() {
fCache.deleteAll();
for (int i = 0; i < kAtlasCount; ++i) {
- delete fAtlasMgr[i];
+ delete fAtlases[i];
}
fGpu->unref();
#if FONT_CACHE_STATS
@@ -79,17 +79,17 @@ GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler,
GrMaskFormat format = scaler->getMaskFormat();
GrPixelConfig config = mask_format_to_pixel_config(format);
int atlasIndex = mask_format_to_atlas_index(format);
- if (NULL == fAtlasMgr[atlasIndex]) {
+ if (NULL == fAtlases[atlasIndex]) {
SkISize textureSize = SkISize::Make(GR_ATLAS_TEXTURE_WIDTH,
GR_ATLAS_TEXTURE_HEIGHT);
- fAtlasMgr[atlasIndex] = SkNEW_ARGS(GrAtlasMgr, (fGpu, config,
- textureSize,
- GR_NUM_PLOTS_X,
- GR_NUM_PLOTS_Y,
- true));
+ fAtlases[atlasIndex] = SkNEW_ARGS(GrAtlas, (fGpu, config,
+ textureSize,
+ GR_NUM_PLOTS_X,
+ GR_NUM_PLOTS_Y,
+ true));
}
GrTextStrike* strike = SkNEW_ARGS(GrTextStrike,
- (this, scaler->getKey(), format, fAtlasMgr[atlasIndex]));
+ (this, scaler->getKey(), format, fAtlases[atlasIndex]));
fCache.insert(key, strike);
if (fHead) {
@@ -108,8 +108,8 @@ GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler,
void GrFontCache::freeAll() {
fCache.deleteAll();
for (int i = 0; i < kAtlasCount; ++i) {
- delete fAtlasMgr[i];
- fAtlasMgr[i] = NULL;
+ delete fAtlases[i];
+ fAtlases[i] = NULL;
}
fHead = NULL;
fTail = NULL;
@@ -125,8 +125,8 @@ void GrFontCache::purgeStrike(GrTextStrike* strike) {
bool GrFontCache::freeUnusedPlot(GrTextStrike* preserveStrike) {
SkASSERT(NULL != preserveStrike);
- GrAtlasMgr* atlasMgr = preserveStrike->fAtlasMgr;
- GrPlot* plot = atlasMgr->getUnusedPlot();
+ GrAtlas* atlas = preserveStrike->fAtlas;
+ GrPlot* plot = atlas->getUnusedPlot();
if (NULL == plot) {
return false;
}
@@ -145,7 +145,7 @@ bool GrFontCache::freeUnusedPlot(GrTextStrike* preserveStrike) {
strikeToPurge->removePlot(plot);
// clear out any empty strikes (except this one)
- if (strikeToPurge != preserveStrike && strikeToPurge->fAtlas.isEmpty()) {
+ if (strikeToPurge != preserveStrike && strikeToPurge->fPlotUsage.isEmpty()) {
this->purgeStrike(strikeToPurge);
}
}
@@ -190,8 +190,8 @@ void GrFontCache::validate() const {
void GrFontCache::dump() const {
static int gDumpCount = 0;
for (int i = 0; i < kAtlasCount; ++i) {
- if (NULL != fAtlasMgr[i]) {
- GrTexture* texture = fAtlasMgr[i]->getTexture();
+ if (NULL != fAtlases[i]) {
+ GrTexture* texture = fAtlases[i]->getTexture();
if (NULL != texture) {
SkString filename;
#ifdef SK_BUILD_FOR_ANDROID
@@ -222,12 +222,12 @@ void GrFontCache::dump() const {
GrTextStrike::GrTextStrike(GrFontCache* cache, const GrKey* key,
GrMaskFormat format,
- GrAtlasMgr* atlasMgr) : fPool(64) {
+ GrAtlas* atlas) : fPool(64) {
fFontScalerKey = key;
fFontScalerKey->ref();
fFontCache = cache; // no need to ref, it won't go away before we do
- fAtlasMgr = atlasMgr; // no need to ref, it won't go away before we do
+ fAtlas = atlas; // no need to ref, it won't go away before we do
fMaskFormat = format;
@@ -278,7 +278,7 @@ void GrTextStrike::removePlot(const GrPlot* plot) {
}
}
- fAtlasMgr->removePlot(&fAtlas, plot);
+ fAtlas->removePlot(&fPlotUsage, plot);
}
@@ -314,9 +314,9 @@ bool GrTextStrike::addGlyphToAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
}
}
- GrPlot* plot = fAtlasMgr->addToAtlas(&fAtlas, glyph->width(),
- glyph->height(), storage.get(),
- &glyph->fAtlasLocation);
+ GrPlot* plot = fAtlas->addToAtlas(&fPlotUsage, glyph->width(),
+ glyph->height(), storage.get(),
+ &glyph->fAtlasLocation);
if (NULL == plot) {
return false;
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698