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

Unified Diff: gpu/command_buffer/common/command_buffer.h

Issue 7260008: Implement proper synchronization between HW video decode IPC and CommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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 | « content/renderer/pepper_plugin_delegate_impl.cc ('k') | gpu/command_buffer/common/command_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d5fb24d99cff6cf6d01806e512a99c063d054156 100644
--- a/gpu/command_buffer/common/command_buffer.h
+++ b/gpu/command_buffer/common/command_buffer.h
@@ -123,6 +123,27 @@ 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).
+class ReadWriteTokens {
+ public:
+ 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;
+
+ // These want to be private (and const) but can't in order to support
+ // pickling.
+ int32 last_token_read;
+ int32 last_token_written;
+};
+
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
« no previous file with comments | « content/renderer/pepper_plugin_delegate_impl.cc ('k') | gpu/command_buffer/common/command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698