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

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

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [RFC] gpu: Reuse transfer buffers more aggressively Created 7 years 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.cc
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index 11219ede664751e3fa92a2dcc800388f8d4d3f5c..85266990b49c290b34f7a6f3ba528bce835bcef8 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -169,6 +169,12 @@ int32 CommandBufferHelper::InsertToken() {
return token_;
}
+bool CommandBufferHelper::HasTokenPassed(int32 token) {
+ if (token > token_)
+ return true; // we wrapped
+ return last_token_read() >= token;
+}
+
// Waits until the current token value is greater or equal to the value passed
// in argument.
void CommandBufferHelper::WaitForToken(int32 token) {

Powered by Google App Engine
This is Rietveld 408576698