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

Unified Diff: gpu/command_buffer/service/cmd_parser.cc

Issue 8865008: Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | « gpu/command_buffer/service/cmd_parser.h ('k') | gpu/command_buffer/service/cmd_parser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/cmd_parser.cc
===================================================================
--- gpu/command_buffer/service/cmd_parser.cc (revision 113511)
+++ gpu/command_buffer/service/cmd_parser.cc (working copy)
@@ -10,29 +10,23 @@
namespace gpu {
-CommandParser::CommandParser(AsyncAPIInterface* handler)
- : get_(0),
- put_(0),
- buffer_(NULL),
- entry_count_(0),
+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),
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);
- get_ = 0;
- put_ = 0;
- char* buffer_begin = static_cast<char*>(shm_address) + offset;
- buffer_ = reinterpret_cast<CommandBufferEntry*>(buffer_begin);
+ char * buffer_begin = static_cast<char *>(shm_address) + offset;
+ buffer_ = reinterpret_cast<CommandBufferEntry *>(buffer_begin);
entry_count_ = size / 4;
}
« no previous file with comments | « gpu/command_buffer/service/cmd_parser.h ('k') | gpu/command_buffer/service/cmd_parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698