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 { |