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

Unified Diff: src/gpu/GrDrawTarget.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; clean up whitespace. 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/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 0c2b568da418450eee64c6e6731207799d0383e2..5fd8567193c411ebbb1af3e0329ee2abed4fd25b 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -621,6 +621,24 @@ public:
GrDrawTarget* fTarget;
};
+ ///////////////////////////////////////////////////////////////////////////
+ // Flush tracking (for font atlases and other resources)
+ class FlushToken {
+ public:
+ FlushToken(GrDrawTarget* drawTarget, uint32_t flushID) :
+ fDrawTarget(drawTarget), fFlushID(flushID) {}
+
+ bool isCurrent() { return NULL != fDrawTarget && fDrawTarget->isCurrentFlush(fFlushID); }
bsalomon 2013/08/14 19:04:27 I think we should reverse the sense of this: isFlu
jvanverth1 2013/08/15 14:49:58 Done.
+
+ private:
+ GrDrawTarget* fDrawTarget;
+ uint32_t fFlushID; // this may wrap, but we're doing direct comparison
+ // so that should be okay
+ };
+
+ virtual FlushToken getCurrentFlushToken() { return FlushToken(this, 0); }
+ virtual bool isCurrentFlush(uint32_t) { return false; }
+
protected:
enum GeometrySrcType {

Powered by Google App Engine
This is Rietveld 408576698