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

Unified Diff: o3d/gpu_plugin/command_buffer.h

Issue 207061: Added support for getting and setting the CommandBuffer token and error.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 | « no previous file | o3d/gpu_plugin/command_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: o3d/gpu_plugin/command_buffer.h
===================================================================
--- o3d/gpu_plugin/command_buffer.h (revision 26857)
+++ o3d/gpu_plugin/command_buffer.h (working copy)
@@ -22,6 +22,14 @@
// API to manage the put and get pointers.
class CommandBuffer : public DefaultNPObject<NPObject> {
public:
+ enum {
+ ERROR_NO_ERROR,
+ ERROR_INVALID_SIZE,
+ ERROR_OUT_OF_BOUNDS,
+ ERROR_UNKNOWN_COMMAND,
+ ERROR_INVALID_ARGUMENTS,
+ };
+
explicit CommandBuffer(NPP npp);
virtual ~CommandBuffer();
@@ -73,6 +81,29 @@
virtual NPObjectPointer<NPObject> GetRegisteredObject(int32 handle);
+ // Get the current token value. This is used for by the writer to defer
+ // changes to shared memory objects until the reader has reached a certain
+ // point in the command buffer. The reader is responsible for updating the
+ // token value, for example in response to an asynchronous set token command
+ // embedded in the command buffer. The default token value is zero.
+ int32 GetToken() {
+ return token_;
+ }
+
+ // Allows the reader to update the current token value.
+ void SetToken(int32 token) {
+ token_ = token;
+ }
+
+ // Get the current error status and reset it to ERROR_NO_ERROR.
+ // The default error status is ERROR_NO_ERROR.
+ int32 ResetError();
+
+ // Allows the reader to set the current error status.
+ void SetError(int32 error) {
+ error_ = error;
+ }
+
NP_UTILS_BEGIN_DISPATCHER_CHAIN(CommandBuffer, DefaultNPObject<NPObject>)
NP_UTILS_DISPATCHER(Initialize, bool(int32))
NP_UTILS_DISPATCHER(GetRingBuffer, NPObjectPointer<CHRSharedMemory>())
@@ -83,6 +114,8 @@
NP_UTILS_DISPATCHER(RegisterObject, int32(NPObjectPointer<NPObject>));
NP_UTILS_DISPATCHER(UnregisterObject,
void(NPObjectPointer<NPObject>, int32));
+ NP_UTILS_DISPATCHER(GetToken, int32());
+ NP_UTILS_DISPATCHER(ResetError, int32());
NP_UTILS_END_DISPATCHER_CHAIN
private:
@@ -94,6 +127,8 @@
scoped_ptr<Callback0::Type> put_offset_change_callback_;
std::vector<NPObjectPointer<NPObject> > registered_objects_;
std::set<int32> unused_registered_object_elements_;
+ int32 token_;
+ int32 error_;
};
} // namespace gpu_plugin
« no previous file with comments | « no previous file | o3d/gpu_plugin/command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698