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

Side by Side Diff: command_buffer/service/cross/mocks.h

Issue 329046: Splits the command buffers into common commands... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 1 month 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 private: 75 private:
76 unsigned int arg_count_; 76 unsigned int arg_count_;
77 CommandBufferEntry *args_; 77 CommandBufferEntry *args_;
78 }; 78 };
79 79
80 MOCK_METHOD3(DoCommand, parse_error::ParseError( 80 MOCK_METHOD3(DoCommand, parse_error::ParseError(
81 unsigned int command, 81 unsigned int command,
82 unsigned int arg_count, 82 unsigned int arg_count,
83 const void* cmd_data)); 83 const void* cmd_data));
84 84
85 const char* GetCommandName(unsigned int command_id) const {
86 return "";
87 };
88
85 // Sets the engine, to forward SetToken commands to it. 89 // Sets the engine, to forward SetToken commands to it.
86 void set_engine(CommandBufferEngine *engine) { engine_ = engine; } 90 void set_engine(CommandBufferEngine *engine) { engine_ = engine; }
87 91
88 // Forwards the SetToken commands to the engine. 92 // Forwards the SetToken commands to the engine.
89 void SetToken(unsigned int command, 93 void SetToken(unsigned int command,
90 unsigned int arg_count, 94 unsigned int arg_count,
91 const void* _args) { 95 const void* _args) {
92 DCHECK(engine_); 96 DCHECK(engine_);
93 DCHECK_EQ(1u, command); 97 DCHECK_EQ(1u, command);
94 DCHECK_EQ(1u, arg_count); 98 DCHECK_EQ(1u, arg_count);
95 const CommandBufferEntry* args = 99 const CommandBufferEntry* args =
96 static_cast<const CommandBufferEntry*>(_args); 100 static_cast<const CommandBufferEntry*>(_args);
97 engine_->set_token(args[0].value_uint32); 101 engine_->set_token(args[0].value_uint32);
98 } 102 }
99 private: 103 private:
100 CommandBufferEngine *engine_; 104 CommandBufferEngine *engine_;
101 }; 105 };
102 106
103 } // namespace command_buffer 107 } // namespace command_buffer
104 } // namespace o3d 108 } // namespace o3d
105 109
106 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_ 110 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_MOCKS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698