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 7004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7015 *static_cast<const gles2::cmds::DrawElements*>(cmd_data); | 7015 *static_cast<const gles2::cmds::DrawElements*>(cmd_data); |
7016 return DoDrawElements("glDrawElements", | 7016 return DoDrawElements("glDrawElements", |
7017 false, | 7017 false, |
7018 static_cast<GLenum>(c.mode), | 7018 static_cast<GLenum>(c.mode), |
7019 static_cast<GLsizei>(c.count), | 7019 static_cast<GLsizei>(c.count), |
7020 static_cast<GLenum>(c.type), | 7020 static_cast<GLenum>(c.type), |
7021 static_cast<int32>(c.index_offset), | 7021 static_cast<int32>(c.index_offset), |
7022 1); | 7022 1); |
7023 } | 7023 } |
7024 | 7024 |
7025 error::Error GLES2DecoderImpl::HandleDrawRangeElements( | |
7026 uint32 immediate_data_size, | |
7027 const void* cmd_data) { | |
7028 if (!unsafe_es3_apis_enabled()) | |
7029 return error::kUnknownCommand; | |
7030 const gles2::cmds::DrawRangeElements& c = | |
7031 *static_cast<const gles2::cmds::DrawRangeElements*>(cmd_data); | |
7032 size_t offset = static_cast<size_t>(c.index_offset); | |
7033 const GLvoid* indices = reinterpret_cast<const GLvoid*>(offset); | |
7034 glDrawRangeElements(static_cast<GLenum>(c.mode), | |
piman
2015/02/25 23:28:47
I'm pretty sure many things won't work right if we
| |
7035 static_cast<GLuint>(c.start), | |
7036 static_cast<GLuint>(c.end), | |
7037 static_cast<GLsizei>(c.count), | |
7038 static_cast<GLenum>(c.type), | |
7039 indices); | |
7040 return error::kNoError; | |
7041 } | |
7042 | |
7025 error::Error GLES2DecoderImpl::HandleDrawElementsInstancedANGLE( | 7043 error::Error GLES2DecoderImpl::HandleDrawElementsInstancedANGLE( |
7026 uint32 immediate_data_size, | 7044 uint32 immediate_data_size, |
7027 const void* cmd_data) { | 7045 const void* cmd_data) { |
7028 const gles2::cmds::DrawElementsInstancedANGLE& c = | 7046 const gles2::cmds::DrawElementsInstancedANGLE& c = |
7029 *static_cast<const gles2::cmds::DrawElementsInstancedANGLE*>(cmd_data); | 7047 *static_cast<const gles2::cmds::DrawElementsInstancedANGLE*>(cmd_data); |
7030 if (!features().angle_instanced_arrays) { | 7048 if (!features().angle_instanced_arrays) { |
7031 LOCAL_SET_GL_ERROR( | 7049 LOCAL_SET_GL_ERROR( |
7032 GL_INVALID_OPERATION, | 7050 GL_INVALID_OPERATION, |
7033 "glDrawElementsInstancedANGLE", "function not available"); | 7051 "glDrawElementsInstancedANGLE", "function not available"); |
7034 return error::kNoError; | 7052 return error::kNoError; |
(...skipping 5091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12126 } | 12144 } |
12127 } | 12145 } |
12128 | 12146 |
12129 // Include the auto-generated part of this file. We split this because it means | 12147 // Include the auto-generated part of this file. We split this because it means |
12130 // we can easily edit the non-auto generated parts right here in this file | 12148 // we can easily edit the non-auto generated parts right here in this file |
12131 // instead of having to edit some template or the code generator. | 12149 // instead of having to edit some template or the code generator. |
12132 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 12150 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
12133 | 12151 |
12134 } // namespace gles2 | 12152 } // namespace gles2 |
12135 } // namespace gpu | 12153 } // namespace gpu |
OLD | NEW |