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

Side by Side Diff: gpu/command_buffer/common/gles2_cmd_format_autogen.h

Issue 521018: A bunch of unit tests for GLES2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
1 // This file is auto-generated. DO NOT EDIT! 5 // This file is auto-generated. DO NOT EDIT!
2 6
7 #ifndef GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
8 #define GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
9
3 struct ActiveTexture { 10 struct ActiveTexture {
4 typedef ActiveTexture ValueType; 11 typedef ActiveTexture ValueType;
5 static const CommandId kCmdId = kActiveTexture; 12 static const CommandId kCmdId = kActiveTexture;
6 static const cmd::ArgFlags kArgFlags = cmd::kFixed; 13 static const cmd::ArgFlags kArgFlags = cmd::kFixed;
7 14
8 static uint32 ComputeSize() { 15 static uint32 ComputeSize() {
9 return static_cast<uint32>(sizeof(ValueType)); // NOLINT 16 return static_cast<uint32>(sizeof(ValueType)); // NOLINT
10 } 17 }
11 18
12 void SetHeader() { 19 void SetHeader() {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 COMPILE_ASSERT(offsetof(BindAttribLocation, name_shm_offset) == 16, 133 COMPILE_ASSERT(offsetof(BindAttribLocation, name_shm_offset) == 16,
127 OffsetOf_BindAttribLocation_name_shm_offset_not_16); 134 OffsetOf_BindAttribLocation_name_shm_offset_not_16);
128 COMPILE_ASSERT(offsetof(BindAttribLocation, data_size) == 20, 135 COMPILE_ASSERT(offsetof(BindAttribLocation, data_size) == 20,
129 OffsetOf_BindAttribLocation_data_size_not_20); 136 OffsetOf_BindAttribLocation_data_size_not_20);
130 137
131 struct BindAttribLocationImmediate { 138 struct BindAttribLocationImmediate {
132 typedef BindAttribLocationImmediate ValueType; 139 typedef BindAttribLocationImmediate ValueType;
133 static const CommandId kCmdId = kBindAttribLocationImmediate; 140 static const CommandId kCmdId = kBindAttribLocationImmediate;
134 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; 141 static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN;
135 142
136 static uint32 ComputeDataSize(const char* s) { 143 static uint32 ComputeSize(uint32 data_size) {
137 return strlen(s); 144 return static_cast<uint32>(
145 sizeof(ValueType) + data_size); // NOLINT
138 } 146 }
139 147
140 static uint32 ComputeSize(const char* s) { 148 void SetHeader(uint32 data_size) {
141 return static_cast<uint32>( 149 header.SetCmdBySize<ValueType>(data_size);
142 sizeof(ValueType) + ComputeDataSize(s)); // NOLINT
143 } 150 }
144 151
145 void SetHeader(const char* s) { 152 void Init(
146 header.SetCmdByTotalSize<ValueType>(ComputeSize(s)); 153 GLuint _program, GLuint _index, const char* _name, uint32 _data_size) {
154 SetHeader(_data_size);
155 program = _program;
156 index = _index;
157 data_size = _data_size;
158 memcpy(ImmediateDataAddress(this), _name, _data_size);
147 } 159 }
148 160
149 void Init(GLuint _program, GLuint _index, const char* _name) { 161 void* Set(
150 SetHeader(_name); 162 void* cmd, GLuint _program, GLuint _index, const char* _name,
151 program = _program; 163 uint32 _data_size) {
152 index = _index; 164 static_cast<ValueType*>(cmd)->Init(_program, _index, _name, _data_size);
153 data_size = strlen(_name); 165 return NextImmediateCmdAddress<ValueType>(cmd, _data_size);
154 memcpy(ImmediateDataAddress(this), _name, data_size);
155 }
156
157 void* Set(void* cmd, GLuint _program, GLuint _index, const char* _name) {
158 static_cast<ValueType*>(cmd)->Init(_program, _index, _name);
159 const uint32 size = ComputeSize(_name);
160 return NextImmediateCmdAddressTotalSize<ValueType>(cmd, size);
161 } 166 }
162 167
163 gpu::CommandHeader header; 168 gpu::CommandHeader header;
164 uint32 program; 169 uint32 program;
165 uint32 index; 170 uint32 index;
166 uint32 data_size; 171 uint32 data_size;
167 }; 172 };
168 173
169 COMPILE_ASSERT(sizeof(BindAttribLocationImmediate) == 16, 174 COMPILE_ASSERT(sizeof(BindAttribLocationImmediate) == 16,
170 Sizeof_BindAttribLocationImmediate_is_not_16); 175 Sizeof_BindAttribLocationImmediate_is_not_16);
(...skipping 7903 matching lines...) Expand 10 before | Expand all | Expand 10 after
8074 8079
8075 gpu::CommandHeader header; 8080 gpu::CommandHeader header;
8076 }; 8081 };
8077 8082
8078 COMPILE_ASSERT(sizeof(SwapBuffers) == 4, 8083 COMPILE_ASSERT(sizeof(SwapBuffers) == 4,
8079 Sizeof_SwapBuffers_is_not_4); 8084 Sizeof_SwapBuffers_is_not_4);
8080 COMPILE_ASSERT(offsetof(SwapBuffers, header) == 0, 8085 COMPILE_ASSERT(offsetof(SwapBuffers, header) == 0,
8081 OffsetOf_SwapBuffers_header_not_0); 8086 OffsetOf_SwapBuffers_header_not_0);
8082 8087
8083 8088
8089 #endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
8090
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_gen.h ('k') | gpu/command_buffer/common/gles2_cmd_format_test_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698