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

Unified Diff: src/gpu/GrAtlas.h

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: Disable font cache stats 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
Index: src/gpu/GrAtlas.h
diff --git a/src/gpu/GrAtlas.h b/src/gpu/GrAtlas.h
index b6f25c210ab7fdccfa7a98a9b6ff1f22dfbc9341..cc09ab6da388694676aa1455648ed009e4190a77 100644
--- a/src/gpu/GrAtlas.h
+++ b/src/gpu/GrAtlas.h
@@ -36,26 +36,20 @@ public:
}
}
- static void MarkAllUnused(GrAtlas* atlas) {
- while (NULL != atlas) {
- atlas->fUsed = false;
- atlas = atlas->fNext;
- }
- }
-
- static bool RemoveUnusedAtlases(GrAtlasMgr* atlasMgr, GrAtlas** startAtlas);
+ static bool RemoveUnusedAtlases(GrAtlasMgr* atlasMgr, GrAtlas** startAtlas,
+ uint64_t flushCount);
- bool used() const { return fUsed; }
- void setUsed(bool used) { fUsed = used; }
+ uint64_t lastFlush() const { return fLastFlush; }
+ void setLastFlush(uint64_t flush) { fLastFlush = flush; }
private:
GrAtlas(GrAtlasMgr*, int plotX, int plotY, GrMaskFormat format);
~GrAtlas(); // does not try to delete the fNext field
- GrAtlas* fNext;
-
// for recycling
- bool fUsed;
+ uint64_t fLastFlush;
+
+ GrAtlas* fNext;
GrTexture* fTexture;
GrRectanizer* fRects;

Powered by Google App Engine
This is Rietveld 408576698