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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 1142273002: Revert of small cleanup of GrAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 73a4ec770fc8394fb6188c3381904545e08a35eb..84f7eb2197a4aa736aabba9847b9ba5b08ab5518 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -201,6 +201,23 @@
* is intended to give an application some recourse when resources are low.
*/
virtual void purgeResources() {};
+
+ ///////////////////////////////////////////////////////////////////////////
+ // 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 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); }
bool programUnitTest(int maxStages);
« 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