OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 4709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4720 } | 4720 } |
4721 | 4721 |
4722 error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( | 4722 error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( |
4723 uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { | 4723 uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { |
4724 GLuint program = c.program; | 4724 GLuint program = c.program; |
4725 uint32 bucket_id = static_cast<uint32>(c.bucket_id); | 4725 uint32 bucket_id = static_cast<uint32>(c.bucket_id); |
4726 Bucket* bucket = CreateBucket(bucket_id); | 4726 Bucket* bucket = CreateBucket(bucket_id); |
4727 ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( | 4727 ProgramManager::ProgramInfo* info = GetProgramInfoNotShader( |
4728 program, "glGetProgramInfoLog"); | 4728 program, "glGetProgramInfoLog"); |
4729 if (!info || !info->log_info()) { | 4729 if (!info || !info->log_info()) { |
4730 bucket->SetSize(0); | 4730 bucket->SetFromString(""); |
4731 return error::kNoError; | 4731 return error::kNoError; |
4732 } | 4732 } |
4733 bucket->SetFromString(info->log_info()->c_str()); | 4733 bucket->SetFromString(info->log_info()->c_str()); |
4734 return error::kNoError; | 4734 return error::kNoError; |
4735 } | 4735 } |
4736 | 4736 |
4737 error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( | 4737 error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( |
4738 uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) { | 4738 uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) { |
4739 GLuint shader = c.shader; | 4739 GLuint shader = c.shader; |
4740 uint32 bucket_id = static_cast<uint32>(c.bucket_id); | 4740 uint32 bucket_id = static_cast<uint32>(c.bucket_id); |
4741 Bucket* bucket = CreateBucket(bucket_id); | 4741 Bucket* bucket = CreateBucket(bucket_id); |
4742 ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( | 4742 ShaderManager::ShaderInfo* info = GetShaderInfoNotProgram( |
4743 shader, "glGetShaderInfoLog"); | 4743 shader, "glGetShaderInfoLog"); |
4744 if (!info || !info->log_info()) { | 4744 if (!info || !info->log_info()) { |
4745 bucket->SetSize(0); | 4745 bucket->SetFromString(""); |
4746 return error::kNoError; | 4746 return error::kNoError; |
4747 } | 4747 } |
4748 bucket->SetFromString(info->log_info()->c_str()); | 4748 bucket->SetFromString(info->log_info()->c_str()); |
4749 return error::kNoError; | 4749 return error::kNoError; |
4750 } | 4750 } |
4751 | 4751 |
4752 bool GLES2DecoderImpl::DoIsBuffer(GLuint client_id) { | 4752 bool GLES2DecoderImpl::DoIsBuffer(GLuint client_id) { |
4753 const BufferManager::BufferInfo* info = GetBufferInfo(client_id); | 4753 const BufferManager::BufferInfo* info = GetBufferInfo(client_id); |
4754 return info && info->IsValid(); | 4754 return info && info->IsValid(); |
4755 } | 4755 } |
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6785 return error::kNoError; | 6785 return error::kNoError; |
6786 } | 6786 } |
6787 | 6787 |
6788 error::Error GLES2DecoderImpl::HandleGetProgramInfoCHROMIUM( | 6788 error::Error GLES2DecoderImpl::HandleGetProgramInfoCHROMIUM( |
6789 uint32 immediate_data_size, const gles2::GetProgramInfoCHROMIUM& c) { | 6789 uint32 immediate_data_size, const gles2::GetProgramInfoCHROMIUM& c) { |
6790 GLuint program = static_cast<GLuint>(c.program); | 6790 GLuint program = static_cast<GLuint>(c.program); |
6791 uint32 bucket_id = c.bucket_id; | 6791 uint32 bucket_id = c.bucket_id; |
6792 Bucket* bucket = CreateBucket(bucket_id); | 6792 Bucket* bucket = CreateBucket(bucket_id); |
6793 bucket->SetSize(sizeof(ProgramInfoHeader)); // in case we fail. | 6793 bucket->SetSize(sizeof(ProgramInfoHeader)); // in case we fail. |
6794 ProgramManager::ProgramInfo* info = NULL; | 6794 ProgramManager::ProgramInfo* info = NULL; |
6795 if (program) { | 6795 info = GetProgramInfo(program); |
6796 info = GetProgramInfoNotShader(program, "glGetProgramInfoCHROMIUM"); | 6796 if (!info || !info->IsValid()) { |
6797 if (!info) { | 6797 return error::kNoError; |
6798 return error::kNoError; | |
6799 } | |
6800 if (!info->IsValid()) { | |
6801 // Program was not linked successfully. (ie, glLinkProgram) | |
6802 SetGLError(GL_INVALID_OPERATION, | |
6803 "glGetProgramInfoCHROMIUM: program not linked"); | |
6804 return error::kNoError; | |
6805 } | |
6806 } | 6798 } |
6807 info->GetProgramInfo(bucket); | 6799 info->GetProgramInfo(bucket); |
6808 return error::kNoError; | 6800 return error::kNoError; |
6809 } | 6801 } |
6810 | 6802 |
6811 error::ContextLostReason GLES2DecoderImpl::GetContextLostReason() { | 6803 error::ContextLostReason GLES2DecoderImpl::GetContextLostReason() { |
6812 switch (reset_status_) { | 6804 switch (reset_status_) { |
6813 case GL_NO_ERROR: | 6805 case GL_NO_ERROR: |
6814 // TODO(kbr): improve the precision of the error code in this case. | 6806 // TODO(kbr): improve the precision of the error code in this case. |
6815 // Consider delegating to context for error code if MakeCurrent fails. | 6807 // Consider delegating to context for error code if MakeCurrent fails. |
(...skipping 25 matching lines...) Expand all Loading... |
6841 return false; | 6833 return false; |
6842 } | 6834 } |
6843 | 6835 |
6844 // Include the auto-generated part of this file. We split this because it means | 6836 // Include the auto-generated part of this file. We split this because it means |
6845 // we can easily edit the non-auto generated parts right here in this file | 6837 // we can easily edit the non-auto generated parts right here in this file |
6846 // instead of having to edit some template or the code generator. | 6838 // instead of having to edit some template or the code generator. |
6847 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 6839 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
6848 | 6840 |
6849 } // namespace gles2 | 6841 } // namespace gles2 |
6850 } // namespace gpu | 6842 } // namespace gpu |
OLD | NEW |