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

Unified Diff: src/gpu/GrAtlas.cpp

Issue 24047005: Have multiple plotmgrs, one for each mask format. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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/GrAtlas.h ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlas.cpp
diff --git a/src/gpu/GrAtlas.cpp b/src/gpu/GrAtlas.cpp
index ca46e8a8c436e2ede0bfbcb59872dfe4fd640ccb..9cdde220d44bb0fac3ece2683b5bf775915372ed 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -165,14 +165,18 @@ GrAtlasMgr::GrAtlasMgr(GrGpu* gpu) {
fGpu = gpu;
gpu->ref();
Gr_bzero(fTexture, sizeof(fTexture));
- fPlotMgr = SkNEW_ARGS(GrPlotMgr, (GR_PLOT_WIDTH, GR_PLOT_HEIGHT));
+ for (int i = 0; i < kCount_GrMaskFormats; ++i) {
+ fPlotMgr[i] = SkNEW_ARGS(GrPlotMgr, (GR_PLOT_WIDTH, GR_PLOT_HEIGHT));
+ }
}
GrAtlasMgr::~GrAtlasMgr() {
for (size_t i = 0; i < GR_ARRAY_COUNT(fTexture); i++) {
SkSafeUnref(fTexture[i]);
}
- delete fPlotMgr;
+ for (int i = 0; i < kCount_GrMaskFormats; ++i) {
+ delete fPlotMgr[i];
+ }
fGpu->unref();
#if FONT_CACHE_STATS
@@ -213,7 +217,7 @@ GrAtlas* GrAtlasMgr::addToAtlas(GrAtlas** atlas,
// atlas list is full. Either way we need to allocate a new atlas
GrIPoint16 plot;
- if (!fPlotMgr->newPlot(&plot)) {
+ if (!fPlotMgr[format]->newPlot(&plot)) {
return NULL;
}
@@ -247,6 +251,6 @@ GrAtlas* GrAtlasMgr::addToAtlas(GrAtlas** atlas,
}
void GrAtlasMgr::freePlot(GrMaskFormat format, int x, int y) {
- SkASSERT(fPlotMgr->isBusy(x, y));
- fPlotMgr->freePlot(x, y);
+ SkASSERT(fPlotMgr[format]->isBusy(x, y));
+ fPlotMgr[format]->freePlot(x, y);
}
« no previous file with comments | « src/gpu/GrAtlas.h ('k') | src/gpu/GrTextStrike.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698