Chromium Code Reviews| Index: gpu/command_buffer/common/command_buffer.h |
| diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h |
| index d438f7225acf9762af4a4b6e31cc78aea7deef61..83b942688e8c5f4935fc9c435536dbdd51004f9a 100644 |
| --- a/gpu/command_buffer/common/command_buffer.h |
| +++ b/gpu/command_buffer/common/command_buffer.h |
| @@ -123,6 +123,25 @@ class CommandBuffer { |
| DISALLOW_COPY_AND_ASSIGN(CommandBuffer); |
| }; |
| +// Synchronizing other mechanisms (such as IPC) with the CommandBuffer requires |
| +// inserting (writing) a token into the buffer and knowing what the last token |
| +// read at that point was. ReadWriteTokens is a convenience struct for passing |
| +// these pairs around. Expected usage is to compare a current token to |
| +// [last_token_read,last_token_written). |
| +struct ReadWriteTokens { |
| + ReadWriteTokens(int32 read, int32 written); |
| + // Required to support pickling. Use by anything else will DCHECK in InRange. |
| + ReadWriteTokens(); |
| + |
| + // Return true iff |value| is in the range described by |tokens|, accounting |
| + // for (up to) one wrap-around. |
| + bool InRange(int32 token) const; |
| + |
| + // This want to be private (and const) but can't in order to support pickling. |
|
piman
2011/06/28 21:24:41
No need for this comment... coding style says that
Ami GONE FROM CHROMIUM
2011/06/28 21:27:38
My reason for the comment is that this isn't used
|
| + int32 last_token_read; |
| + int32 last_token_written; |
| +}; |
| + |
| } // namespace gpu |
| #endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_ |