Chromium Code Reviews| 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..eeb6387e1f72d44d3eb42cf24dafcf89ac7bad83 100644 |
| --- a/gpu/command_buffer/client/cmd_buffer_helper.h |
| +++ b/gpu/command_buffer/client/cmd_buffer_helper.h |
| @@ -7,9 +7,11 @@ |
| #ifndef GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ |
| #define GPU_COMMAND_BUFFER_CLIENT_CMD_BUFFER_HELPER_H_ |
| +#include <list> |
|
piman
2014/02/07 22:58:20
nit: you don't need this.
|
| #include <string.h> |
| #include <time.h> |
| +#include "base/bind.h" |
|
piman
2014/02/07 22:58:20
nit: or this
|
| #include "gpu/command_buffer/common/cmd_buffer_common.h" |
| #include "gpu/command_buffer/common/command_buffer.h" |
| #include "gpu/command_buffer/common/constants.h" |
| @@ -83,6 +85,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. |