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

Unified Diff: command_buffer/client/cross/cmd_buffer_helper.cc

Issue 212018: Change command buffer client code to use structures.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
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
Index: command_buffer/client/cross/cmd_buffer_helper.cc
===================================================================
--- command_buffer/client/cross/cmd_buffer_helper.cc (revision 26638)
+++ command_buffer/client/cross/cmd_buffer_helper.cc (working copy)
@@ -43,7 +43,7 @@
entry_count_(0),
token_(0) {
// The interface should be connected already.
- DCHECK_NE(BufferSyncInterface::NOT_CONNECTED, interface_->GetStatus());
+ DCHECK_NE(BufferSyncInterface::kNotConnected, interface_->GetStatus());
}
bool CommandBufferHelper::Init(unsigned int entry_count) {
@@ -94,7 +94,7 @@
++token_;
CommandBufferEntry args;
args.value_uint32 = token_;
- AddCommand(SET_TOKEN, 1, &args);
+ AddCommand(command_buffer::kSetToken, 1, &args);
if (token_ == 0) {
// we wrapped
Finish();
@@ -129,20 +129,20 @@
// If get_ didn't change or is invalid (-1), it means an error may have
// occured. Check that.
BufferSyncInterface::ParserStatus status = interface_->GetStatus();
- if (status != BufferSyncInterface::PARSING) {
+ if (status != BufferSyncInterface::kParsing) {
switch (status) {
- case BufferSyncInterface::NOT_CONNECTED:
+ case BufferSyncInterface::kNotConnected:
LOG(FATAL) << "Service disconnected.";
return;
- case BufferSyncInterface::NO_BUFFER:
+ case BufferSyncInterface::kNoBuffer:
LOG(FATAL) << "Service doesn't have a buffer set.";
return;
- case BufferSyncInterface::PARSE_ERROR: {
+ case BufferSyncInterface::kParseError: {
BufferSyncInterface::ParseError error = interface_->GetParseError();
LOG(WARNING) << "Parse error: " << error;
return;
}
- case BufferSyncInterface::PARSING:
+ case BufferSyncInterface::kParsing:
break;
}
}
@@ -181,5 +181,12 @@
while (AvailableEntries() < count) WaitForGetChange();
}
+CommandBufferEntry* CommandBufferHelper::GetSpace(uint32 entries) {
+ WaitForAvailableEntries(entries);
+ CommandBufferEntry* space = &entries_[put_];
+ put_ += entries;
+ return space;
+}
+
} // namespace command_buffer
} // namespace o3d
« no previous file with comments | « command_buffer/client/cross/cmd_buffer_helper.h ('k') | command_buffer/client/cross/cmd_buffer_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698