| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 4688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4699 error::Error GLES2DecoderImpl::HandleBindAttribLocation( | 4699 error::Error GLES2DecoderImpl::HandleBindAttribLocation( |
| 4700 uint32 immediate_data_size, const cmds::BindAttribLocation& c) { | 4700 uint32 immediate_data_size, const cmds::BindAttribLocation& c) { |
| 4701 GLuint program = static_cast<GLuint>(c.program); | 4701 GLuint program = static_cast<GLuint>(c.program); |
| 4702 GLuint index = static_cast<GLuint>(c.index); | 4702 GLuint index = static_cast<GLuint>(c.index); |
| 4703 uint32 name_size = c.data_size; | 4703 uint32 name_size = c.data_size; |
| 4704 const char* name = GetSharedMemoryAs<const char*>( | 4704 const char* name = GetSharedMemoryAs<const char*>( |
| 4705 c.name_shm_id, c.name_shm_offset, name_size); | 4705 c.name_shm_id, c.name_shm_offset, name_size); |
| 4706 if (name == NULL) { | 4706 if (name == NULL) { |
| 4707 return error::kOutOfBounds; | 4707 return error::kOutOfBounds; |
| 4708 } | 4708 } |
| 4709 String name_str(name, name_size); | 4709 std::string name_str(name, name_size); |
| 4710 DoBindAttribLocation(program, index, name_str.c_str()); | 4710 DoBindAttribLocation(program, index, name_str.c_str()); |
| 4711 return error::kNoError; | 4711 return error::kNoError; |
| 4712 } | 4712 } |
| 4713 | 4713 |
| 4714 error::Error GLES2DecoderImpl::HandleBindAttribLocationBucket( | 4714 error::Error GLES2DecoderImpl::HandleBindAttribLocationBucket( |
| 4715 uint32 immediate_data_size, const cmds::BindAttribLocationBucket& c) { | 4715 uint32 immediate_data_size, const cmds::BindAttribLocationBucket& c) { |
| 4716 GLuint program = static_cast<GLuint>(c.program); | 4716 GLuint program = static_cast<GLuint>(c.program); |
| 4717 GLuint index = static_cast<GLuint>(c.index); | 4717 GLuint index = static_cast<GLuint>(c.index); |
| 4718 Bucket* bucket = GetBucket(c.name_bucket_id); | 4718 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 4719 if (!bucket || bucket->size() == 0) { | 4719 if (!bucket || bucket->size() == 0) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4764 error::Error GLES2DecoderImpl::HandleBindUniformLocationCHROMIUM( | 4764 error::Error GLES2DecoderImpl::HandleBindUniformLocationCHROMIUM( |
| 4765 uint32 immediate_data_size, const cmds::BindUniformLocationCHROMIUM& c) { | 4765 uint32 immediate_data_size, const cmds::BindUniformLocationCHROMIUM& c) { |
| 4766 GLuint program = static_cast<GLuint>(c.program); | 4766 GLuint program = static_cast<GLuint>(c.program); |
| 4767 GLint location = static_cast<GLint>(c.location); | 4767 GLint location = static_cast<GLint>(c.location); |
| 4768 uint32 name_size = c.data_size; | 4768 uint32 name_size = c.data_size; |
| 4769 const char* name = GetSharedMemoryAs<const char*>( | 4769 const char* name = GetSharedMemoryAs<const char*>( |
| 4770 c.name_shm_id, c.name_shm_offset, name_size); | 4770 c.name_shm_id, c.name_shm_offset, name_size); |
| 4771 if (name == NULL) { | 4771 if (name == NULL) { |
| 4772 return error::kOutOfBounds; | 4772 return error::kOutOfBounds; |
| 4773 } | 4773 } |
| 4774 String name_str(name, name_size); | 4774 std::string name_str(name, name_size); |
| 4775 DoBindUniformLocationCHROMIUM(program, location, name_str.c_str()); | 4775 DoBindUniformLocationCHROMIUM(program, location, name_str.c_str()); |
| 4776 return error::kNoError; | 4776 return error::kNoError; |
| 4777 } | 4777 } |
| 4778 | 4778 |
| 4779 error::Error GLES2DecoderImpl::HandleBindUniformLocationCHROMIUMBucket( | 4779 error::Error GLES2DecoderImpl::HandleBindUniformLocationCHROMIUMBucket( |
| 4780 uint32 immediate_data_size, | 4780 uint32 immediate_data_size, |
| 4781 const cmds::BindUniformLocationCHROMIUMBucket& c) { | 4781 const cmds::BindUniformLocationCHROMIUMBucket& c) { |
| 4782 GLuint program = static_cast<GLuint>(c.program); | 4782 GLuint program = static_cast<GLuint>(c.program); |
| 4783 GLint location = static_cast<GLint>(c.location); | 4783 GLint location = static_cast<GLint>(c.location); |
| 4784 Bucket* bucket = GetBucket(c.name_bucket_id); | 4784 Bucket* bucket = GetBucket(c.name_bucket_id); |
| (...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7614 } | 7614 } |
| 7615 | 7615 |
| 7616 error::Error GLES2DecoderImpl::HandleGetAttribLocation( | 7616 error::Error GLES2DecoderImpl::HandleGetAttribLocation( |
| 7617 uint32 immediate_data_size, const cmds::GetAttribLocation& c) { | 7617 uint32 immediate_data_size, const cmds::GetAttribLocation& c) { |
| 7618 uint32 name_size = c.data_size; | 7618 uint32 name_size = c.data_size; |
| 7619 const char* name = GetSharedMemoryAs<const char*>( | 7619 const char* name = GetSharedMemoryAs<const char*>( |
| 7620 c.name_shm_id, c.name_shm_offset, name_size); | 7620 c.name_shm_id, c.name_shm_offset, name_size); |
| 7621 if (!name) { | 7621 if (!name) { |
| 7622 return error::kOutOfBounds; | 7622 return error::kOutOfBounds; |
| 7623 } | 7623 } |
| 7624 String name_str(name, name_size); | 7624 std::string name_str(name, name_size); |
| 7625 return GetAttribLocationHelper( | 7625 return GetAttribLocationHelper( |
| 7626 c.program, c.location_shm_id, c.location_shm_offset, name_str); | 7626 c.program, c.location_shm_id, c.location_shm_offset, name_str); |
| 7627 } | 7627 } |
| 7628 | 7628 |
| 7629 error::Error GLES2DecoderImpl::HandleGetAttribLocationBucket( | 7629 error::Error GLES2DecoderImpl::HandleGetAttribLocationBucket( |
| 7630 uint32 immediate_data_size, const cmds::GetAttribLocationBucket& c) { | 7630 uint32 immediate_data_size, const cmds::GetAttribLocationBucket& c) { |
| 7631 Bucket* bucket = GetBucket(c.name_bucket_id); | 7631 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 7632 if (!bucket) { | 7632 if (!bucket) { |
| 7633 return error::kInvalidArguments; | 7633 return error::kInvalidArguments; |
| 7634 } | 7634 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7673 } | 7673 } |
| 7674 | 7674 |
| 7675 error::Error GLES2DecoderImpl::HandleGetUniformLocation( | 7675 error::Error GLES2DecoderImpl::HandleGetUniformLocation( |
| 7676 uint32 immediate_data_size, const cmds::GetUniformLocation& c) { | 7676 uint32 immediate_data_size, const cmds::GetUniformLocation& c) { |
| 7677 uint32 name_size = c.data_size; | 7677 uint32 name_size = c.data_size; |
| 7678 const char* name = GetSharedMemoryAs<const char*>( | 7678 const char* name = GetSharedMemoryAs<const char*>( |
| 7679 c.name_shm_id, c.name_shm_offset, name_size); | 7679 c.name_shm_id, c.name_shm_offset, name_size); |
| 7680 if (!name) { | 7680 if (!name) { |
| 7681 return error::kOutOfBounds; | 7681 return error::kOutOfBounds; |
| 7682 } | 7682 } |
| 7683 String name_str(name, name_size); | 7683 std::string name_str(name, name_size); |
| 7684 return GetUniformLocationHelper( | 7684 return GetUniformLocationHelper( |
| 7685 c.program, c.location_shm_id, c.location_shm_offset, name_str); | 7685 c.program, c.location_shm_id, c.location_shm_offset, name_str); |
| 7686 } | 7686 } |
| 7687 | 7687 |
| 7688 error::Error GLES2DecoderImpl::HandleGetUniformLocationBucket( | 7688 error::Error GLES2DecoderImpl::HandleGetUniformLocationBucket( |
| 7689 uint32 immediate_data_size, const cmds::GetUniformLocationBucket& c) { | 7689 uint32 immediate_data_size, const cmds::GetUniformLocationBucket& c) { |
| 7690 Bucket* bucket = GetBucket(c.name_bucket_id); | 7690 Bucket* bucket = GetBucket(c.name_bucket_id); |
| 7691 if (!bucket) { | 7691 if (!bucket) { |
| 7692 return error::kInvalidArguments; | 7692 return error::kInvalidArguments; |
| 7693 } | 7693 } |
| (...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10787 } | 10787 } |
| 10788 } | 10788 } |
| 10789 | 10789 |
| 10790 // Include the auto-generated part of this file. We split this because it means | 10790 // Include the auto-generated part of this file. We split this because it means |
| 10791 // we can easily edit the non-auto generated parts right here in this file | 10791 // we can easily edit the non-auto generated parts right here in this file |
| 10792 // instead of having to edit some template or the code generator. | 10792 // instead of having to edit some template or the code generator. |
| 10793 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10793 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 10794 | 10794 |
| 10795 } // namespace gles2 | 10795 } // namespace gles2 |
| 10796 } // namespace gpu | 10796 } // namespace gpu |
| OLD | NEW |