Index: gpu/command_buffer/service/cmd_parser.cc |
diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc |
index fba06e6a20b1d4b2f17a1ca432aad18cf74bbed2..b5383afdf8693c112a1a1a35fad8656db0e2a3b0 100644 |
--- a/gpu/command_buffer/service/cmd_parser.cc |
+++ b/gpu/command_buffer/service/cmd_parser.cc |
@@ -10,23 +10,29 @@ |
namespace gpu { |
-CommandParser::CommandParser(void *shm_address, |
- size_t shm_size, |
- ptrdiff_t offset, |
- size_t size, |
- CommandBufferOffset start_get, |
- AsyncAPIInterface *handler) |
- : get_(start_get), |
- put_(start_get), |
+CommandParser::CommandParser(AsyncAPIInterface* handler) |
+ : get_(0), |
+ put_(0), |
+ buffer_(NULL), |
+ entry_count_(0), |
handler_(handler) { |
+} |
+ |
+void CommandParser::SetBuffer( |
+ void* shm_address, |
+ size_t shm_size, |
+ ptrdiff_t offset, |
+ size_t size) { |
// check proper alignments. |
DCHECK_EQ(0, (reinterpret_cast<intptr_t>(shm_address)) % 4); |
DCHECK_EQ(0, offset % 4); |
DCHECK_EQ(0u, size % 4); |
// check that the command buffer fits into the memory buffer. |
DCHECK_GE(shm_size, offset + size); |
- char * buffer_begin = static_cast<char *>(shm_address) + offset; |
- buffer_ = reinterpret_cast<CommandBufferEntry *>(buffer_begin); |
+ get_ = 0; |
+ put_ = 0; |
+ char* buffer_begin = static_cast<char*>(shm_address) + offset; |
+ buffer_ = reinterpret_cast<CommandBufferEntry*>(buffer_begin); |
entry_count_ = size / 4; |
} |