OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 4295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4306 uint32 immediate_data_size, const gles2::GetShaderSource& c) { | 4306 uint32 immediate_data_size, const gles2::GetShaderSource& c) { |
4307 GLuint shader = c.shader; | 4307 GLuint shader = c.shader; |
4308 uint32 bucket_id = static_cast<uint32>(c.bucket_id); | 4308 uint32 bucket_id = static_cast<uint32>(c.bucket_id); |
4309 Bucket* bucket = CreateBucket(bucket_id); | 4309 Bucket* bucket = CreateBucket(bucket_id); |
4310 ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( | 4310 ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( |
4311 shader, "glGetShaderSource"); | 4311 shader, "glGetShaderSource"); |
4312 if (!info) { | 4312 if (!info) { |
4313 bucket->SetSize(0); | 4313 bucket->SetSize(0); |
4314 return error::kNoError; | 4314 return error::kNoError; |
4315 } | 4315 } |
4316 bucket->SetFromString(info->source()); | 4316 bucket->SetFromString(info->source().c_str()); |
4317 return error::kNoError; | 4317 return error::kNoError; |
4318 } | 4318 } |
4319 | 4319 |
4320 error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( | 4320 error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( |
4321 uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { | 4321 uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { |
4322 GLuint program = c.program; | 4322 GLuint program = c.program; |
4323 uint32 bucket_id = static_cast<uint32>(c.bucket_id); | 4323 uint32 bucket_id = static_cast<uint32>(c.bucket_id); |
4324 Bucket* bucket = CreateBucket(bucket_id); | 4324 Bucket* bucket = CreateBucket(bucket_id); |
4325 ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( | 4325 ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( |
4326 program, "glGetProgramInfoLog"); | 4326 program, "glGetProgramInfoLog"); |
4327 if (!info) { | 4327 if (!info) { |
4328 return error::kNoError; | 4328 return error::kNoError; |
4329 } | 4329 } |
4330 bucket->SetFromString(info->log_info()); | 4330 bucket->SetFromString(info->log_info().c_str()); |
4331 return error::kNoError; | 4331 return error::kNoError; |
4332 } | 4332 } |
4333 | 4333 |
4334 error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( | 4334 error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( |
4335 uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) { | 4335 uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) { |
4336 GLuint shader = c.shader; | 4336 GLuint shader = c.shader; |
4337 uint32 bucket_id = static_cast<uint32>(c.bucket_id); | 4337 uint32 bucket_id = static_cast<uint32>(c.bucket_id); |
4338 Bucket* bucket = CreateBucket(bucket_id); | 4338 Bucket* bucket = CreateBucket(bucket_id); |
4339 ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( | 4339 ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( |
4340 shader, "glGetShaderInfoLog"); | 4340 shader, "glGetShaderInfoLog"); |
4341 if (!info) { | 4341 if (!info) { |
4342 bucket->SetSize(0); | 4342 bucket->SetSize(0); |
4343 return error::kNoError; | 4343 return error::kNoError; |
4344 } | 4344 } |
4345 bucket->SetFromString(info->log_info()); | 4345 bucket->SetFromString(info->log_info().c_str()); |
4346 return error::kNoError; | 4346 return error::kNoError; |
4347 } | 4347 } |
4348 | 4348 |
4349 bool GLES2DecoderImpl::DoIsBuffer(GLuint client_id) { | 4349 bool GLES2DecoderImpl::DoIsBuffer(GLuint client_id) { |
4350 return GetBufferInfo(client_id) != NULL; | 4350 return GetBufferInfo(client_id) != NULL; |
4351 } | 4351 } |
4352 | 4352 |
4353 bool GLES2DecoderImpl::DoIsFramebuffer(GLuint client_id) { | 4353 bool GLES2DecoderImpl::DoIsFramebuffer(GLuint client_id) { |
4354 return GetFramebufferInfo(client_id) != NULL; | 4354 return GetFramebufferInfo(client_id) != NULL; |
4355 } | 4355 } |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5732 const ProgramManager::ProgramInfo::UniformInfo* uniform_info = | 5732 const ProgramManager::ProgramInfo::UniformInfo* uniform_info = |
5733 info->GetUniformInfo(index); | 5733 info->GetUniformInfo(index); |
5734 if (!uniform_info) { | 5734 if (!uniform_info) { |
5735 SetGLError(GL_INVALID_VALUE, "glGetActiveUniform: index out of range"); | 5735 SetGLError(GL_INVALID_VALUE, "glGetActiveUniform: index out of range"); |
5736 return error::kNoError; | 5736 return error::kNoError; |
5737 } | 5737 } |
5738 result->success = 1; // true. | 5738 result->success = 1; // true. |
5739 result->size = uniform_info->size; | 5739 result->size = uniform_info->size; |
5740 result->type = uniform_info->type; | 5740 result->type = uniform_info->type; |
5741 Bucket* bucket = CreateBucket(name_bucket_id); | 5741 Bucket* bucket = CreateBucket(name_bucket_id); |
5742 bucket->SetFromString(uniform_info->name); | 5742 bucket->SetFromString(uniform_info->name.c_str()); |
5743 return error::kNoError; | 5743 return error::kNoError; |
5744 } | 5744 } |
5745 | 5745 |
5746 error::Error GLES2DecoderImpl::HandleGetActiveAttrib( | 5746 error::Error GLES2DecoderImpl::HandleGetActiveAttrib( |
5747 uint32 immediate_data_size, const gles2::GetActiveAttrib& c) { | 5747 uint32 immediate_data_size, const gles2::GetActiveAttrib& c) { |
5748 GLuint program = c.program; | 5748 GLuint program = c.program; |
5749 GLuint index = c.index; | 5749 GLuint index = c.index; |
5750 uint32 name_bucket_id = c.name_bucket_id; | 5750 uint32 name_bucket_id = c.name_bucket_id; |
5751 typedef gles2::GetActiveAttrib::Result Result; | 5751 typedef gles2::GetActiveAttrib::Result Result; |
5752 Result* result = GetSharedMemoryAs<Result*>( | 5752 Result* result = GetSharedMemoryAs<Result*>( |
(...skipping 13 matching lines...) Expand all Loading... |
5766 const ProgramManager::ProgramInfo::VertexAttribInfo* attrib_info = | 5766 const ProgramManager::ProgramInfo::VertexAttribInfo* attrib_info = |
5767 info->GetAttribInfo(index); | 5767 info->GetAttribInfo(index); |
5768 if (!attrib_info) { | 5768 if (!attrib_info) { |
5769 SetGLError(GL_INVALID_VALUE, "glGetActiveAttrib: index out of range"); | 5769 SetGLError(GL_INVALID_VALUE, "glGetActiveAttrib: index out of range"); |
5770 return error::kNoError; | 5770 return error::kNoError; |
5771 } | 5771 } |
5772 result->success = 1; // true. | 5772 result->success = 1; // true. |
5773 result->size = attrib_info->size; | 5773 result->size = attrib_info->size; |
5774 result->type = attrib_info->type; | 5774 result->type = attrib_info->type; |
5775 Bucket* bucket = CreateBucket(name_bucket_id); | 5775 Bucket* bucket = CreateBucket(name_bucket_id); |
5776 bucket->SetFromString(attrib_info->name); | 5776 bucket->SetFromString(attrib_info->name.c_str()); |
5777 return error::kNoError; | 5777 return error::kNoError; |
5778 } | 5778 } |
5779 | 5779 |
5780 error::Error GLES2DecoderImpl::HandleShaderBinary( | 5780 error::Error GLES2DecoderImpl::HandleShaderBinary( |
5781 uint32 immediate_data_size, const gles2::ShaderBinary& c) { | 5781 uint32 immediate_data_size, const gles2::ShaderBinary& c) { |
5782 #if 1 // No binary shader support. | 5782 #if 1 // No binary shader support. |
5783 SetGLError(GL_INVALID_OPERATION, "glShaderBinary: not supported"); | 5783 SetGLError(GL_INVALID_OPERATION, "glShaderBinary: not supported"); |
5784 return error::kNoError; | 5784 return error::kNoError; |
5785 #else | 5785 #else |
5786 GLsizei n = static_cast<GLsizei>(c.n); | 5786 GLsizei n = static_cast<GLsizei>(c.n); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5922 return error::kNoError; | 5922 return error::kNoError; |
5923 } | 5923 } |
5924 | 5924 |
5925 // Include the auto-generated part of this file. We split this because it means | 5925 // Include the auto-generated part of this file. We split this because it means |
5926 // we can easily edit the non-auto generated parts right here in this file | 5926 // we can easily edit the non-auto generated parts right here in this file |
5927 // instead of having to edit some template or the code generator. | 5927 // instead of having to edit some template or the code generator. |
5928 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 5928 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
5929 | 5929 |
5930 } // namespace gles2 | 5930 } // namespace gles2 |
5931 } // namespace gpu | 5931 } // namespace gpu |
OLD | NEW |