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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_autogen.h

Issue 661220: Added support for glGetString, glGetShaderSource,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated. DO NOT EDIT! 5 // This file is auto-generated. DO NOT EDIT!
6 6
7 // It is included by gles2_cmd_decoder.cc 7 // It is included by gles2_cmd_decoder.cc
8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_
9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_
10 10
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 return error::kNoError; 1080 return error::kNoError;
1081 } 1081 }
1082 1082
1083 error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( 1083 error::Error GLES2DecoderImpl::HandleGetProgramInfoLog(
1084 uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { 1084 uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) {
1085 GLuint program; 1085 GLuint program;
1086 if (!id_manager()->GetServiceId(c.program, &program)) { 1086 if (!id_manager()->GetServiceId(c.program, &program)) {
1087 SetGLError(GL_INVALID_VALUE); 1087 SetGLError(GL_INVALID_VALUE);
1088 return error::kNoError; 1088 return error::kNoError;
1089 } 1089 }
1090 GLsizei bufsize = static_cast<GLsizei>(c.bufsize); 1090 uint32 bucket_id = static_cast<uint32>(c.bucket_id);
1091 uint32 size_shm_id = c.length_shm_id; 1091 GLint len = 0;
1092 uint32 size_shm_offset = c.length_shm_offset; 1092 glGetProgramiv(program, GL_INFO_LOG_LENGTH, &len);
1093 GLsizei* length = NULL; 1093 Bucket* bucket = CreateBucket(bucket_id);
1094 if (size_shm_id != 0 || size_shm_offset != 0) { 1094 bucket->SetSize(len + 1);
1095 length = GetSharedMemoryAs<GLsizei*>( 1095 glGetProgramInfoLog(
1096 size_shm_id, size_shm_offset, sizeof(*length)); 1096 program, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));
1097 if (!length) {
1098 return error::kOutOfBounds;
1099 }
1100 }
1101 char* infolog = GetSharedMemoryAs<char*>(
1102 c.infolog_shm_id, c.infolog_shm_offset, bufsize);
1103 if (bufsize < 0) {
1104 SetGLError(GL_INVALID_VALUE);
1105 return error::kNoError;
1106 }
1107 if (infolog == NULL) {
1108 return error::kOutOfBounds;
1109 }
1110 glGetProgramInfoLog(program, bufsize, length, infolog);
1111 return error::kNoError; 1097 return error::kNoError;
1112 } 1098 }
1113 1099
1114 error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( 1100 error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv(
1115 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { 1101 uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) {
1116 GLenum target = static_cast<GLenum>(c.target); 1102 GLenum target = static_cast<GLenum>(c.target);
1117 GLenum pname = static_cast<GLenum>(c.pname); 1103 GLenum pname = static_cast<GLenum>(c.pname);
1118 GLint* params; 1104 GLint* params;
1119 GLsizei num_values = util_.GLGetNumValuesReturned(pname); 1105 GLsizei num_values = util_.GLGetNumValuesReturned(pname);
1120 uint32 params_size = num_values * sizeof(*params); 1106 uint32 params_size = num_values * sizeof(*params);
(...skipping 27 matching lines...) Expand all
1148 uint32 params_size = num_values * sizeof(*params); 1134 uint32 params_size = num_values * sizeof(*params);
1149 params = GetSharedMemoryAs<GLint*>( 1135 params = GetSharedMemoryAs<GLint*>(
1150 c.params_shm_id, c.params_shm_offset, params_size); 1136 c.params_shm_id, c.params_shm_offset, params_size);
1151 if (!ValidateGLenumShaderParameter(pname)) { 1137 if (!ValidateGLenumShaderParameter(pname)) {
1152 SetGLError(GL_INVALID_ENUM); 1138 SetGLError(GL_INVALID_ENUM);
1153 return error::kNoError; 1139 return error::kNoError;
1154 } 1140 }
1155 if (params == NULL) { 1141 if (params == NULL) {
1156 return error::kOutOfBounds; 1142 return error::kOutOfBounds;
1157 } 1143 }
1158 glGetShaderiv(shader, pname, params); 1144 DoGetShaderiv(shader, pname, params);
1159 return error::kNoError; 1145 return error::kNoError;
1160 } 1146 }
1161 1147
1162 error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( 1148 error::Error GLES2DecoderImpl::HandleGetShaderInfoLog(
1163 uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) { 1149 uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) {
1164 GLuint shader; 1150 GLuint shader;
1165 if (!id_manager()->GetServiceId(c.shader, &shader)) { 1151 if (!id_manager()->GetServiceId(c.shader, &shader)) {
1166 SetGLError(GL_INVALID_VALUE); 1152 SetGLError(GL_INVALID_VALUE);
1167 return error::kNoError; 1153 return error::kNoError;
1168 } 1154 }
1169 GLsizei bufsize = static_cast<GLsizei>(c.bufsize); 1155 uint32 bucket_id = static_cast<uint32>(c.bucket_id);
1170 uint32 size_shm_id = c.length_shm_id; 1156 GLint len = 0;
1171 uint32 size_shm_offset = c.length_shm_offset; 1157 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
1172 GLsizei* length = NULL; 1158 Bucket* bucket = CreateBucket(bucket_id);
1173 if (size_shm_id != 0 || size_shm_offset != 0) { 1159 bucket->SetSize(len + 1);
1174 length = GetSharedMemoryAs<GLsizei*>( 1160 glGetShaderInfoLog(
1175 size_shm_id, size_shm_offset, sizeof(*length)); 1161 shader, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));
1176 if (!length) {
1177 return error::kOutOfBounds;
1178 }
1179 }
1180 char* infolog = GetSharedMemoryAs<char*>(
1181 c.infolog_shm_id, c.infolog_shm_offset, bufsize);
1182 if (bufsize < 0) {
1183 SetGLError(GL_INVALID_VALUE);
1184 return error::kNoError;
1185 }
1186 if (infolog == NULL) {
1187 return error::kOutOfBounds;
1188 }
1189 glGetShaderInfoLog(shader, bufsize, length, infolog);
1190 return error::kNoError; 1162 return error::kNoError;
1191 } 1163 }
1192 1164
1193 error::Error GLES2DecoderImpl::HandleGetShaderSource( 1165 error::Error GLES2DecoderImpl::HandleGetShaderSource(
1194 uint32 immediate_data_size, const gles2::GetShaderSource& c) { 1166 uint32 immediate_data_size, const gles2::GetShaderSource& c) {
1195 GLuint shader; 1167 GLuint shader;
1196 if (!id_manager()->GetServiceId(c.shader, &shader)) { 1168 if (!id_manager()->GetServiceId(c.shader, &shader)) {
1197 SetGLError(GL_INVALID_VALUE); 1169 SetGLError(GL_INVALID_VALUE);
1198 return error::kNoError; 1170 return error::kNoError;
1199 } 1171 }
1200 GLsizei bufsize = static_cast<GLsizei>(c.bufsize); 1172 uint32 bucket_id = static_cast<uint32>(c.bucket_id);
1201 uint32 size_shm_id = c.length_shm_id; 1173 GLint len = 0;
1202 uint32 size_shm_offset = c.length_shm_offset; 1174 DoGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &len);
1203 GLsizei* length = NULL; 1175 Bucket* bucket = CreateBucket(bucket_id);
1204 if (size_shm_id != 0 || size_shm_offset != 0) { 1176 bucket->SetSize(len + 1);
1205 length = GetSharedMemoryAs<GLsizei*>( 1177 DoGetShaderSource(
1206 size_shm_id, size_shm_offset, sizeof(*length)); 1178 shader, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));
1207 if (!length) {
1208 return error::kOutOfBounds;
1209 }
1210 }
1211 char* source = GetSharedMemoryAs<char*>(
1212 c.source_shm_id, c.source_shm_offset, bufsize);
1213 if (bufsize < 0) {
1214 SetGLError(GL_INVALID_VALUE);
1215 return error::kNoError;
1216 }
1217 if (source == NULL) {
1218 return error::kOutOfBounds;
1219 }
1220 DoGetShaderSource(shader, bufsize, length, source);
1221 return error::kNoError;
1222 }
1223
1224 error::Error GLES2DecoderImpl::HandleGetString(
1225 uint32 immediate_data_size, const gles2::GetString& c) {
1226 GLenum name = static_cast<GLenum>(c.name);
1227 if (!ValidateGLenumStringType(name)) {
1228 SetGLError(GL_INVALID_ENUM);
1229 return error::kNoError;
1230 }
1231 glGetString(name);
1232 return error::kNoError; 1179 return error::kNoError;
1233 } 1180 }
1234 1181
1235 error::Error GLES2DecoderImpl::HandleGetTexParameterfv( 1182 error::Error GLES2DecoderImpl::HandleGetTexParameterfv(
1236 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { 1183 uint32 immediate_data_size, const gles2::GetTexParameterfv& c) {
1237 GLenum target = static_cast<GLenum>(c.target); 1184 GLenum target = static_cast<GLenum>(c.target);
1238 GLenum pname = static_cast<GLenum>(c.pname); 1185 GLenum pname = static_cast<GLenum>(c.pname);
1239 GLfloat* params; 1186 GLfloat* params;
1240 GLsizei num_values = util_.GLGetNumValuesReturned(pname); 1187 GLsizei num_values = util_.GLGetNumValuesReturned(pname);
1241 uint32 params_size = num_values * sizeof(*params); 1188 uint32 params_size = num_values * sizeof(*params);
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 } 2474 }
2528 2475
2529 error::Error GLES2DecoderImpl::HandleSwapBuffers( 2476 error::Error GLES2DecoderImpl::HandleSwapBuffers(
2530 uint32 immediate_data_size, const gles2::SwapBuffers& c) { 2477 uint32 immediate_data_size, const gles2::SwapBuffers& c) {
2531 DoSwapBuffers(); 2478 DoSwapBuffers();
2532 return error::kNoError; 2479 return error::kNoError;
2533 } 2480 }
2534 2481
2535 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ 2482 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_
2536 2483
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698