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

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: 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.cpp ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 0c2b568da418450eee64c6e6731207799d0383e2..9501d96301bf015f545dce56db3d8dbec215c5c5 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -621,6 +621,23 @@ public:
GrDrawTarget* fTarget;
};
+ ///////////////////////////////////////////////////////////////////////////
+ // Draw execution tracking (for font atlases and other resources)
+ class DrawToken {
+ public:
+ DrawToken(GrDrawTarget* drawTarget, uint32_t drawID) :
+ fDrawTarget(drawTarget), fDrawID(drawID) {}
+
+ bool isIssued() { return NULL != fDrawTarget && fDrawTarget->isIssued(fDrawID); }
+
+ private:
+ GrDrawTarget* fDrawTarget;
+ uint32_t fDrawID; // this may wrap, but we're doing direct comparison
+ // so that should be okay
+ };
+
+ virtual DrawToken getCurrentDrawToken() { return DrawToken(this, 0); }
+
protected:
enum GeometrySrcType {
@@ -839,6 +856,9 @@ private:
// but couldn't be made. Otherwise, returns true.
bool setupDstReadIfNecessary(DrawInfo* info);
+ // Check to see if this set of draw commands has been sent out
+ virtual bool isIssued(uint32_t drawID) { return true; }
+
enum {
kPreallocGeoSrcStateStackCnt = 4,
};
« no previous file with comments | « src/gpu/GrAtlas.cpp ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698