OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include <vector> | 6 #include <vector> |
7 #include <string> | 7 #include <string> |
8 #include <map> | 8 #include <map> |
9 #include <build/build_config.h> | 9 #include <build/build_config.h> |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 } | 975 } |
976 | 976 |
977 // Decode command with its arguments, and call the corresponding GL function. | 977 // Decode command with its arguments, and call the corresponding GL function. |
978 // Note: args is a pointer to the command buffer. As such, it could be changed | 978 // Note: args is a pointer to the command buffer. As such, it could be changed |
979 // by a (malicious) client at any time, so if validation has to happen, it | 979 // by a (malicious) client at any time, so if validation has to happen, it |
980 // should operate on a copy of them. | 980 // should operate on a copy of them. |
981 parse_error::ParseError GLES2DecoderImpl::DoCommand( | 981 parse_error::ParseError GLES2DecoderImpl::DoCommand( |
982 unsigned int command, | 982 unsigned int command, |
983 unsigned int arg_count, | 983 unsigned int arg_count, |
984 const void* cmd_data) { | 984 const void* cmd_data) { |
985 parse_error::ParseError result; | 985 parse_error::ParseError result = parse_error::kParseNoError; |
986 if (debug()) { | 986 if (debug()) { |
987 // TODO(gman): Change output to something useful for NaCl. | 987 // TODO(gman): Change output to something useful for NaCl. |
988 printf("cmd: %s\n", GetCommandName(command)); | 988 printf("cmd: %s\n", GetCommandName(command)); |
989 } | 989 } |
990 unsigned int command_index = command - kStartPoint - 1; | 990 unsigned int command_index = command - kStartPoint - 1; |
991 if (command_index < arraysize(g_command_info)) { | 991 if (command_index < arraysize(g_command_info)) { |
992 const CommandInfo& info = g_command_info[command_index]; | 992 const CommandInfo& info = g_command_info[command_index]; |
993 unsigned int info_arg_count = static_cast<unsigned int>(info.arg_count); | 993 unsigned int info_arg_count = static_cast<unsigned int>(info.arg_count); |
994 if ((info.arg_flags == cmd::kFixed && arg_count == info_arg_count) || | 994 if ((info.arg_flags == cmd::kFixed && arg_count == info_arg_count) || |
995 (info.arg_flags == cmd::kAtLeastN && arg_count >= info_arg_count)) { | 995 (info.arg_flags == cmd::kAtLeastN && arg_count >= info_arg_count)) { |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 return parse_error::kParseNoError; | 1752 return parse_error::kParseNoError; |
1753 } | 1753 } |
1754 | 1754 |
1755 // Include the auto-generated part of this file. We split this because it means | 1755 // Include the auto-generated part of this file. We split this because it means |
1756 // we can easily edit the non-auto generated parts right here in this file | 1756 // we can easily edit the non-auto generated parts right here in this file |
1757 // instead of having to edit some template or the code generator. | 1757 // instead of having to edit some template or the code generator. |
1758 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 1758 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
1759 | 1759 |
1760 } // namespace gles2 | 1760 } // namespace gles2 |
1761 } // namespace gpu | 1761 } // namespace gpu |
OLD | NEW |