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

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.h

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added glWaitAllAsyncTexImage2DCHROMIUM; other review issues addressed Created 6 years, 10 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: gpu/command_buffer/client/cmd_buffer_helper.h
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.h b/gpu/command_buffer/client/cmd_buffer_helper.h
index a50dc7bfe4e4e73e4bc4ce392bc1cb85e32182be..d9b0c59618923855e3ed90b4323ac4a24e9f9c44 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.h
+++ b/gpu/command_buffer/client/cmd_buffer_helper.h
@@ -83,6 +83,15 @@ class GPU_EXPORT CommandBufferHelper {
// shutdown.
int32 InsertToken();
+ // Returns true if the token has passed.
+ // Parameters:
+ // the value of the token to check whether it has passed
+ bool HasTokenPassed(int32 token) const {
+ if (token > token_)
+ return true; // we wrapped
+ return last_token_read() >= token;
+ }
+
// Waits until the token of a particular value has passed through the command
// stream (i.e. commands inserted before that token have been executed).
// NOTE: This will call Flush if it needs to block.

Powered by Google App Engine
This is Rietveld 408576698