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

Side by Side Diff: command_buffer/common/cross/buffer_sync_api.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // Command buffer type. 43 // Command buffer type.
44 typedef size_t CommandBufferOffset; 44 typedef size_t CommandBufferOffset;
45 45
46 // Interface class for the Command Buffer Synchronous API. 46 // Interface class for the Command Buffer Synchronous API.
47 // This is the part of the command buffer API that is accessible through the 47 // This is the part of the command buffer API that is accessible through the
48 // RPC mechanism, synchronously. 48 // RPC mechanism, synchronously.
49 class BufferSyncInterface { 49 class BufferSyncInterface {
50 public: 50 public:
51 // Status of the command buffer service. It does not process commands 51 // Status of the command buffer service. It does not process commands
52 // (meaning: get will not change) unless in PARSING state. 52 // (meaning: get will not change) unless in kParsing state.
53 enum ParserStatus { 53 enum ParserStatus {
54 NOT_CONNECTED, // The service is not connected - initial state. 54 kNotConnected, // The service is not connected - initial state.
55 NO_BUFFER, // The service is connected but no buffer was set. 55 kNoBuffer, // The service is connected but no buffer was set.
56 PARSING, // The service is connected, and parsing commands from the 56 kParsing, // The service is connected, and parsing commands from the
57 // buffer. 57 // buffer.
58 PARSE_ERROR, // Parsing stopped because a parse error was found. 58 kParseError, // Parsing stopped because a parse error was found.
59 }; 59 };
60 60
61 enum ParseError { 61 enum ParseError {
62 PARSE_NO_ERROR, 62 kParseNoError,
63 PARSE_INVALID_SIZE, 63 kParseInvalidSize,
64 PARSE_OUT_OF_BOUNDS, 64 kParseOutOfBounds,
65 PARSE_UNKNOWN_COMMAND, 65 kParseUnknownCommand,
66 PARSE_INVALID_ARGUMENTS, 66 kParseInvalidArguments,
67 }; 67 };
68 68
69 // Invalid shared memory Id, returned by RegisterSharedMemory in case of 69 // Invalid shared memory Id, returned by RegisterSharedMemory in case of
70 // failure. 70 // failure.
71 static const unsigned int kInvalidSharedMemoryId = 0xffffffffU; 71 static const unsigned int kInvalidSharedMemoryId = 0xffffffffU;
72 72
73 BufferSyncInterface() {} 73 BufferSyncInterface() {}
74 virtual ~BufferSyncInterface() {} 74 virtual ~BufferSyncInterface() {}
75 75
76 // Initializes the connection with the client. 76 // Initializes the connection with the client.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 virtual void SignalGetChanges(CommandBufferOffset current_value, 148 virtual void SignalGetChanges(CommandBufferOffset current_value,
149 int rpc_message_id) = 0; 149 int rpc_message_id) = 0;
150 150
151 // Gets the status of the service. 151 // Gets the status of the service.
152 // Returns: 152 // Returns:
153 // The status of the service. 153 // The status of the service.
154 virtual ParserStatus GetStatus() = 0; 154 virtual ParserStatus GetStatus() = 0;
155 155
156 // Gets the current parse error. The current parse error is set when the 156 // Gets the current parse error. The current parse error is set when the
157 // service is in the PARSE_ERROR status. It may also be set while in the 157 // service is in the PARSE_ERROR status. It may also be set while in the
158 // PARSING state, if a recoverable error (like PARSE_UNKNOWN_METHOD) was 158 // kParsing state, if a recoverable error (like PARSE_UNKNOWN_METHOD) was
159 // encountered. Getting the error resets it to PARSE_NO_ERROR. 159 // encountered. Getting the error resets it to kParseNoError.
160 // Returns: 160 // Returns:
161 // The current parse error. 161 // The current parse error.
162 virtual ParseError GetParseError() = 0; 162 virtual ParseError GetParseError() = 0;
163 }; 163 };
164 164
165 } // namespace command_buffer 165 } // namespace command_buffer
166 } // namespace o3d 166 } // namespace o3d
167 167
168 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_BUFFER_SYNC_API_H_ 168 #endif // O3D_COMMAND_BUFFER_COMMON_CROSS_BUFFER_SYNC_API_H_
OLDNEW
« no previous file with comments | « command_buffer/client/cross/fenced_allocator_test.cc ('k') | command_buffer/common/cross/cmd_buffer_format.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698