Index: command_buffer/service/cross/gapi_decoder.h |
=================================================================== |
--- command_buffer/service/cross/gapi_decoder.h (revision 30289) |
+++ command_buffer/service/cross/gapi_decoder.h (working copy) |
@@ -36,25 +36,22 @@ |
#define O3D_COMMAND_BUFFER_SERVICE_CROSS_GAPI_DECODER_H_ |
#include "core/cross/types.h" |
-#include "command_buffer/service/cross/cmd_parser.h" |
+#include "command_buffer/service/cross/common_decoder.h" |
#include "command_buffer/common/cross/o3d_cmd_format.h" |
namespace o3d { |
namespace command_buffer { |
- |
-class CommandBufferEngine; |
- |
namespace o3d { |
class GAPIInterface; |
// This class implements the AsyncAPIInterface interface, decoding GAPI |
// commands and sending them to a GAPI interface. |
-class GAPIDecoder : public AsyncAPIInterface { |
+class GAPIDecoder : public CommonDecoder { |
public: |
typedef parse_error::ParseError ParseError; |
- explicit GAPIDecoder(GAPIInterface *gapi) : gapi_(gapi), engine_(NULL) {} |
+ explicit GAPIDecoder(GAPIInterface *gapi) : gapi_(gapi) {} |
virtual ~GAPIDecoder() {} |
// Overridden from AsyncAPIInterface. |
@@ -62,24 +59,10 @@ |
unsigned int arg_count, |
const void* args); |
- // Sets the engine, to get shared memory buffers from, and to set the token |
- // to. |
- void set_engine(CommandBufferEngine *engine) { engine_ = engine; } |
- private: |
- // Gets the address of shared memory data, given a shared memory ID and an |
- // offset. Also checks that the size is consistent with the shared memory |
- // size. |
- // Parameters: |
- // shm_id: the id of the shared memory buffer. |
- // offset: the offset of the data in the shared memory buffer. |
- // size: the size of the data. |
- // Returns: |
- // NULL if shm_id isn't a valid shared memory buffer ID or if the size |
- // check fails. Return a pointer to the data otherwise. |
- void *GetAddressAndCheckSize(unsigned int shm_id, |
- unsigned int offset, |
- unsigned int size); |
+ // Overridden from AsyncAPIInterface. |
+ virtual const char* GetCommandName(unsigned int command_id) const; |
+ private: |
// Generate a member function prototype for each command in an automated and |
// typesafe way. |
#define O3D_COMMAND_BUFFER_CMD_OP(name) \ |
@@ -92,7 +75,6 @@ |
#undef O3D_COMMAND_BUFFER_CMD_OP |
GAPIInterface *gapi_; |
- CommandBufferEngine *engine_; |
}; |
} // namespace o3d |