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

Unified Diff: src/gpu/GrAtlas.cpp

Issue 23120004: Change Atlas recycling to track current flush count and recycle if Atlas not used in current flush. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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/GrDrawTarget.h » ('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 f2daca11c5879340a0c9cb05e0b6724d80aafff6..5207061a8a8765159e42dac6a4f3317bb797fadb 100644
--- a/src/gpu/GrAtlas.cpp
+++ b/src/gpu/GrAtlas.cpp
@@ -50,10 +50,10 @@
static int g_UploadCount = 0;
#endif
-GrAtlas::GrAtlas(GrAtlasMgr* mgr, int plotX, int plotY, GrMaskFormat format) {
+GrAtlas::GrAtlas(GrAtlasMgr* mgr, int plotX, int plotY, GrMaskFormat format) :
+ fDrawToken(NULL, 0) {
fAtlasMgr = mgr; // just a pointer, not an owner
fNext = NULL;
- fUsed = false;
fTexture = mgr->getTexture(format); // we're not an owner, just a pointer
fPlot.set(plotX, plotY);
@@ -87,7 +87,7 @@ bool GrAtlas::RemoveUnusedAtlases(GrAtlasMgr* atlasMgr, GrAtlas** startAtlas) {
GrAtlas* atlas = *startAtlas;
bool removed = false;
while (NULL != atlas) {
- if (!atlas->used()) {
+ if (atlas->drawToken().isIssued()) {
*atlasRef = atlas->fNext;
atlasMgr->deleteAtlas(atlas);
atlas = *atlasRef;
@@ -189,7 +189,7 @@ static GrPixelConfig maskformat2pixelconfig(GrMaskFormat format) {
case kA888_GrMaskFormat:
return kSkia8888_GrPixelConfig;
default:
- GrAssert(!"unknown maskformat");
+ SkASSERT(!"unknown maskformat");
}
return kUnknown_GrPixelConfig;
}
@@ -217,8 +217,8 @@ GrAtlas* GrAtlasMgr::addToAtlas(GrAtlas** atlas,
return NULL;
}
- GrAssert(0 == kA8_GrMaskFormat);
- GrAssert(1 == kA565_GrMaskFormat);
+ SkASSERT(0 == kA8_GrMaskFormat);
+ SkASSERT(1 == kA565_GrMaskFormat);
if (NULL == fTexture[format]) {
// TODO: Update this to use the cache rather than directly creating a texture.
GrTextureDesc desc;
@@ -247,6 +247,6 @@ GrAtlas* GrAtlasMgr::addToAtlas(GrAtlas** atlas,
}
void GrAtlasMgr::freePlot(GrMaskFormat format, int x, int y) {
- GrAssert(fPlotMgr->isBusy(x, y));
+ SkASSERT(fPlotMgr->isBusy(x, y));
fPlotMgr->freePlot(x, y);
}
« no previous file with comments | « src/gpu/GrAtlas.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698