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 9046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9057 return error::kOutOfBounds; | 9057 return error::kOutOfBounds; |
9058 } | 9058 } |
9059 const GLuint* shaders = GetSharedMemoryAs<const GLuint*>( | 9059 const GLuint* shaders = GetSharedMemoryAs<const GLuint*>( |
9060 c.shaders_shm_id, c.shaders_shm_offset, data_size); | 9060 c.shaders_shm_id, c.shaders_shm_offset, data_size); |
9061 GLenum binaryformat = static_cast<GLenum>(c.binaryformat); | 9061 GLenum binaryformat = static_cast<GLenum>(c.binaryformat); |
9062 const void* binary = GetSharedMemoryAs<const void*>( | 9062 const void* binary = GetSharedMemoryAs<const void*>( |
9063 c.binary_shm_id, c.binary_shm_offset, length); | 9063 c.binary_shm_id, c.binary_shm_offset, length); |
9064 if (shaders == NULL || binary == NULL) { | 9064 if (shaders == NULL || binary == NULL) { |
9065 return error::kOutOfBounds; | 9065 return error::kOutOfBounds; |
9066 } | 9066 } |
9067 scoped_array<GLuint> service_ids(new GLuint[n]); | 9067 scoped_ptr<GLuint[]> service_ids(new GLuint[n]); |
9068 for (GLsizei ii = 0; ii < n; ++ii) { | 9068 for (GLsizei ii = 0; ii < n; ++ii) { |
9069 Shader* shader = GetShader(shaders[ii]); | 9069 Shader* shader = GetShader(shaders[ii]); |
9070 if (!shader) { | 9070 if (!shader) { |
9071 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glShaderBinary", "unknown shader"); | 9071 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glShaderBinary", "unknown shader"); |
9072 return error::kNoError; | 9072 return error::kNoError; |
9073 } | 9073 } |
9074 service_ids[ii] = shader->service_id(); | 9074 service_ids[ii] = shader->service_id(); |
9075 } | 9075 } |
9076 // TODO(gman): call glShaderBinary | 9076 // TODO(gman): call glShaderBinary |
9077 return error::kNoError; | 9077 return error::kNoError; |
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10767 } | 10767 } |
10768 } | 10768 } |
10769 | 10769 |
10770 // Include the auto-generated part of this file. We split this because it means | 10770 // Include the auto-generated part of this file. We split this because it means |
10771 // we can easily edit the non-auto generated parts right here in this file | 10771 // we can easily edit the non-auto generated parts right here in this file |
10772 // instead of having to edit some template or the code generator. | 10772 // instead of having to edit some template or the code generator. |
10773 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10773 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10774 | 10774 |
10775 } // namespace gles2 | 10775 } // namespace gles2 |
10776 } // namespace gpu | 10776 } // namespace gpu |
OLD | NEW |