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

Unified Diff: o3d/gpu_plugin/command_buffer.h

Issue 234001: GPUProcessor uses O3D command buffer service to render to a window.... (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 | « o3d/command_buffer/service/win/d3d9/gapi_d3d9.h ('k') | 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 26879)
+++ o3d/gpu_plugin/command_buffer.h (working copy)
@@ -22,14 +22,6 @@
// 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();
@@ -95,27 +87,40 @@
token_ = token;
}
- // Get the current error status and reset it to ERROR_NO_ERROR.
- // The default error status is ERROR_NO_ERROR.
- int32 ResetError();
+ // Get the current parse error and reset it to zero. Zero means no error. Non-
+ // zero means error. The default error status is zero.
+ int32 ResetParseError();
- // Allows the reader to set the current error status.
- void SetError(int32 error) {
- error_ = error;
+ // Allows the reader to set the current parse error.
+ void SetParseError(int32 parse_error) {
+ parse_error_ = parse_error;
}
+ // Returns whether the command buffer is in the error state.
+ bool GetErrorStatus() {
+ return error_status_;
+ }
+
+ // Allows the reader to set the error status. Once in an error state, the
+ // command buffer cannot recover and ceases to process commands.
+ void RaiseErrorStatus() {
+ error_status_ = true;
+ }
+
NP_UTILS_BEGIN_DISPATCHER_CHAIN(CommandBuffer, DefaultNPObject<NPObject>)
- NP_UTILS_DISPATCHER(Initialize, bool(int32))
+ NP_UTILS_DISPATCHER(Initialize, bool(int32 size))
NP_UTILS_DISPATCHER(GetRingBuffer, NPObjectPointer<CHRSharedMemory>())
NP_UTILS_DISPATCHER(GetSize, int32())
- NP_UTILS_DISPATCHER(SyncOffsets, int32(int32))
+ NP_UTILS_DISPATCHER(SyncOffsets, int32(int32 get_offset))
NP_UTILS_DISPATCHER(GetGetOffset, int32());
NP_UTILS_DISPATCHER(GetPutOffset, int32());
- NP_UTILS_DISPATCHER(RegisterObject, int32(NPObjectPointer<NPObject>));
+ NP_UTILS_DISPATCHER(RegisterObject,
+ int32(NPObjectPointer<NPObject> object));
NP_UTILS_DISPATCHER(UnregisterObject,
- void(NPObjectPointer<NPObject>, int32));
+ void(NPObjectPointer<NPObject> object, int32 handle));
NP_UTILS_DISPATCHER(GetToken, int32());
- NP_UTILS_DISPATCHER(ResetError, int32());
+ NP_UTILS_DISPATCHER(ResetParseError, int32());
+ NP_UTILS_DISPATCHER(GetErrorStatus, bool());
NP_UTILS_END_DISPATCHER_CHAIN
private:
@@ -128,7 +133,8 @@
std::vector<NPObjectPointer<NPObject> > registered_objects_;
std::set<int32> unused_registered_object_elements_;
int32 token_;
- int32 error_;
+ int32 parse_error_;
+ bool error_status_;
};
} // namespace gpu_plugin
« no previous file with comments | « o3d/command_buffer/service/win/d3d9/gapi_d3d9.h ('k') | o3d/gpu_plugin/command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698