diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-01 22:24:14 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-01 22:24:14 +0000 |
commit | f7a64eee4a7c9556a2199bebb4110f7cef9b6d3c (patch) | |
tree | 487908060385ef696fdcf5dc9078cbb4b5dcdf2b | |
parent | c0c4565b3c287e7aca0ed2b913f82a74155fb813 (diff) | |
download | chromium_src-f7a64eee4a7c9556a2199bebb4110f7cef9b6d3c.zip chromium_src-f7a64eee4a7c9556a2199bebb4110f7cef9b6d3c.tar.gz chromium_src-f7a64eee4a7c9556a2199bebb4110f7cef9b6d3c.tar.bz2 |
Renamed ParseError -> Error, parse_error -> error, kParseNoError -> kNoError, commandBufferEntries -> commandBufferSize.
Added NPDevice3DContextError enumeration.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/558054
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37751 0039d316-1c4b-4281-b951-d872f2087c98
37 files changed, 1429 insertions, 1420 deletions
diff --git a/chrome/common/command_buffer_messages.h b/chrome/common/command_buffer_messages.h index 7e3ae9c..144ff2f 100644 --- a/chrome/common/command_buffer_messages.h +++ b/chrome/common/command_buffer_messages.h @@ -26,7 +26,7 @@ struct ParamTraits<gpu::CommandBuffer::State> { m->ReadInt(iter, &p->put_offset) && m->ReadInt(iter, &p->token) && m->ReadInt(iter, &temp)) { - p->error = static_cast<gpu::parse_error::ParseError>(temp); + p->error = static_cast<gpu::error::Error>(temp); return true; } else { return false; diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc index e63ca5a..2b08090 100644 --- a/chrome/renderer/command_buffer_proxy.cc +++ b/chrome/renderer/command_buffer_proxy.cc @@ -165,7 +165,7 @@ void CommandBufferProxy::SetToken(int32 token) { } void CommandBufferProxy::SetParseError( - gpu::parse_error::ParseError parse_error) { + gpu::error::Error error) { // Not implemented in proxy. NOTREACHED(); } diff --git a/chrome/renderer/command_buffer_proxy.h b/chrome/renderer/command_buffer_proxy.h index 849f540..077b0c5 100644 --- a/chrome/renderer/command_buffer_proxy.h +++ b/chrome/renderer/command_buffer_proxy.h @@ -42,7 +42,7 @@ class CommandBufferProxy : public gpu::CommandBuffer, virtual void DestroyTransferBuffer(int32 id); virtual gpu::Buffer GetTransferBuffer(int32 handle); virtual void SetToken(int32 token); - virtual void SetParseError(gpu::parse_error::ParseError parse_error); + virtual void SetParseError(gpu::error::Error error); private: // As with the service, the client takes ownership of the ring buffer. diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index b9b61fe..4a17fc8 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -337,7 +337,7 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext( command_buffer_.reset(nested_delegate_->CreateCommandBuffer()); if (command_buffer_.get()) { // Initialize the proxy command buffer. - if (command_buffer_->Initialize(config->commandBufferEntries)) { + if (command_buffer_->Initialize(config->commandBufferSize)) { // Get the initial command buffer state. gpu::CommandBuffer::State state = command_buffer_->GetState(); @@ -345,7 +345,7 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext( context->reserved = NULL; Buffer ring_buffer = command_buffer_->GetRingBuffer(); context->commandBuffer = ring_buffer.ptr; - context->commandBufferEntries = state.size; + context->commandBufferSize = state.size; Synchronize3DContext(context, state); // Ensure the service knows the window size before rendering anything. @@ -700,6 +700,6 @@ void WebPluginDelegatePepper::Synchronize3DContext( context->getOffset = state.get_offset; context->putOffset = state.put_offset; context->token = state.token; - context->error = static_cast<int32>(state.error); + context->error = static_cast<NPDeviceContext3DError>(state.error); } #endif // ENABLE_GPU diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 97de292..6dd96a4 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -1194,7 +1194,7 @@ class TypeHandler(object): def WriteServiceImplementation(self, func, file): """Writes the service implementation for a command.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) if len(func.GetOriginalArgs()) > 0: @@ -1206,14 +1206,14 @@ class TypeHandler(object): last_arg.WriteGetCode(file) func.WriteHandlerValidation(file) func.WriteHandlerImplementation(file) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteImmediateServiceImplementation(self, func, file): """Writes the service implementation for an immediate version of command.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() @@ -1224,7 +1224,7 @@ class TypeHandler(object): last_arg.WriteGetCode(file) func.WriteHandlerValidation(file) func.WriteHandlerImplementation(file) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") @@ -1258,7 +1258,7 @@ class TypeHandler(object): num_invalid_values = arg.GetNumInvalidValues() for value_index in range(0, num_invalid_values): arg_strings = [] - parse_result = "kParseNoError" + parse_result = "kNoError" count = 0 for arg in func.GetOriginalArgs(): if count == arg_index: @@ -1303,7 +1303,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } """ self.WriteValidUnitTest(func, file, valid_test) @@ -1314,7 +1314,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s); - EXPECT_EQ(parse_error::%(parse_result)s, ExecuteCmd(cmd)); + EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd)); } """ self.WriteInvalidUnitTest(func, file, invalid_test) @@ -1653,14 +1653,14 @@ class GENnHandler(TypeHandler): def WriteHandlerImplementation (self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n" - " return parse_error::kParseInvalidArguments;\n" + " return error::kInvalidArguments;\n" " }\n" % (func.name, func.GetLastOriginalArg().name)) def WriteImmediateHandlerImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write(" if (!GenGLObjects<GL%sHelper>(n, %s)) {\n" - " return parse_error::kParseInvalidArguments;\n" + " return error::kInvalidArguments;\n" " }\n" % (func.original_name, func.GetLastOriginalArg().name)) @@ -1685,7 +1685,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } """ @@ -1697,7 +1697,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s); - EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); + EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); } """ self.WriteValidUnitTest(func, file, invalid_test, { @@ -1714,7 +1714,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { GLuint temp = kNewClientId; SpecializedSetup<%(name)s, 0>(); cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -1726,7 +1726,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) { %(name)s& cmd = *GetImmediateAs<%(name)s>(); SpecializedSetup<%(name)s, 0>(); cmd.Init(1, &client_%(resource_name)s_id_); - EXPECT_EQ(parse_error::kParseInvalidArguments, + EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_%(resource_name)s_id_))); } """ @@ -1850,7 +1850,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s%(comma)skNewClientId); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } """ @@ -1866,7 +1866,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s%(comma)skNewClientId); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } """ self.WriteInvalidUnitTest(func, file, invalid_test, { @@ -1915,7 +1915,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } """ @@ -1932,7 +1932,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } """ self.WriteValidUnitTest(func, file, invalid_test) @@ -1948,7 +1948,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { %(name)s& cmd = *GetImmediateAs<%(name)s>(); SpecializedSetup<%(name)s, 0>(); cmd.Init(1, &client_%(resource_name)s_id_); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_))); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -1966,7 +1966,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs) { SpecializedSetup<%(name)s, 0>(); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } """ @@ -2103,7 +2103,7 @@ class GETnHandler(TypeHandler): def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() @@ -2119,7 +2119,7 @@ class GETnHandler(TypeHandler): file.Write(" c.params_shm_id, c.params_shm_offset, params_size);\n") func.WriteHandlerValidation(file) func.WriteHandlerImplementation(file) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") @@ -2161,7 +2161,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(data_type)s temp[%(data_count)s] = { 0, }; cmd.Init(%(gl_args)s, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } """ @@ -2187,7 +2187,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { SpecializedSetup<%(name)s, 0>(); %(data_type)s temp[%(data_count)s] = { 0, }; cmd.Init(%(all_but_last_args)s, &temp[0]); - EXPECT_EQ(parse_error::%(parse_result)s, + EXPECT_EQ(error::%(parse_result)s, ExecuteImmediateCmd(cmd, sizeof(temp))); } """ @@ -2332,7 +2332,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(data_type)s temp[%(data_count)s * 2] = { 0, }; cmd.Init(%(gl_args)s, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } """ @@ -2358,7 +2358,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { SpecializedSetup<%(name)s, 0>(); %(data_type)s temp[%(data_count)s * 2] = { 0, }; cmd.Init(%(all_but_last_args)s, &temp[0]); - EXPECT_EQ(parse_error::%(parse_result)s, + EXPECT_EQ(error::%(parse_result)s, ExecuteImmediateCmd(cmd, sizeof(temp))); } """ @@ -2506,7 +2506,7 @@ class GLcharHandler(TypeHandler): def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() @@ -2525,14 +2525,14 @@ class GLcharHandler(TypeHandler): file.Write(" String name_str(name, name_size);\n") file.Write(" %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteImmediateServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() @@ -2550,7 +2550,7 @@ class GLcharHandler(TypeHandler): file.Write(" String name_str(name, name_size);\n") file.Write(" %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") @@ -2687,7 +2687,7 @@ class GetGLcharHandler(GLcharHandler): def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() @@ -2710,14 +2710,14 @@ class GetGLcharHandler(GLcharHandler): file.Write(" String name_str(name, name_size);\n") file.Write(" *location = %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") def WriteImmediateServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) last_arg = func.GetLastOriginalArg() @@ -2739,7 +2739,7 @@ class GetGLcharHandler(GLcharHandler): file.Write(" String name_str(name, name_size);\n") file.Write(" *location = %s(%s, name_str.c_str());\n" % (func.GetGLFunctionName(), arg_string)) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") @@ -2864,7 +2864,7 @@ TEST_F(GLES2DecoderTest, %(name)sValidArgs) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } """ comma = "" @@ -2880,7 +2880,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { SpecializedSetup<%(name)s, 0>(); %(name)s cmd; cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::%(parse_result)s, ExecuteCmd(cmd)); + EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd)); } """ self.WriteInvalidUnitTest(func, file, invalid_test, { @@ -2890,7 +2890,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() @@ -2904,7 +2904,7 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { func.WriteHandlerValidation(file) file.Write(" *result_dst = %s(%s);\n" % (func.GetGLFunctionName(), func.MakeOriginalArgString(""))) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") @@ -2948,7 +2948,7 @@ class STRnHandler(TypeHandler): def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( - "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) + "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetOriginalArgs() @@ -2964,7 +2964,7 @@ class STRnHandler(TypeHandler): " length = GetSharedMemoryAs<GLsizei*>(\n" " size_shm_id, size_shm_offset, sizeof(*length));\n" " if (!length) {\n" - " return parse_error::kParseOutOfBounds;\n" + " return error::kOutOfBounds;\n" " }\n" " }\n") dest_arg = args[-1] @@ -2979,7 +2979,7 @@ class STRnHandler(TypeHandler): arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerImplementation(file) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") @@ -3071,7 +3071,7 @@ class EnumBaseArgument(Argument): def WriteValidationCode(self, file): file.Write(" if (!Validate%s(%s)) {\n" % (self.local_type, self.name)) file.Write(" SetGLError(%s);\n" % self.gl_error) - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write(" }\n") def GetValidArg(self, offset, index): @@ -3100,8 +3100,8 @@ class EnumBaseArgument(Argument): num_invalid = len(invalid) if index >= num_invalid: index = num_invalid - 1 - return (invalid[index], "kParseNoError") - return ("---ERROR1---", "kParseNoError") + return (invalid[index], "kNoError") + return ("---ERROR1---", "kNoError") class EnumArgument(EnumBaseArgument): @@ -3156,7 +3156,7 @@ class ImmediatePointerArgument(Argument): def WriteValidationCode(self, file): """Overridden from Argument.""" file.Write(" if (%s == NULL) {\n" % self.name) - file.Write(" return parse_error::kParseOutOfBounds;\n") + file.Write(" return error::kOutOfBounds;\n") file.Write(" }\n") def GetImmediateVersion(self): @@ -3189,10 +3189,10 @@ class PointerArgument(Argument): def GetInvalidArg(self, offset, index): """Overridden from Argument.""" if index == 0: - return ("kInvalidSharedMemoryId, 0", "kParseOutOfBounds") + return ("kInvalidSharedMemoryId, 0", "kOutOfBounds") else: return ("shared_memory_id_, kInvalidSharedMemoryOffset", - "kParseOutOfBounds") + "kOutOfBounds") def AddCmdArgs(self, args): """Overridden from Argument.""" @@ -3220,7 +3220,7 @@ class PointerArgument(Argument): def WriteValidationCode(self, file): """Overridden from Argument.""" file.Write(" if (%s == NULL) {\n" % self.name) - file.Write(" return parse_error::kParseOutOfBounds;\n") + file.Write(" return error::kOutOfBounds;\n") file.Write(" }\n") def GetImmediateVersion(self): @@ -3258,7 +3258,7 @@ class ResourceIdArgument(Argument): file.Write(" if (!id_manager_->GetServiceId(c.%s, &%s)) {\n" % (self.name, self.name)) file.Write(" SetGLError(GL_INVALID_VALUE);\n") - file.Write(" return parse_error::kParseNoError;\n") + file.Write(" return error::kNoError;\n") file.Write(" }\n") def GetValidArg(self, offset, index): @@ -3837,7 +3837,7 @@ class GLGenerator(object): def WriteServiceUtilsHeader(self, filename): """Writes the gles2 auto generated utility header.""" file = CHeaderWriter(filename) - for enum in _ENUM_LISTS: + for enum in sorted(_ENUM_LISTS.keys()): file.Write("bool Validate%s%s(GLenum value);\n" % (_ENUM_LISTS[enum]['type'], enum)) file.Write("\n") file.Close() @@ -3845,7 +3845,7 @@ class GLGenerator(object): def WriteServiceUtilsImplementation(self, filename): """Writes the gles2 auto generated utility implementation.""" file = CHeaderWriter(filename) - for enum in _ENUM_LISTS: + for enum in sorted(_ENUM_LISTS.keys()): file.Write("bool Validate%s%s(GLenum value) {\n" % (_ENUM_LISTS[enum]['type'], enum)) file.Write(" switch (value) {\n") for value in _ENUM_LISTS[enum]['valid']: diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc index d58338e..2fe8b66 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc @@ -38,7 +38,7 @@ CommandBufferHelper::~CommandBufferHelper() { bool CommandBufferHelper::Flush() { CommandBuffer::State state = command_buffer_->Flush(put_); SynchronizeState(state); - return state.error == parse_error::kParseNoError; + return state.error == error::kNoError; } // Calls Flush() and then waits until the buffer is empty. Break early if the @@ -142,10 +142,10 @@ CommandBufferEntry* CommandBufferHelper::GetSpace(uint32 entries) { return space; } -parse_error::ParseError CommandBufferHelper::GetError() { +error::Error CommandBufferHelper::GetError() { CommandBuffer::State state = command_buffer_->GetState(); SynchronizeState(state); - return static_cast<parse_error::ParseError>(state.error); + return static_cast<error::Error>(state.error); } void CommandBufferHelper::SynchronizeState(CommandBuffer::State state) { diff --git a/gpu/command_buffer/client/cmd_buffer_helper.h b/gpu/command_buffer/client/cmd_buffer_helper.h index d26d927..72984d1 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.h +++ b/gpu/command_buffer/client/cmd_buffer_helper.h @@ -103,7 +103,7 @@ class CommandBufferHelper { return *reinterpret_cast<T*>(data); } - parse_error::ParseError GetError(); + error::Error GetError(); // Common Commands void Noop(uint32 skip_count) { diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index 3134051..7d12a3e 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc @@ -36,7 +36,7 @@ class CommandBufferHelperTest : public testing::Test { // ignore noops in the mock - we don't want to inspect the internals of the // helper. EXPECT_CALL(*api_mock_, DoCommand(0, _, _)) - .WillRepeatedly(Return(parse_error::kParseNoError)); + .WillRepeatedly(Return(error::kNoError)); command_buffer_.reset(new CommandBufferService); command_buffer_->Initialize(kNumCommandEntries); @@ -68,7 +68,7 @@ class CommandBufferHelperTest : public testing::Test { // Adds a command to the buffer through the helper, while adding it as an // expected call on the API mock. - void AddCommandWithExpect(parse_error::ParseError _return, + void AddCommandWithExpect(error::Error _return, unsigned int command, int arg_count, CommandBufferEntry *args) { @@ -119,7 +119,7 @@ class CommandBufferHelperTest : public testing::Test { return command_buffer_->GetState().put_offset; } - parse_error::ParseError GetError() { + error::Error GetError() { return command_buffer_->GetState().error; } @@ -140,21 +140,21 @@ TEST_F(CommandBufferHelperTest, TestCommandProcessing) { // Check initial state of the engine - it should have been configured by the // helper. EXPECT_TRUE(parser_ != NULL); - EXPECT_EQ(parse_error::kParseNoError, GetError()); + EXPECT_EQ(error::kNoError, GetError()); EXPECT_EQ(0, GetGetOffset()); // Add 3 commands through the helper - AddCommandWithExpect(parse_error::kParseNoError, 1, 0, NULL); + AddCommandWithExpect(error::kNoError, 1, 0, NULL); CommandBufferEntry args1[2]; args1[0].value_uint32 = 3; args1[1].value_float = 4.f; - AddCommandWithExpect(parse_error::kParseNoError, 2, 2, args1); + AddCommandWithExpect(error::kNoError, 2, 2, args1); CommandBufferEntry args2[2]; args2[0].value_uint32 = 5; args2[1].value_float = 6.f; - AddCommandWithExpect(parse_error::kParseNoError, 3, 2, args2); + AddCommandWithExpect(error::kNoError, 3, 2, args2); helper_->Flush(); // Check that the engine has work to do now. @@ -169,7 +169,7 @@ TEST_F(CommandBufferHelperTest, TestCommandProcessing) { Mock::VerifyAndClearExpectations(api_mock_.get()); // Check the error status. - EXPECT_EQ(parse_error::kParseNoError, GetError()); + EXPECT_EQ(error::kNoError, GetError()); } // Checks that commands in the buffer are properly executed when wrapping the @@ -181,7 +181,7 @@ TEST_F(CommandBufferHelperTest, TestCommandWrapping) { args1[1].value_float = 4.f; for (unsigned int i = 0; i < 5; ++i) { - AddCommandWithExpect(parse_error::kParseNoError, i + 1, 2, args1); + AddCommandWithExpect(error::kNoError, i + 1, 2, args1); } helper_->Finish(); @@ -189,7 +189,7 @@ TEST_F(CommandBufferHelperTest, TestCommandWrapping) { Mock::VerifyAndClearExpectations(api_mock_.get()); // Check the error status. - EXPECT_EQ(parse_error::kParseNoError, GetError()); + EXPECT_EQ(error::kNoError, GetError()); } // Checks that asking for available entries work, and that the parser @@ -200,10 +200,10 @@ TEST_F(CommandBufferHelperTest, TestAvailableEntries) { args[1].value_float = 4.f; // Add 2 commands through the helper - 8 entries - AddCommandWithExpect(parse_error::kParseNoError, 1, 0, NULL); - AddCommandWithExpect(parse_error::kParseNoError, 2, 0, NULL); - AddCommandWithExpect(parse_error::kParseNoError, 3, 2, args); - AddCommandWithExpect(parse_error::kParseNoError, 4, 2, args); + AddCommandWithExpect(error::kNoError, 1, 0, NULL); + AddCommandWithExpect(error::kNoError, 2, 0, NULL); + AddCommandWithExpect(error::kNoError, 3, 2, args); + AddCommandWithExpect(error::kNoError, 4, 2, args); // Ask for 5 entries. helper_->WaitForAvailableEntries(5); @@ -212,7 +212,7 @@ TEST_F(CommandBufferHelperTest, TestAvailableEntries) { CheckFreeSpace(put, 5); // Add more commands. - AddCommandWithExpect(parse_error::kParseNoError, 5, 2, args); + AddCommandWithExpect(error::kNoError, 5, 2, args); // Wait until everything is done done. helper_->Finish(); @@ -221,7 +221,7 @@ TEST_F(CommandBufferHelperTest, TestAvailableEntries) { Mock::VerifyAndClearExpectations(api_mock_.get()); // Check the error status. - EXPECT_EQ(parse_error::kParseNoError, GetError()); + EXPECT_EQ(error::kNoError, GetError()); } // Checks that the InsertToken/WaitForToken work. @@ -231,16 +231,16 @@ TEST_F(CommandBufferHelperTest, TestToken) { args[1].value_float = 4.f; // Add a first command. - AddCommandWithExpect(parse_error::kParseNoError, 3, 2, args); + AddCommandWithExpect(error::kNoError, 3, 2, args); // keep track of the buffer position. CommandBufferOffset command1_put = get_helper_put(); int32 token = helper_->InsertToken(); EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _)) .WillOnce(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken), - Return(parse_error::kParseNoError))); + Return(error::kNoError))); // Add another command. - AddCommandWithExpect(parse_error::kParseNoError, 4, 2, args); + AddCommandWithExpect(error::kNoError, 4, 2, args); helper_->WaitForToken(token); // check that the get pointer is beyond the first command. EXPECT_LE(command1_put, GetGetOffset()); @@ -250,7 +250,7 @@ TEST_F(CommandBufferHelperTest, TestToken) { Mock::VerifyAndClearExpectations(api_mock_.get()); // Check the error status. - EXPECT_EQ(parse_error::kParseNoError, GetError()); + EXPECT_EQ(error::kNoError, GetError()); } } // namespace gpu diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index 8ef3bb4..2f98d32 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc @@ -33,11 +33,11 @@ class BaseFencedAllocatorTest : public testing::Test { // ignore noops in the mock - we don't want to inspect the internals of the // helper. EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, 0, _)) - .WillRepeatedly(Return(parse_error::kParseNoError)); + .WillRepeatedly(Return(error::kNoError)); // Forward the SetToken calls to the engine EXPECT_CALL(*api_mock_.get(), DoCommand(cmd::kSetToken, 1, _)) .WillRepeatedly(DoAll(Invoke(api_mock_.get(), &AsyncAPIMock::SetToken), - Return(parse_error::kParseNoError))); + Return(error::kNoError))); command_buffer_.reset(new CommandBufferService); command_buffer_->Initialize(kBufferSize / sizeof(CommandBufferEntry)); diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h index 85e7596..11ba280 100644 --- a/gpu/command_buffer/common/command_buffer.h +++ b/gpu/command_buffer/common/command_buffer.h @@ -20,7 +20,7 @@ class CommandBuffer { get_offset(0), put_offset(0), token(-1), - error(parse_error::kParseNoError) { + error(error::kNoError) { } // Size of the command buffer in command buffer entries. @@ -40,7 +40,7 @@ class CommandBuffer { int32 token; // Error status. - parse_error::ParseError error; + error::Error error; }; CommandBuffer() { @@ -81,7 +81,7 @@ class CommandBuffer { virtual void SetToken(int32 token) = 0; // Allows the reader to set the current parse error. - virtual void SetParseError(parse_error::ParseError) = 0; + virtual void SetParseError(error::Error) = 0; private: DISALLOW_COPY_AND_ASSIGN(CommandBuffer); diff --git a/gpu/command_buffer/common/command_buffer_mock.h b/gpu/command_buffer/common/command_buffer_mock.h index 6795975..e65c090 100644 --- a/gpu/command_buffer/common/command_buffer_mock.h +++ b/gpu/command_buffer/common/command_buffer_mock.h @@ -30,7 +30,7 @@ class MockCommandBuffer : public CommandBuffer { MOCK_METHOD1(DestroyTransferBuffer, void(int32 handle)); MOCK_METHOD1(GetTransferBuffer, Buffer(int32 handle)); MOCK_METHOD1(SetToken, void(int32 token)); - MOCK_METHOD1(SetParseError, void(parse_error::ParseError parse_error)); + MOCK_METHOD1(SetParseError, void(error::Error error)); private: DISALLOW_COPY_AND_ASSIGN(MockCommandBuffer); diff --git a/gpu/command_buffer/common/constants.h b/gpu/command_buffer/common/constants.h index d6f9dfb..b208153 100644 --- a/gpu/command_buffer/common/constants.h +++ b/gpu/command_buffer/common/constants.h @@ -12,15 +12,15 @@ namespace gpu { typedef int32 CommandBufferOffset; const CommandBufferOffset kInvalidCommandBufferOffset = -1; -// TODO(apatrick): rename to something more generic like just Error. -namespace parse_error { - enum ParseError { - kParseNoError, - kParseInvalidSize, - kParseOutOfBounds, - kParseUnknownCommand, - kParseInvalidArguments, - kParseGenericError +// This enum must stay in sync with NPDeviceContext3DError. +namespace error { + enum Error { + kNoError, + kInvalidSize, + kOutOfBounds, + kUnknownCommand, + kInvalidArguments, + kGenericError }; } diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc index 885385b..804b894 100644 --- a/gpu/command_buffer/service/cmd_parser.cc +++ b/gpu/command_buffer/service/cmd_parser.cc @@ -36,27 +36,27 @@ CommandParser::CommandParser(void *shm_address, // conditions). This function only validates the header, leaving the arguments // validation to the handler, so it can pass a reference to them. // - get_ is modified *after* the command has been executed. -parse_error::ParseError CommandParser::ProcessCommand() { +error::Error CommandParser::ProcessCommand() { CommandBufferOffset get = get_; - if (get == put_) return parse_error::kParseNoError; + if (get == put_) return error::kNoError; CommandHeader header = buffer_[get].value_header; if (header.size == 0) { DLOG(INFO) << "Error: zero sized command in command buffer"; - return parse_error::kParseInvalidSize; + return error::kInvalidSize; } if (static_cast<int>(header.size) + get > entry_count_) { DLOG(INFO) << "Error: get offset out of bounds"; - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } - parse_error::ParseError result = handler_->DoCommand( + error::Error result = handler_->DoCommand( header.command, header.size - 1, buffer_ + get); // TODO(gman): If you want to log errors this is the best place to catch them. // It seems like we need an official way to turn on a debug mode and // get these errors. - if (result != parse_error::kParseNoError) { + if (result != error::kNoError) { ReportError(header.command, result); } get_ = (get + header.size) % entry_count_; @@ -64,19 +64,19 @@ parse_error::ParseError CommandParser::ProcessCommand() { } void CommandParser::ReportError(unsigned int command_id, - parse_error::ParseError result) { + error::Error result) { DLOG(INFO) << "Error: " << result << " for Command " << handler_->GetCommandName(command_id); } // Processes all the commands, while the buffer is not empty. Stop if an error // is encountered. -parse_error::ParseError CommandParser::ProcessAllCommands() { +error::Error CommandParser::ProcessAllCommands() { while (!IsEmpty()) { - parse_error::ParseError error = ProcessCommand(); + error::Error error = ProcessCommand(); if (error) return error; } - return parse_error::kParseNoError; + return error::kNoError; } } // namespace gpu diff --git a/gpu/command_buffer/service/cmd_parser.h b/gpu/command_buffer/service/cmd_parser.h index ebffb01..c971c62 100644 --- a/gpu/command_buffer/service/cmd_parser.h +++ b/gpu/command_buffer/service/cmd_parser.h @@ -52,13 +52,13 @@ class CommandParser { // Processes one command, updating the get pointer. This will return an error // if there are no commands in the buffer. - parse_error::ParseError ProcessCommand(); + error::Error ProcessCommand(); // Processes all commands until get == put. - parse_error::ParseError ProcessAllCommands(); + error::Error ProcessAllCommands(); // Reports an error. - void ReportError(unsigned int command_id, parse_error::ParseError result); + void ReportError(unsigned int command_id, error::Error result); private: CommandBufferOffset get_; @@ -81,9 +81,9 @@ class AsyncAPIInterface { // arg_count: the number of CommandBufferEntry arguments. // cmd_data: the command data. // Returns: - // parse_error::NO_ERROR if no error was found, one of - // parse_error::ParseError otherwise. - virtual parse_error::ParseError DoCommand( + // error::kNoError if no error was found, one of + // error::Error otherwise. + virtual error::Error DoCommand( unsigned int command, unsigned int arg_count, const void* cmd_data) = 0; diff --git a/gpu/command_buffer/service/cmd_parser_test.cc b/gpu/command_buffer/service/cmd_parser_test.cc index 0e97b4c..b4f2ca6 100644 --- a/gpu/command_buffer/service/cmd_parser_test.cc +++ b/gpu/command_buffer/service/cmd_parser_test.cc @@ -32,7 +32,7 @@ class CommandParserTest : public testing::Test { virtual void TearDown() {} // Adds a DoCommand expectation in the mock. - void AddDoCommandExpect(parse_error::ParseError _return, + void AddDoCommandExpect(error::Error _return, unsigned int command, unsigned int arg_count, CommandBufferEntry *args) { @@ -89,8 +89,8 @@ TEST_F(CommandParserTest, TestSimple) { parser->set_put(put); EXPECT_EQ(put, parser->put()); - AddDoCommandExpect(parse_error::kParseNoError, 123, 0, NULL); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessCommand()); + AddDoCommandExpect(error::kNoError, 123, 0, NULL); + EXPECT_EQ(error::kNoError, parser->ProcessCommand()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); @@ -107,8 +107,8 @@ TEST_F(CommandParserTest, TestSimple) { CommandBufferEntry param_array[2]; param_array[0].value_int32 = 2134; param_array[1].value_float = 1.f; - AddDoCommandExpect(parse_error::kParseNoError, 456, 2, param_array); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessCommand()); + AddDoCommandExpect(error::kNoError, 456, 2, param_array); + EXPECT_EQ(error::kNoError, parser->ProcessCommand()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); } @@ -136,14 +136,14 @@ TEST_F(CommandParserTest, TestMultipleCommands) { CommandBufferEntry param_array[2]; param_array[0].value_int32 = 5151; - AddDoCommandExpect(parse_error::kParseNoError, 789, 1, param_array); + AddDoCommandExpect(error::kNoError, 789, 1, param_array); param_array[1].value_int32 = 3434; - AddDoCommandExpect(parse_error::kParseNoError, 876, 1, + AddDoCommandExpect(error::kNoError, 876, 1, param_array+1); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessCommand()); + EXPECT_EQ(error::kNoError, parser->ProcessCommand()); EXPECT_EQ(put_cmd2, parser->get()); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessCommand()); + EXPECT_EQ(error::kNoError, parser->ProcessCommand()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); @@ -162,12 +162,12 @@ TEST_F(CommandParserTest, TestMultipleCommands) { EXPECT_EQ(put, parser->put()); param_array[0].value_int32 = 5656; - AddDoCommandExpect(parse_error::kParseNoError, 123, 1, param_array); + AddDoCommandExpect(error::kNoError, 123, 1, param_array); param_array[1].value_int32 = 7878; - AddDoCommandExpect(parse_error::kParseNoError, 321, 1, + AddDoCommandExpect(error::kNoError, 321, 1, param_array+1); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); + EXPECT_EQ(error::kNoError, parser->ProcessAllCommands()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); } @@ -183,11 +183,11 @@ TEST_F(CommandParserTest, TestWrap) { header.size = 1; header.command = i; buffer()[put++].value_header = header; - AddDoCommandExpect(parse_error::kParseNoError, i, 0, NULL); + AddDoCommandExpect(error::kNoError, i, 0, NULL); } parser->set_put(put); EXPECT_EQ(put, parser->put()); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); + EXPECT_EQ(error::kNoError, parser->ProcessAllCommands()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); @@ -199,13 +199,13 @@ TEST_F(CommandParserTest, TestWrap) { buffer()[put++].value_int32 = 5; CommandBufferEntry param; param.value_int32 = 5; - AddDoCommandExpect(parse_error::kParseNoError, 3, 1, ¶m); + AddDoCommandExpect(error::kNoError, 3, 1, ¶m); DCHECK_EQ(5u, put); put = 0; parser->set_put(put); EXPECT_EQ(put, parser->put()); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); + EXPECT_EQ(error::kNoError, parser->ProcessAllCommands()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); @@ -215,10 +215,10 @@ TEST_F(CommandParserTest, TestWrap) { buffer()[put++].value_header = header; buffer()[put++].value_int32 = 6; param.value_int32 = 6; - AddDoCommandExpect(parse_error::kParseNoError, 4, 1, ¶m); + AddDoCommandExpect(error::kNoError, 4, 1, ¶m); parser->set_put(put); EXPECT_EQ(put, parser->put()); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); + EXPECT_EQ(error::kNoError, parser->ProcessAllCommands()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); } @@ -236,7 +236,7 @@ TEST_F(CommandParserTest, TestError) { parser->set_put(put); EXPECT_EQ(put, parser->put()); - EXPECT_EQ(parse_error::kParseInvalidSize, + EXPECT_EQ(error::kInvalidSize, parser->ProcessAllCommands()); // check that no DoCommand call was made. Mock::VerifyAndClearExpectations(api_mock()); @@ -251,7 +251,7 @@ TEST_F(CommandParserTest, TestError) { parser->set_put(put); EXPECT_EQ(put, parser->put()); - EXPECT_EQ(parse_error::kParseOutOfBounds, + EXPECT_EQ(error::kOutOfBounds, parser->ProcessAllCommands()); // check that no DoCommand call was made. Mock::VerifyAndClearExpectations(api_mock()); @@ -271,16 +271,16 @@ TEST_F(CommandParserTest, TestError) { parser->set_put(put); EXPECT_EQ(put, parser->put()); // have the first command fail to parse. - AddDoCommandExpect(parse_error::kParseUnknownCommand, 3, 0, NULL); - EXPECT_EQ(parse_error::kParseUnknownCommand, + AddDoCommandExpect(error::kUnknownCommand, 3, 0, NULL); + EXPECT_EQ(error::kUnknownCommand, parser->ProcessAllCommands()); // check that only one command was executed, and that get reflects that // correctly. EXPECT_EQ(put_post_fail, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); // make the second one succeed, and check that the parser recovered fine. - AddDoCommandExpect(parse_error::kParseNoError, 4, 0, NULL); - EXPECT_EQ(parse_error::kParseNoError, parser->ProcessAllCommands()); + AddDoCommandExpect(error::kNoError, 4, 0, NULL); + EXPECT_EQ(error::kNoError, parser->ProcessAllCommands()); EXPECT_EQ(put, parser->get()); Mock::VerifyAndClearExpectations(api_mock()); } diff --git a/gpu/command_buffer/service/command_buffer_service.cc b/gpu/command_buffer/service/command_buffer_service.cc index 053a22b..2716d3b 100644 --- a/gpu/command_buffer/service/command_buffer_service.cc +++ b/gpu/command_buffer/service/command_buffer_service.cc @@ -17,7 +17,7 @@ CommandBufferService::CommandBufferService() get_offset_(0), put_offset_(0), token_(0), - error_(parse_error::kParseNoError) { + error_(error::kNoError) { // Element zero is always NULL. registered_objects_.push_back(linked_ptr<SharedMemory>()); } @@ -66,7 +66,7 @@ CommandBufferService::State CommandBufferService::GetState() { CommandBufferService::State CommandBufferService::Flush(int32 put_offset) { if (put_offset < 0 || put_offset >= size_) { - error_ = gpu::parse_error::kParseOutOfBounds; + error_ = gpu::error::kOutOfBounds; return GetState(); } @@ -154,8 +154,8 @@ void CommandBufferService::SetToken(int32 token) { token_ = token; } -void CommandBufferService::SetParseError(parse_error::ParseError error) { - if (error_ == parse_error::kParseNoError) { +void CommandBufferService::SetParseError(error::Error error) { + if (error_ == error::kNoError) { error_ = error; } } diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h index 3e58d7e..f8be349 100644 --- a/gpu/command_buffer/service/command_buffer_service.h +++ b/gpu/command_buffer/service/command_buffer_service.h @@ -33,7 +33,7 @@ class CommandBufferService : public CommandBuffer { virtual void DestroyTransferBuffer(int32 id); virtual Buffer GetTransferBuffer(int32 handle); virtual void SetToken(int32 token); - virtual void SetParseError(parse_error::ParseError); + virtual void SetParseError(error::Error error); // Sets a callback that should be posted on another thread whenever the put // offset is changed. The callback must not return until some progress has @@ -56,9 +56,9 @@ class CommandBufferService : public CommandBuffer { std::vector<linked_ptr< base::SharedMemory> > registered_objects_; std::set<int32> unused_registered_object_elements_; int32 token_; - parse_error::ParseError error_; + error::Error error_; }; } // namespace gpu -#endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_ +#endif // GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
\ No newline at end of file diff --git a/gpu/command_buffer/service/command_buffer_service_unittest.cc b/gpu/command_buffer/service/command_buffer_service_unittest.cc index ea0193b..cd4cca3 100644 --- a/gpu/command_buffer/service/command_buffer_service_unittest.cc +++ b/gpu/command_buffer/service/command_buffer_service_unittest.cc @@ -54,7 +54,7 @@ TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) { EXPECT_EQ(0, state.get_offset); EXPECT_EQ(0, state.put_offset); EXPECT_EQ(0, state.token); - EXPECT_EQ(parse_error::kParseNoError, state.error); + EXPECT_EQ(error::kNoError, state.error); } TEST_F(CommandBufferServiceTest, InitializationSizeIsInEntriesNotBytes) { @@ -95,8 +95,8 @@ TEST_F(CommandBufferServiceTest, CanSyncGetAndPutOffset) { EXPECT_CALL(*put_offset_change_callback, RunWithParams(_)); EXPECT_EQ(2, command_buffer_->Flush(6).get_offset); - EXPECT_NE(parse_error::kParseNoError, command_buffer_->Flush(-1).error); - EXPECT_NE(parse_error::kParseNoError, + EXPECT_NE(error::kNoError, command_buffer_->Flush(-1).error); + EXPECT_NE(error::kNoError, command_buffer_->Flush(1024).error); } @@ -181,7 +181,7 @@ TEST_F(CommandBufferServiceTest, DefaultParseErrorIsNoError) { } TEST_F(CommandBufferServiceTest, CanSetParseError) { - command_buffer_->SetParseError(parse_error::kParseInvalidSize); + command_buffer_->SetParseError(error::kInvalidSize); EXPECT_EQ(1, GetError()); } } // namespace gpu diff --git a/gpu/command_buffer/service/common_decoder.cc b/gpu/command_buffer/service/common_decoder.cc index 2cc87c5..6b2d116 100644 --- a/gpu/command_buffer/service/common_decoder.cc +++ b/gpu/command_buffer/service/common_decoder.cc @@ -103,7 +103,7 @@ const CommandInfo g_command_info[] = { // Note: args is a pointer to the command buffer. As such, it could be changed // by a (malicious) client at any time, so if validation has to happen, it // should operate on a copy of them. -parse_error::ParseError CommonDecoder::DoCommonCommand( +error::Error CommonDecoder::DoCommonCommand( unsigned int command, unsigned int arg_count, const void* cmd_data) { @@ -126,77 +126,77 @@ parse_error::ParseError CommonDecoder::DoCommonCommand( #undef COMMON_COMMAND_BUFFER_CMD_OP } } else { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } } return DoCommonCommand(command, arg_count, cmd_data); - return parse_error::kParseUnknownCommand; + return error::kUnknownCommand; } -parse_error::ParseError CommonDecoder::HandleNoop( +error::Error CommonDecoder::HandleNoop( uint32 immediate_data_size, const cmd::Noop& args) { - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleSetToken( +error::Error CommonDecoder::HandleSetToken( uint32 immediate_data_size, const cmd::SetToken& args) { engine_->set_token(args.token); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleJump( +error::Error CommonDecoder::HandleJump( uint32 immediate_data_size, const cmd::Jump& args) { if (!engine_->SetGetOffset(args.offset)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleJumpRelative( +error::Error CommonDecoder::HandleJumpRelative( uint32 immediate_data_size, const cmd::JumpRelative& args) { if (!engine_->SetGetOffset(engine_->GetGetOffset() + args.offset)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleCall( +error::Error CommonDecoder::HandleCall( uint32 immediate_data_size, const cmd::Call& args) { if (!PushAddress(args.offset)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleCallRelative( +error::Error CommonDecoder::HandleCallRelative( uint32 immediate_data_size, const cmd::CallRelative& args) { if (!PushAddress(engine_->GetGetOffset() + args.offset)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleReturn( +error::Error CommonDecoder::HandleReturn( uint32 immediate_data_size, const cmd::Return& args) { if (call_stack_.empty()) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } CommandAddress return_address = call_stack_.top(); call_stack_.pop(); if (!engine_->SetGetOffset(return_address.offset)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleSetBucketSize( +error::Error CommonDecoder::HandleSetBucketSize( uint32 immediate_data_size, const cmd::SetBucketSize& args) { uint32 bucket_id = args.bucket_id; @@ -209,10 +209,10 @@ parse_error::ParseError CommonDecoder::HandleSetBucketSize( } bucket->SetSize(size); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleSetBucketData( +error::Error CommonDecoder::HandleSetBucketData( uint32 immediate_data_size, const cmd::SetBucketData& args) { uint32 bucket_id = args.bucket_id; @@ -221,20 +221,20 @@ parse_error::ParseError CommonDecoder::HandleSetBucketData( const void* data = GetSharedMemoryAs<const void*>( args.shared_memory_id, args.shared_memory_offset, size); if (!data) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } Bucket* bucket = GetBucket(bucket_id); if (!bucket) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } if (!bucket->SetData(data, offset, size)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleSetBucketDataImmediate( +error::Error CommonDecoder::HandleSetBucketDataImmediate( uint32 immediate_data_size, const cmd::SetBucketDataImmediate& args) { const void* data = GetImmediateDataAs<const void*>(args); @@ -242,36 +242,36 @@ parse_error::ParseError CommonDecoder::HandleSetBucketDataImmediate( uint32 offset = args.offset; uint32 size = args.size; if (size > immediate_data_size) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } Bucket* bucket = GetBucket(bucket_id); if (!bucket) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } if (!bucket->SetData(data, offset, size)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleGetBucketSize( +error::Error CommonDecoder::HandleGetBucketSize( uint32 immediate_data_size, const cmd::GetBucketSize& args) { uint32 bucket_id = args.bucket_id; uint32* data = GetSharedMemoryAs<uint32*>( args.shared_memory_id, args.shared_memory_offset, sizeof(*data)); if (!data) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } Bucket* bucket = GetBucket(bucket_id); if (!bucket) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } *data = bucket->size(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError CommonDecoder::HandleGetBucketData( +error::Error CommonDecoder::HandleGetBucketData( uint32 immediate_data_size, const cmd::GetBucketData& args) { uint32 bucket_id = args.bucket_id; @@ -280,18 +280,18 @@ parse_error::ParseError CommonDecoder::HandleGetBucketData( void* data = GetSharedMemoryAs<void*>( args.shared_memory_id, args.shared_memory_offset, size); if (!data) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } Bucket* bucket = GetBucket(bucket_id); if (!bucket) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } const void* src = bucket->GetData(offset, size); if (!src) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } memcpy(data, src, size); - return parse_error::kParseNoError; + return error::kNoError; } } // namespace gpu diff --git a/gpu/command_buffer/service/common_decoder.h b/gpu/command_buffer/service/common_decoder.h index 051a626..f4c0e67 100644 --- a/gpu/command_buffer/service/common_decoder.h +++ b/gpu/command_buffer/service/common_decoder.h @@ -19,7 +19,7 @@ class CommandBufferEngine; // o3d/gl2 command buffer decoder. class CommonDecoder : public AsyncAPIInterface { public: - typedef parse_error::ParseError ParseError; + typedef error::Error Error; static const unsigned int kMaxStackDepth = 32; @@ -100,9 +100,9 @@ class CommonDecoder : public AsyncAPIInterface { // arg_count: the number of CommandBufferEntry arguments. // cmd_data: the command data. // Returns: - // parse_error::NO_ERROR if no error was found, one of - // parse_error::ParseError otherwise. - parse_error::ParseError DoCommonCommand( + // error::kNoError if no error was found, one of + // error::Error otherwise. + error::Error DoCommonCommand( unsigned int command, unsigned int arg_count, const void* cmd_data); @@ -138,7 +138,7 @@ class CommonDecoder : public AsyncAPIInterface { // Generate a member function prototype for each command in an automated and // typesafe way. #define COMMON_COMMAND_BUFFER_CMD_OP(name) \ - parse_error::ParseError Handle ## name( \ + error::Error Handle ## name( \ uint32 immediate_data_size, \ const cmd::name& args); \ diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc index b2c369d..2ecaa15 100644 --- a/gpu/command_buffer/service/common_decoder_unittest.cc +++ b/gpu/command_buffer/service/common_decoder_unittest.cc @@ -56,7 +56,7 @@ class TestCommonDecoder : public CommonDecoder { } // Overridden from AsyncAPIInterface - parse_error::ParseError DoCommand( + error::Error DoCommand( unsigned int command, unsigned int arg_count, const void* cmd_data) { @@ -149,7 +149,7 @@ class CommonDecoderTest : public testing::Test { } template <typename T> - parse_error::ParseError ExecuteCmd(const T& cmd) { + error::Error ExecuteCmd(const T& cmd) { COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed); return decoder_.DoCommand(cmd.kCmdId, ComputeNumEntries(sizeof(cmd)) - 1, @@ -157,7 +157,7 @@ class CommonDecoderTest : public testing::Test { } template <typename T> - parse_error::ParseError ExecuteImmediateCmd(const T& cmd, size_t data_size) { + error::Error ExecuteImmediateCmd(const T& cmd, size_t data_size) { COMPILE_ASSERT(T::kArgFlags == cmd::kAtLeastN, Cmd_kArgFlags_not_kAtLeastN); return decoder_.DoCommand(cmd.kCmdId, ComputeNumEntries(sizeof(cmd) + data_size) - 1, @@ -176,7 +176,7 @@ TEST_F(CommonDecoderTest, HandleNoop) { cmd::Noop cmd; const uint32 kSkipCount = 5; cmd.Init(kSkipCount); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd( cmd, kSkipCount * kCommandBufferEntrySize)); } @@ -186,7 +186,7 @@ TEST_F(CommonDecoderTest, SetToken) { const int32 kTokenId = 123; EXPECT_EQ(0, engine_.token()); cmd.Init(kTokenId); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(kTokenId, engine_.token()); } @@ -194,12 +194,12 @@ TEST_F(CommonDecoderTest, Jump) { cmd::Jump cmd; // Check valid args succeed. cmd.Init(MockCommandBufferEngine::kValidOffset); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(MockCommandBufferEngine::kValidOffset, engine_.GetGetOffset()); // Check invalid offset fails. cmd.Init(MockCommandBufferEngine::kInvalidOffset); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(MockCommandBufferEngine::kValidOffset, engine_.GetGetOffset()); } @@ -214,19 +214,19 @@ TEST_F(CommonDecoderTest, JumpRelative) { const int32 kPositiveOffset = 16; cmd.Init(kPositiveOffset); uint32 read_pointer = engine_.GetGetOffset(); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); // See note above. EXPECT_EQ(read_pointer + kPositiveOffset, engine_.GetGetOffset()); // Check valid negative offset succeeds. const int32 kNegativeOffset = -8; read_pointer = engine_.GetGetOffset(); cmd.Init(kNegativeOffset); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); // See note above. EXPECT_EQ(read_pointer + kNegativeOffset, engine_.GetGetOffset()); // Check invalid offset fails. cmd.Init(MockCommandBufferEngine::kInvalidOffset); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // See note above. EXPECT_EQ(read_pointer + kNegativeOffset, engine_.GetGetOffset()); } @@ -235,25 +235,25 @@ TEST_F(CommonDecoderTest, Call) { cmd::Call cmd; // Check valid args succeed. cmd.Init(MockCommandBufferEngine::kValidOffset); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(MockCommandBufferEngine::kValidOffset, engine_.GetGetOffset()); // Check invalid offset fails. cmd.Init(MockCommandBufferEngine::kInvalidOffset); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(MockCommandBufferEngine::kValidOffset, engine_.GetGetOffset()); // Check that the call values are on the stack. cmd::Return return_cmd; return_cmd.Init(); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(return_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(return_cmd)); EXPECT_EQ(0u, engine_.GetGetOffset()); // Check that stack overflow fails. cmd.Init(MockCommandBufferEngine::kValidOffset); for (unsigned int ii = 0; ii < CommonDecoder::kMaxStackDepth; ++ii) { - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } TEST_F(CommonDecoderTest, CallRelative) { @@ -262,38 +262,38 @@ TEST_F(CommonDecoderTest, CallRelative) { const int32 kPositiveOffset = 16; cmd.Init(kPositiveOffset); uint32 read_pointer_1 = engine_.GetGetOffset(); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); // See note above. EXPECT_EQ(read_pointer_1 + kPositiveOffset, engine_.GetGetOffset()); // Check valid negative offset succeeds. const int32 kNegativeOffset = -8; uint32 read_pointer_2 = engine_.GetGetOffset(); cmd.Init(kNegativeOffset); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); // See note above. EXPECT_EQ(read_pointer_2 + kNegativeOffset, engine_.GetGetOffset()); // Check invalid offset fails. cmd.Init(MockCommandBufferEngine::kInvalidOffset); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // See note above. EXPECT_EQ(read_pointer_2 + kNegativeOffset, engine_.GetGetOffset()); // Check that the call values are on the stack. cmd::Return return_cmd; return_cmd.Init(); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(return_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(return_cmd)); // See note above. EXPECT_EQ(read_pointer_1 + kPositiveOffset, engine_.GetGetOffset()); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(return_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(return_cmd)); // See note above. EXPECT_EQ(0u, engine_.GetGetOffset()); // Check that stack overflow fails. cmd.Init(kPositiveOffset); for (unsigned int ii = 0; ii < CommonDecoder::kMaxStackDepth; ++ii) { - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } TEST_F(CommonDecoderTest, Return) { @@ -301,7 +301,7 @@ TEST_F(CommonDecoderTest, Return) { // Test that an empty stack fails. cmd::Return cmd; cmd.Init(); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } TEST_F(CommonDecoderTest, SetBucketSize) { @@ -313,20 +313,20 @@ TEST_F(CommonDecoderTest, SetBucketSize) { EXPECT_TRUE(NULL == decoder_.GetBucket(kBucketId)); // Check we can create one. cmd.Init(kBucketId, kBucketLength1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); CommonDecoder::Bucket* bucket; bucket = decoder_.GetBucket(kBucketId); EXPECT_TRUE(NULL != bucket); EXPECT_EQ(kBucketLength1, bucket->size()); // Check we can change it. cmd.Init(kBucketId, kBucketLength2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); bucket = decoder_.GetBucket(kBucketId); EXPECT_TRUE(NULL != bucket); EXPECT_EQ(kBucketLength2, bucket->size()); // Check we can delete it. cmd.Init(kBucketId, 0); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); bucket = decoder_.GetBucket(kBucketId); EXPECT_EQ(0, bucket->size()); } @@ -341,7 +341,7 @@ TEST_F(CommonDecoderTest, SetBucketData) { const uint32 kInvalidBucketId = 124; size_cmd.Init(kBucketId, sizeof(kData)); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(size_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(size_cmd)); CommonDecoder::Bucket* bucket = decoder_.GetBucket(kBucketId); // Check the data is not there. EXPECT_NE(0, memcmp(bucket->GetData(0, sizeof(kData)), kData, sizeof(kData))); @@ -352,7 +352,7 @@ TEST_F(CommonDecoderTest, SetBucketData) { memcpy(memory, kData, sizeof(kData)); cmd.Init(kBucketId, 0, sizeof(kData), MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(0, memcmp(bucket->GetData(0, sizeof(kData)), kData, sizeof(kData))); // Check we can set it partially. @@ -361,7 +361,7 @@ TEST_F(CommonDecoderTest, SetBucketData) { memcpy(memory, kData2, sizeof(kData2)); cmd.Init(kBucketId, kSomeOffsetInBucket, sizeof(kData2), MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(0, memcmp(bucket->GetData(kSomeOffsetInBucket, sizeof(kData2)), kData2, sizeof(kData2))); const char* bucket_data = bucket->GetDataAs<const char*>(0, sizeof(kData)); @@ -374,17 +374,17 @@ TEST_F(CommonDecoderTest, SetBucketData) { // Check that it fails if the bucket_id is invalid cmd.Init(kInvalidBucketId, kSomeOffsetInBucket, sizeof(kData2), MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // Check that it fails if the offset is out of range. cmd.Init(kBucketId, bucket->size(), 1, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // Check that it fails if the size is out of range. cmd.Init(kBucketId, 0, bucket->size() + 1, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } TEST_F(CommonDecoderTest, SetBucketDataImmediate) { @@ -399,7 +399,7 @@ TEST_F(CommonDecoderTest, SetBucketDataImmediate) { const uint32 kInvalidBucketId = 124; size_cmd.Init(kBucketId, sizeof(kData)); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(size_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(size_cmd)); CommonDecoder::Bucket* bucket = decoder_.GetBucket(kBucketId); // Check the data is not there. EXPECT_NE(0, memcmp(bucket->GetData(0, sizeof(kData)), kData, sizeof(kData))); @@ -408,7 +408,7 @@ TEST_F(CommonDecoderTest, SetBucketDataImmediate) { void* memory = &buffer[0] + sizeof(cmd); memcpy(memory, kData, sizeof(kData)); cmd.Init(kBucketId, 0, sizeof(kData)); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(kData))); EXPECT_EQ(0, memcmp(bucket->GetData(0, sizeof(kData)), kData, sizeof(kData))); @@ -417,7 +417,7 @@ TEST_F(CommonDecoderTest, SetBucketDataImmediate) { const uint32 kSomeOffsetInBucket = 5; memcpy(memory, kData2, sizeof(kData2)); cmd.Init(kBucketId, kSomeOffsetInBucket, sizeof(kData2)); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(kData2))); EXPECT_EQ(0, memcmp(bucket->GetData(kSomeOffsetInBucket, sizeof(kData2)), kData2, sizeof(kData2))); @@ -430,17 +430,17 @@ TEST_F(CommonDecoderTest, SetBucketDataImmediate) { // Check that it fails if the bucket_id is invalid cmd.Init(kInvalidBucketId, kSomeOffsetInBucket, sizeof(kData2)); - EXPECT_NE(parse_error::kParseNoError, + EXPECT_NE(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(kData2))); // Check that it fails if the offset is out of range. cmd.Init(kBucketId, bucket->size(), 1); - EXPECT_NE(parse_error::kParseNoError, + EXPECT_NE(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(kData2))); // Check that it fails if the size is out of range. cmd.Init(kBucketId, 0, bucket->size() + 1); - EXPECT_NE(parse_error::kParseNoError, + EXPECT_NE(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(kData2))); } @@ -453,7 +453,7 @@ TEST_F(CommonDecoderTest, GetBucketSize) { const uint32 kInvalidBucketId = 124; size_cmd.Init(kBucketId, kBucketSize); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(size_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(size_cmd)); // Check that the size is correct. const uint32 kSomeOffsetInSharedMemory = 50; @@ -462,13 +462,13 @@ TEST_F(CommonDecoderTest, GetBucketSize) { *memory = 0xFFFFFFFF; cmd.Init(kBucketId, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(kBucketSize, *memory); // Check that it fails if the bucket_id is invalid cmd.Init(kInvalidBucketId, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } TEST_F(CommonDecoderTest, GetBucketData) { @@ -483,20 +483,20 @@ TEST_F(CommonDecoderTest, GetBucketData) { const uint32 kInvalidBucketId = 124; size_cmd.Init(kBucketId, sizeof(kData)); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(size_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(size_cmd)); CommonDecoder::Bucket* bucket = decoder_.GetBucket(kBucketId); const uint32 kSomeOffsetInSharedMemory = 50; uint8* memory = engine_.GetSharedMemoryAs<uint8*>(kSomeOffsetInSharedMemory); memcpy(memory, kData, sizeof(kData)); set_cmd.Init(kBucketId, 0, sizeof(kData), MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(set_cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(set_cmd)); // Check we can get the whole thing. memset(memory, 0, sizeof(kData)); cmd.Init(kBucketId, 0, sizeof(kData), MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(0, memcmp(memory, kData, sizeof(kData))); // Check we can get a piece. @@ -507,7 +507,7 @@ TEST_F(CommonDecoderTest, GetBucketData) { memory[-1] = kSentinel; cmd.Init(kBucketId, kSomeOffsetInBucket, kLengthOfPiece, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(0, memcmp(memory, kData + kSomeOffsetInBucket, kLengthOfPiece)); EXPECT_EQ(0, memcmp(memory + kLengthOfPiece, zero, sizeof(kData) - kLengthOfPiece)); @@ -516,17 +516,17 @@ TEST_F(CommonDecoderTest, GetBucketData) { // Check that it fails if the bucket_id is invalid cmd.Init(kInvalidBucketId, kSomeOffsetInBucket, sizeof(kData), MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // Check that it fails if the offset is invalid cmd.Init(kBucketId, sizeof(kData) + 1, 1, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // Check that it fails if the size is invalid cmd.Init(kBucketId, 0, sizeof(kData) + 1, MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } } // namespace gpu diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 90cde84..4c4010b 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -481,7 +481,7 @@ class GLES2DecoderImpl : public GLES2Decoder { GLES2DecoderImpl(); // Overridden from AsyncAPIInterface. - virtual ParseError DoCommand(unsigned int command, + virtual Error DoCommand(unsigned int command, unsigned int arg_count, const void* args); @@ -615,7 +615,7 @@ class GLES2DecoderImpl : public GLES2Decoder { // Generate a member function prototype for each command in an automated and // typesafe way. #define GLES2_CMD_OP(name) \ - ParseError Handle ## name( \ + Error Handle ## name( \ uint32 immediate_data_size, \ const gles2::name& args); \ @@ -1118,11 +1118,11 @@ const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const { // Note: args is a pointer to the command buffer. As such, it could be changed // by a (malicious) client at any time, so if validation has to happen, it // should operate on a copy of them. -parse_error::ParseError GLES2DecoderImpl::DoCommand( +error::Error GLES2DecoderImpl::DoCommand( unsigned int command, unsigned int arg_count, const void* cmd_data) { - parse_error::ParseError result = parse_error::kParseNoError; + error::Error result = error::kNoError; if (debug()) { // TODO(gman): Change output to something useful for NaCl. printf("cmd: %s\n", GetCommandName(command)); @@ -1155,7 +1155,7 @@ parse_error::ParseError GLES2DecoderImpl::DoCommand( } } } else { - result = parse_error::kParseInvalidArguments; + result = error::kInvalidArguments; } } else { result = DoCommonCommand(command, arg_count, cmd_data); @@ -1212,31 +1212,31 @@ void GLES2DecoderImpl::DoEnableVertexAttribArray(GLuint index) { } } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteShader( +error::Error GLES2DecoderImpl::HandleDeleteShader( uint32 immediate_data_size, const gles2::DeleteShader& c) { GLuint shader = c.shader; GLuint service_id; if (!id_manager_->GetServiceId(shader, &service_id)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glDeleteShader(service_id); id_manager_->RemoveMapping(shader, service_id); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteProgram( +error::Error GLES2DecoderImpl::HandleDeleteProgram( uint32 immediate_data_size, const gles2::DeleteProgram& c) { GLuint program = c.program; GLuint service_id; if (!id_manager_->GetServiceId(program, &service_id)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } RemoveProgramInfo(service_id); glDeleteProgram(service_id); id_manager_->RemoveMapping(program, service_id); - return parse_error::kParseNoError; + return error::kNoError; } void GLES2DecoderImpl::DoDrawArrays( @@ -1364,7 +1364,7 @@ bool GLES2DecoderImpl::IsDrawValid(GLuint max_vertex_accessed) { return false; }; -parse_error::ParseError GLES2DecoderImpl::HandleDrawElements( +error::Error GLES2DecoderImpl::HandleDrawElements( uint32 immediate_data_size, const gles2::DrawElements& c) { if (bound_element_array_buffer_ != 0) { GLenum mode = c.mode; @@ -1408,7 +1408,7 @@ parse_error::ParseError GLES2DecoderImpl::HandleDrawElements( } else { SetGLError(GL_INVALID_VALUE); } - return parse_error::kParseNoError; + return error::kNoError; } namespace { @@ -1417,7 +1417,7 @@ namespace { // Assumes that data / data_size points to a piece of memory that is in range // of whatever context it came from (shared memory, immediate memory, bucket // memory.) -parse_error::ParseError ShaderSourceHelper( +error::Error ShaderSourceHelper( GLuint shader, GLsizei count, const char* data, uint32 data_size) { std::vector<std::string> strings(count); scoped_array<const char*> string_pointers(new const char* [count]); @@ -1425,60 +1425,60 @@ parse_error::ParseError ShaderSourceHelper( const uint32* ends = reinterpret_cast<const uint32*>(data); uint32 start_offset = count * sizeof(*ends); if (start_offset > data_size) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } for (GLsizei ii = 0; ii < count; ++ii) { uint32 end_offset = ends[ii]; if (end_offset > data_size || end_offset < start_offset) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } strings[ii] = std::string(data + start_offset, end_offset - start_offset); string_pointers[ii] = strings[ii].c_str(); } glShaderSource(shader, count, string_pointers.get(), NULL); - return parse_error::kParseNoError; + return error::kNoError; } } // anonymous namespace. -parse_error::ParseError GLES2DecoderImpl::HandleShaderSource( +error::Error GLES2DecoderImpl::HandleShaderSource( uint32 immediate_data_size, const gles2::ShaderSource& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLsizei count = c.count; uint32 data_size = c.data_size; const char** data = GetSharedMemoryAs<const char**>( c.data_shm_id, c.data_shm_offset, data_size); if (!data) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } return ShaderSourceHelper( shader, count, reinterpret_cast<const char*>(data), data_size); } -parse_error::ParseError GLES2DecoderImpl::HandleShaderSourceImmediate( +error::Error GLES2DecoderImpl::HandleShaderSourceImmediate( uint32 immediate_data_size, const gles2::ShaderSourceImmediate& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLsizei count = c.count; uint32 data_size = c.data_size; const char** data = GetImmediateDataAs<const char**>( c, data_size, immediate_data_size); if (!data) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } return ShaderSourceHelper( shader, count, reinterpret_cast<const char*>(data), data_size); } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer( +error::Error GLES2DecoderImpl::HandleVertexAttribPointer( uint32 immediate_data_size, const gles2::VertexAttribPointer& c) { if (bound_array_buffer_ != 0) { GLuint indx = c.indx; @@ -1493,7 +1493,7 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer( indx >= max_vertex_attribs_ || stride < 0) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } const BufferManager::BufferInfo* buffer_info = GetBufferInfo(bound_array_buffer_); @@ -1501,7 +1501,7 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer( GLsizei real_stride = stride != 0 ? stride : component_size * size; if (offset % component_size > 0) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } vertex_attrib_infos_[indx].SetInfo( bound_array_buffer_, @@ -1514,10 +1514,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer( } else { SetGLError(GL_INVALID_VALUE); } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleReadPixels( +error::Error GLES2DecoderImpl::HandleReadPixels( uint32 immediate_data_size, const gles2::ReadPixels& c) { GLint x = c.x; GLint y = c.y; @@ -1530,25 +1530,25 @@ parse_error::ParseError GLES2DecoderImpl::HandleReadPixels( void* pixels = GetSharedMemoryAs<void*>( c.pixels_shm_id, c.pixels_shm_offset, pixels_size); if (!pixels) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!ValidateGLenumReadPixelFormat(format) || !ValidateGLenumPixelType(type)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glReadPixels(x, y, width, height, format, type, pixels); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandlePixelStorei( +error::Error GLES2DecoderImpl::HandlePixelStorei( uint32 immediate_data_size, const gles2::PixelStorei& c) { GLenum pname = c.pname; GLenum param = c.param; if (!ValidateGLenumPixelStore(pname) || !ValidateGLintPixelStoreAlignment(param)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glPixelStorei(pname, param); switch (pname) { @@ -1563,15 +1563,15 @@ parse_error::ParseError GLES2DecoderImpl::HandlePixelStorei( DCHECK(false); break; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetAttribLocation( +error::Error GLES2DecoderImpl::HandleGetAttribLocation( uint32 immediate_data_size, const gles2::GetAttribLocation& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } uint32 name_size = c.data_size; const char* name = GetSharedMemoryAs<const char*>( @@ -1579,19 +1579,19 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetAttribLocation( GLint* location = GetSharedMemoryAs<GLint*>( c.location_shm_id, c.location_shm_offset, sizeof(GLint)); if (!location || !name) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } String name_str(name, name_size); *location = glGetAttribLocation(program, name_str.c_str()); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetAttribLocationImmediate( +error::Error GLES2DecoderImpl::HandleGetAttribLocationImmediate( uint32 immediate_data_size, const gles2::GetAttribLocationImmediate& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } uint32 name_size = c.data_size; const char* name = GetImmediateDataAs<const char*>( @@ -1599,19 +1599,19 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetAttribLocationImmediate( GLint* location = GetSharedMemoryAs<GLint*>( c.location_shm_id, c.location_shm_offset, sizeof(GLint)); if (!location || !name) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } String name_str(name, name_size); *location = glGetAttribLocation(program, name_str.c_str()); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetUniformLocation( +error::Error GLES2DecoderImpl::HandleGetUniformLocation( uint32 immediate_data_size, const gles2::GetUniformLocation& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } uint32 name_size = c.data_size; const char* name = GetSharedMemoryAs<const char*>( @@ -1619,19 +1619,19 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetUniformLocation( GLint* location = GetSharedMemoryAs<GLint*>( c.location_shm_id, c.location_shm_offset, sizeof(GLint)); if (!location || !name) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } String name_str(name, name_size); *location = glGetUniformLocation(program, name_str.c_str()); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetUniformLocationImmediate( +error::Error GLES2DecoderImpl::HandleGetUniformLocationImmediate( uint32 immediate_data_size, const gles2::GetUniformLocationImmediate& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } uint32 name_size = c.data_size; const char* name = GetImmediateDataAs<const char*>( @@ -1639,14 +1639,14 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetUniformLocationImmediate( GLint* location = GetSharedMemoryAs<GLint*>( c.location_shm_id, c.location_shm_offset, sizeof(GLint)); if (!location || !name) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } String name_str(name, name_size); *location = glGetUniformLocation(program, name_str.c_str()); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBufferData( +error::Error GLES2DecoderImpl::HandleBufferData( uint32 immediate_data_size, const gles2::BufferData& c) { GLenum target = static_cast<GLenum>(c.target); GLsizeiptr size = static_cast<GLsizeiptr>(c.size); @@ -1657,13 +1657,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleBufferData( if (data_shm_id != 0 || data_shm_offset != 0) { data = GetSharedMemoryAs<const void*>(data_shm_id, data_shm_offset, size); if (!data) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } } if (!ValidateGLenumBufferTarget(target) || !ValidateGLenumBufferUsage(usage)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } // Clear the buffer to 0 if no initial data was passed in. scoped_array<int8> zero; @@ -1680,23 +1680,23 @@ parse_error::ParseError GLES2DecoderImpl::HandleBufferData( } else { SetBufferInfo(GetBufferForTarget(target), size); } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBufferDataImmediate( +error::Error GLES2DecoderImpl::HandleBufferDataImmediate( uint32 immediate_data_size, const gles2::BufferDataImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLsizeiptr size = static_cast<GLsizeiptr>(c.size); const void* data = GetImmediateDataAs<const void*>( c, size, immediate_data_size); if (!data) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } GLenum usage = static_cast<GLenum>(c.usage); if (!ValidateGLenumBufferTarget(target) || !ValidateGLenumBufferUsage(usage)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } CopyRealGLErrorsToWrapper(); glBufferData(target, size, data, usage); @@ -1706,10 +1706,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleBufferDataImmediate( } else { SetBufferInfo(GetBufferForTarget(target), size); } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexImage2D( +error::Error GLES2DecoderImpl::HandleCompressedTexImage2D( uint32 immediate_data_size, const gles2::CompressedTexImage2D& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -1725,13 +1725,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexImage2D( data = GetSharedMemoryAs<const void*>( data_shm_id, data_shm_offset, image_size); if (!data) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } } // TODO(gman): Validate internal_format if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } scoped_array<int8> zero; if (!data) { @@ -1741,10 +1741,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexImage2D( } glCompressedTexImage2D( target, level, internal_format, width, height, border, image_size, data); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexImage2DImmediate( +error::Error GLES2DecoderImpl::HandleCompressedTexImage2DImmediate( uint32 immediate_data_size, const gles2::CompressedTexImage2DImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -1756,19 +1756,19 @@ parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexImage2DImmediate( const void* data = GetImmediateDataAs<const void*>( c, image_size, immediate_data_size); if (!data) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } // TODO(gman): Validate internal_format if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glCompressedTexImage2D( target, level, internal_format, width, height, border, image_size, data); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexImage2D( +error::Error GLES2DecoderImpl::HandleTexImage2D( uint32 immediate_data_size, const gles2::TexImage2D& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -1787,7 +1787,7 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexImage2D( pixels = GetSharedMemoryAs<const void*>( pixels_shm_id, pixels_shm_offset, pixels_size); if (!pixels) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } } if (!ValidateGLenumTextureTarget(target) || @@ -1795,7 +1795,7 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexImage2D( !ValidateGLenumTextureFormat(format) || !ValidateGLenumPixelType(type)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } scoped_array<int8> zero; if (!pixels) { @@ -1806,10 +1806,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexImage2D( glTexImage2D( target, level, internal_format, width, height, border, format, type, pixels); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexImage2DImmediate( +error::Error GLES2DecoderImpl::HandleTexImage2DImmediate( uint32 immediate_data_size, const gles2::TexImage2DImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -1824,84 +1824,84 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexImage2DImmediate( const void* pixels = GetImmediateDataAs<const void*>( c, size, immediate_data_size); if (!pixels) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!ValidateGLenumTextureTarget(target) || !ValidateGLenumTextureFormat(internal_format) || !ValidateGLenumTextureFormat(format) || !ValidateGLenumPixelType(type)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glTexImage2D( target, level, internal_format, width, height, border, format, type, pixels); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribPointerv( +error::Error GLES2DecoderImpl::HandleGetVertexAttribPointerv( uint32 immediate_data_size, const gles2::GetVertexAttribPointerv& c) { GLuint index = static_cast<GLuint>(c.index); GLenum pname = static_cast<GLenum>(c.pname); SizedResult* result = GetSharedMemoryAs<SizedResult*>( c.pointer_shm_id, c.pointer_shm_offset, sizeof(SizedResult)); if (!result) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } result->size = 0; if (!ValidateGLenumVertexPointer(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (index >= max_vertex_attribs_) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } result->size = sizeof(GLuint); *result->GetDataAs<GLuint*>() = vertex_attrib_infos_[index].offset(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetUniformiv( +error::Error GLES2DecoderImpl::HandleGetUniformiv( uint32 immediate_data_size, const gles2::GetUniformiv& c) { // TODO(gman): Implement. NOTREACHED(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetUniformfv( +error::Error GLES2DecoderImpl::HandleGetUniformfv( uint32 immediate_data_size, const gles2::GetUniformfv& c) { // TODO(gman): Implement. NOTREACHED(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetShaderPrecisionFormat( +error::Error GLES2DecoderImpl::HandleGetShaderPrecisionFormat( uint32 immediate_data_size, const gles2::GetShaderPrecisionFormat& c) { // TODO(gman): Implement. NOTREACHED(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetAttachedShaders( +error::Error GLES2DecoderImpl::HandleGetAttachedShaders( uint32 immediate_data_size, const gles2::GetAttachedShaders& c) { // TODO(gman): Implement. NOTREACHED(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetActiveUniform( +error::Error GLES2DecoderImpl::HandleGetActiveUniform( uint32 immediate_data_size, const gles2::GetActiveUniform& c) { // TODO(gman): Implement. NOTREACHED(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetActiveAttrib( +error::Error GLES2DecoderImpl::HandleGetActiveAttrib( uint32 immediate_data_size, const gles2::GetActiveAttrib& c) { // TODO(gman): Implement. NOTREACHED(); - return parse_error::kParseNoError; + return error::kNoError; } // Include the auto-generated part of this file. We split this because it means diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 8e2b134..db91d55 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -24,7 +24,7 @@ namespace gles2 { // commands and calling GL. class GLES2Decoder : public CommonDecoder { public: - typedef parse_error::ParseError ParseError; + typedef error::Error Error; // Creates a decoder. static GLES2Decoder* Create(); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 5338e58..f25512c 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -8,185 +8,185 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ -parse_error::ParseError GLES2DecoderImpl::HandleActiveTexture( +error::Error GLES2DecoderImpl::HandleActiveTexture( uint32 immediate_data_size, const gles2::ActiveTexture& c) { GLenum texture = static_cast<GLenum>(c.texture); glActiveTexture(texture); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleAttachShader( +error::Error GLES2DecoderImpl::HandleAttachShader( uint32 immediate_data_size, const gles2::AttachShader& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glAttachShader(program, shader); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBindAttribLocation( +error::Error GLES2DecoderImpl::HandleBindAttribLocation( uint32 immediate_data_size, const gles2::BindAttribLocation& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLuint index = static_cast<GLuint>(c.index); uint32 name_size = c.data_size; const char* name = GetSharedMemoryAs<const char*>( c.name_shm_id, c.name_shm_offset, name_size); if (name == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } String name_str(name, name_size); glBindAttribLocation(program, index, name_str.c_str()); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBindAttribLocationImmediate( +error::Error GLES2DecoderImpl::HandleBindAttribLocationImmediate( uint32 immediate_data_size, const gles2::BindAttribLocationImmediate& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLuint index = static_cast<GLuint>(c.index); uint32 name_size = c.data_size; const char* name = GetImmediateDataAs<const char*>( c, name_size, immediate_data_size); if (name == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } String name_str(name, name_size); glBindAttribLocation(program, index, name_str.c_str()); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBindBuffer( +error::Error GLES2DecoderImpl::HandleBindBuffer( uint32 immediate_data_size, const gles2::BindBuffer& c) { GLenum target = static_cast<GLenum>(c.target); GLuint buffer; if (!id_manager_->GetServiceId(c.buffer, &buffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } DoBindBuffer(target, buffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBindFramebuffer( +error::Error GLES2DecoderImpl::HandleBindFramebuffer( uint32 immediate_data_size, const gles2::BindFramebuffer& c) { GLenum target = static_cast<GLenum>(c.target); GLuint framebuffer; if (!id_manager_->GetServiceId(c.framebuffer, &framebuffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumFrameBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBindFramebufferEXT(target, framebuffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBindRenderbuffer( +error::Error GLES2DecoderImpl::HandleBindRenderbuffer( uint32 immediate_data_size, const gles2::BindRenderbuffer& c) { GLenum target = static_cast<GLenum>(c.target); GLuint renderbuffer; if (!id_manager_->GetServiceId(c.renderbuffer, &renderbuffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumRenderBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBindRenderbufferEXT(target, renderbuffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBindTexture( +error::Error GLES2DecoderImpl::HandleBindTexture( uint32 immediate_data_size, const gles2::BindTexture& c) { GLenum target = static_cast<GLenum>(c.target); GLuint texture; if (!id_manager_->GetServiceId(c.texture, &texture)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBindTexture(target, texture); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBlendColor( +error::Error GLES2DecoderImpl::HandleBlendColor( uint32 immediate_data_size, const gles2::BlendColor& c) { GLclampf red = static_cast<GLclampf>(c.red); GLclampf green = static_cast<GLclampf>(c.green); GLclampf blue = static_cast<GLclampf>(c.blue); GLclampf alpha = static_cast<GLclampf>(c.alpha); glBlendColor(red, green, blue, alpha); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBlendEquation( +error::Error GLES2DecoderImpl::HandleBlendEquation( uint32 immediate_data_size, const gles2::BlendEquation& c) { GLenum mode = static_cast<GLenum>(c.mode); if (!ValidateGLenumEquation(mode)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBlendEquation(mode); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBlendEquationSeparate( +error::Error GLES2DecoderImpl::HandleBlendEquationSeparate( uint32 immediate_data_size, const gles2::BlendEquationSeparate& c) { GLenum modeRGB = static_cast<GLenum>(c.modeRGB); GLenum modeAlpha = static_cast<GLenum>(c.modeAlpha); if (!ValidateGLenumEquation(modeRGB)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumEquation(modeAlpha)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBlendEquationSeparate(modeRGB, modeAlpha); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBlendFunc( +error::Error GLES2DecoderImpl::HandleBlendFunc( uint32 immediate_data_size, const gles2::BlendFunc& c) { GLenum sfactor = static_cast<GLenum>(c.sfactor); GLenum dfactor = static_cast<GLenum>(c.dfactor); if (!ValidateGLenumSrcBlendFactor(sfactor)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumDstBlendFactor(dfactor)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBlendFunc(sfactor, dfactor); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBlendFuncSeparate( +error::Error GLES2DecoderImpl::HandleBlendFuncSeparate( uint32 immediate_data_size, const gles2::BlendFuncSeparate& c) { GLenum srcRGB = static_cast<GLenum>(c.srcRGB); GLenum dstRGB = static_cast<GLenum>(c.dstRGB); @@ -194,25 +194,25 @@ parse_error::ParseError GLES2DecoderImpl::HandleBlendFuncSeparate( GLenum dstAlpha = static_cast<GLenum>(c.dstAlpha); if (!ValidateGLenumSrcBlendFactor(srcRGB)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumDstBlendFactor(dstRGB)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumSrcBlendFactor(srcAlpha)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumDstBlendFactor(dstAlpha)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBufferSubData( +error::Error GLES2DecoderImpl::HandleBufferSubData( uint32 immediate_data_size, const gles2::BufferSubData& c) { GLenum target = static_cast<GLenum>(c.target); GLintptr offset = static_cast<GLintptr>(c.offset); @@ -222,16 +222,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleBufferSubData( c.data_shm_id, c.data_shm_offset, data_size); if (!ValidateGLenumBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (data == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glBufferSubData(target, offset, size, data); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleBufferSubDataImmediate( +error::Error GLES2DecoderImpl::HandleBufferSubDataImmediate( uint32 immediate_data_size, const gles2::BufferSubDataImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLintptr offset = static_cast<GLintptr>(c.offset); @@ -241,79 +241,79 @@ parse_error::ParseError GLES2DecoderImpl::HandleBufferSubDataImmediate( c, data_size, immediate_data_size); if (!ValidateGLenumBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (data == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glBufferSubData(target, offset, size, data); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCheckFramebufferStatus( +error::Error GLES2DecoderImpl::HandleCheckFramebufferStatus( uint32 immediate_data_size, const gles2::CheckFramebufferStatus& c) { GLenum target = static_cast<GLenum>(c.target); if (!ValidateGLenumFrameBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glCheckFramebufferStatusEXT(target); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleClear( +error::Error GLES2DecoderImpl::HandleClear( uint32 immediate_data_size, const gles2::Clear& c) { GLbitfield mask = static_cast<GLbitfield>(c.mask); glClear(mask); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleClearColor( +error::Error GLES2DecoderImpl::HandleClearColor( uint32 immediate_data_size, const gles2::ClearColor& c) { GLclampf red = static_cast<GLclampf>(c.red); GLclampf green = static_cast<GLclampf>(c.green); GLclampf blue = static_cast<GLclampf>(c.blue); GLclampf alpha = static_cast<GLclampf>(c.alpha); glClearColor(red, green, blue, alpha); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleClearDepthf( +error::Error GLES2DecoderImpl::HandleClearDepthf( uint32 immediate_data_size, const gles2::ClearDepthf& c) { GLclampf depth = static_cast<GLclampf>(c.depth); glClearDepth(depth); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleClearStencil( +error::Error GLES2DecoderImpl::HandleClearStencil( uint32 immediate_data_size, const gles2::ClearStencil& c) { GLint s = static_cast<GLint>(c.s); glClearStencil(s); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleColorMask( +error::Error GLES2DecoderImpl::HandleColorMask( uint32 immediate_data_size, const gles2::ColorMask& c) { GLboolean red = static_cast<GLboolean>(c.red); GLboolean green = static_cast<GLboolean>(c.green); GLboolean blue = static_cast<GLboolean>(c.blue); GLboolean alpha = static_cast<GLboolean>(c.alpha); glColorMask(red, green, blue, alpha); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCompileShader( +error::Error GLES2DecoderImpl::HandleCompileShader( uint32 immediate_data_size, const gles2::CompileShader& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glCompileShader(shader); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexSubImage2D( +error::Error GLES2DecoderImpl::HandleCompressedTexSubImage2D( uint32 immediate_data_size, const gles2::CompressedTexSubImage2D& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -328,17 +328,17 @@ parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexSubImage2D( c.data_shm_id, c.data_shm_offset, data_size); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (data == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glCompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, imageSize, data); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate( +error::Error GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate( uint32 immediate_data_size, const gles2::CompressedTexSubImage2DImmediate& c) { GLenum target = static_cast<GLenum>(c.target); @@ -354,17 +354,17 @@ parse_error::ParseError GLES2DecoderImpl::HandleCompressedTexSubImage2DImmediate c, data_size, immediate_data_size); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (data == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glCompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, imageSize, data); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCopyTexImage2D( +error::Error GLES2DecoderImpl::HandleCopyTexImage2D( uint32 immediate_data_size, const gles2::CopyTexImage2D& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -376,13 +376,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleCopyTexImage2D( GLint border = static_cast<GLint>(c.border); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCopyTexSubImage2D( +error::Error GLES2DecoderImpl::HandleCopyTexSubImage2D( uint32 immediate_data_size, const gles2::CopyTexSubImage2D& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -394,250 +394,250 @@ parse_error::ParseError GLES2DecoderImpl::HandleCopyTexSubImage2D( GLsizei height = static_cast<GLsizei>(c.height); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCreateProgram( +error::Error GLES2DecoderImpl::HandleCreateProgram( uint32 immediate_data_size, const gles2::CreateProgram& c) { uint32 client_id = c.client_id; CreateProgramHelper(client_id); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCreateShader( +error::Error GLES2DecoderImpl::HandleCreateShader( uint32 immediate_data_size, const gles2::CreateShader& c) { GLenum type = static_cast<GLenum>(c.type); if (!ValidateGLenumShaderType(type)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } uint32 client_id = c.client_id; CreateShaderHelper(type, client_id); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleCullFace( +error::Error GLES2DecoderImpl::HandleCullFace( uint32 immediate_data_size, const gles2::CullFace& c) { GLenum mode = static_cast<GLenum>(c.mode); if (!ValidateGLenumFaceType(mode)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glCullFace(mode); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteBuffers( +error::Error GLES2DecoderImpl::HandleDeleteBuffers( uint32 immediate_data_size, const gles2::DeleteBuffers& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* buffers = GetSharedMemoryAs<const GLuint*>( c.buffers_shm_id, c.buffers_shm_offset, data_size); if (buffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteBuffersHelper>(n, buffers); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteBuffersImmediate( +error::Error GLES2DecoderImpl::HandleDeleteBuffersImmediate( uint32 immediate_data_size, const gles2::DeleteBuffersImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* buffers = GetImmediateDataAs<const GLuint*>( c, data_size, immediate_data_size); if (buffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteBuffersHelper>(n, buffers); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteFramebuffers( +error::Error GLES2DecoderImpl::HandleDeleteFramebuffers( uint32 immediate_data_size, const gles2::DeleteFramebuffers& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* framebuffers = GetSharedMemoryAs<const GLuint*>( c.framebuffers_shm_id, c.framebuffers_shm_offset, data_size); if (framebuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteFramebuffersHelper>(n, framebuffers); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteFramebuffersImmediate( +error::Error GLES2DecoderImpl::HandleDeleteFramebuffersImmediate( uint32 immediate_data_size, const gles2::DeleteFramebuffersImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* framebuffers = GetImmediateDataAs<const GLuint*>( c, data_size, immediate_data_size); if (framebuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteFramebuffersHelper>(n, framebuffers); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteRenderbuffers( +error::Error GLES2DecoderImpl::HandleDeleteRenderbuffers( uint32 immediate_data_size, const gles2::DeleteRenderbuffers& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* renderbuffers = GetSharedMemoryAs<const GLuint*>( c.renderbuffers_shm_id, c.renderbuffers_shm_offset, data_size); if (renderbuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteRenderbuffersHelper>(n, renderbuffers); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteRenderbuffersImmediate( +error::Error GLES2DecoderImpl::HandleDeleteRenderbuffersImmediate( uint32 immediate_data_size, const gles2::DeleteRenderbuffersImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* renderbuffers = GetImmediateDataAs<const GLuint*>( c, data_size, immediate_data_size); if (renderbuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteRenderbuffersHelper>(n, renderbuffers); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteTextures( +error::Error GLES2DecoderImpl::HandleDeleteTextures( uint32 immediate_data_size, const gles2::DeleteTextures& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* textures = GetSharedMemoryAs<const GLuint*>( c.textures_shm_id, c.textures_shm_offset, data_size); if (textures == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteTexturesHelper>(n, textures); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDeleteTexturesImmediate( +error::Error GLES2DecoderImpl::HandleDeleteTexturesImmediate( uint32 immediate_data_size, const gles2::DeleteTexturesImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); const GLuint* textures = GetImmediateDataAs<const GLuint*>( c, data_size, immediate_data_size); if (textures == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } DeleteGLObjects<GLDeleteTexturesHelper>(n, textures); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDepthFunc( +error::Error GLES2DecoderImpl::HandleDepthFunc( uint32 immediate_data_size, const gles2::DepthFunc& c) { GLenum func = static_cast<GLenum>(c.func); if (!ValidateGLenumCmpFunction(func)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glDepthFunc(func); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDepthMask( +error::Error GLES2DecoderImpl::HandleDepthMask( uint32 immediate_data_size, const gles2::DepthMask& c) { GLboolean flag = static_cast<GLboolean>(c.flag); glDepthMask(flag); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDepthRangef( +error::Error GLES2DecoderImpl::HandleDepthRangef( uint32 immediate_data_size, const gles2::DepthRangef& c) { GLclampf zNear = static_cast<GLclampf>(c.zNear); GLclampf zFar = static_cast<GLclampf>(c.zFar); glDepthRange(zNear, zFar); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDetachShader( +error::Error GLES2DecoderImpl::HandleDetachShader( uint32 immediate_data_size, const gles2::DetachShader& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glDetachShader(program, shader); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDisable( +error::Error GLES2DecoderImpl::HandleDisable( uint32 immediate_data_size, const gles2::Disable& c) { GLenum cap = static_cast<GLenum>(c.cap); if (!ValidateGLenumCapability(cap)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glDisable(cap); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDisableVertexAttribArray( +error::Error GLES2DecoderImpl::HandleDisableVertexAttribArray( uint32 immediate_data_size, const gles2::DisableVertexAttribArray& c) { GLuint index = static_cast<GLuint>(c.index); DoDisableVertexAttribArray(index); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleDrawArrays( +error::Error GLES2DecoderImpl::HandleDrawArrays( uint32 immediate_data_size, const gles2::DrawArrays& c) { GLenum mode = static_cast<GLenum>(c.mode); GLint first = static_cast<GLint>(c.first); GLsizei count = static_cast<GLsizei>(c.count); if (!ValidateGLenumDrawMode(mode)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } DoDrawArrays(mode, first, count); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleEnable( +error::Error GLES2DecoderImpl::HandleEnable( uint32 immediate_data_size, const gles2::Enable& c) { GLenum cap = static_cast<GLenum>(c.cap); if (!ValidateGLenumCapability(cap)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glEnable(cap); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleEnableVertexAttribArray( +error::Error GLES2DecoderImpl::HandleEnableVertexAttribArray( uint32 immediate_data_size, const gles2::EnableVertexAttribArray& c) { GLuint index = static_cast<GLuint>(c.index); DoEnableVertexAttribArray(index); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleFinish( +error::Error GLES2DecoderImpl::HandleFinish( uint32 immediate_data_size, const gles2::Finish& c) { glFinish(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleFlush( +error::Error GLES2DecoderImpl::HandleFlush( uint32 immediate_data_size, const gles2::Flush& c) { glFlush(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleFramebufferRenderbuffer( +error::Error GLES2DecoderImpl::HandleFramebufferRenderbuffer( uint32 immediate_data_size, const gles2::FramebufferRenderbuffer& c) { GLenum target = static_cast<GLenum>(c.target); GLenum attachment = static_cast<GLenum>(c.attachment); @@ -645,26 +645,26 @@ parse_error::ParseError GLES2DecoderImpl::HandleFramebufferRenderbuffer( GLuint renderbuffer; if (!id_manager_->GetServiceId(c.renderbuffer, &renderbuffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumFrameBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumAttachment(attachment)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumRenderBufferTarget(renderbuffertarget)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glFramebufferRenderbufferEXT( target, attachment, renderbuffertarget, renderbuffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleFramebufferTexture2D( +error::Error GLES2DecoderImpl::HandleFramebufferTexture2D( uint32 immediate_data_size, const gles2::FramebufferTexture2D& c) { GLenum target = static_cast<GLenum>(c.target); GLenum attachment = static_cast<GLenum>(c.attachment); @@ -672,168 +672,168 @@ parse_error::ParseError GLES2DecoderImpl::HandleFramebufferTexture2D( GLuint texture; if (!id_manager_->GetServiceId(c.texture, &texture)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLint level = static_cast<GLint>(c.level); if (!ValidateGLenumFrameBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumAttachment(attachment)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureTarget(textarget)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glFramebufferTexture2DEXT(target, attachment, textarget, texture, level); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleFrontFace( +error::Error GLES2DecoderImpl::HandleFrontFace( uint32 immediate_data_size, const gles2::FrontFace& c) { GLenum mode = static_cast<GLenum>(c.mode); if (!ValidateGLenumFaceMode(mode)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glFrontFace(mode); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenBuffers( +error::Error GLES2DecoderImpl::HandleGenBuffers( uint32 immediate_data_size, const gles2::GenBuffers& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* buffers = GetSharedMemoryAs<GLuint*>( c.buffers_shm_id, c.buffers_shm_offset, data_size); if (buffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenBuffersHelper>(n, buffers)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenBuffersImmediate( +error::Error GLES2DecoderImpl::HandleGenBuffersImmediate( uint32 immediate_data_size, const gles2::GenBuffersImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* buffers = GetImmediateDataAs<GLuint*>( c, data_size, immediate_data_size); if (buffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenBuffersHelper>(n, buffers)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenerateMipmap( +error::Error GLES2DecoderImpl::HandleGenerateMipmap( uint32 immediate_data_size, const gles2::GenerateMipmap& c) { GLenum target = static_cast<GLenum>(c.target); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glGenerateMipmapEXT(target); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenFramebuffers( +error::Error GLES2DecoderImpl::HandleGenFramebuffers( uint32 immediate_data_size, const gles2::GenFramebuffers& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* framebuffers = GetSharedMemoryAs<GLuint*>( c.framebuffers_shm_id, c.framebuffers_shm_offset, data_size); if (framebuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenFramebuffersHelper>(n, framebuffers)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenFramebuffersImmediate( +error::Error GLES2DecoderImpl::HandleGenFramebuffersImmediate( uint32 immediate_data_size, const gles2::GenFramebuffersImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* framebuffers = GetImmediateDataAs<GLuint*>( c, data_size, immediate_data_size); if (framebuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenFramebuffersHelper>(n, framebuffers)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenRenderbuffers( +error::Error GLES2DecoderImpl::HandleGenRenderbuffers( uint32 immediate_data_size, const gles2::GenRenderbuffers& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* renderbuffers = GetSharedMemoryAs<GLuint*>( c.renderbuffers_shm_id, c.renderbuffers_shm_offset, data_size); if (renderbuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenRenderbuffersHelper>(n, renderbuffers)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenRenderbuffersImmediate( +error::Error GLES2DecoderImpl::HandleGenRenderbuffersImmediate( uint32 immediate_data_size, const gles2::GenRenderbuffersImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* renderbuffers = GetImmediateDataAs<GLuint*>( c, data_size, immediate_data_size); if (renderbuffers == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenRenderbuffersHelper>(n, renderbuffers)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenTextures( +error::Error GLES2DecoderImpl::HandleGenTextures( uint32 immediate_data_size, const gles2::GenTextures& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* textures = GetSharedMemoryAs<GLuint*>( c.textures_shm_id, c.textures_shm_offset, data_size); if (textures == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenTexturesHelper>(n, textures)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGenTexturesImmediate( +error::Error GLES2DecoderImpl::HandleGenTexturesImmediate( uint32 immediate_data_size, const gles2::GenTexturesImmediate& c) { GLsizei n = static_cast<GLsizei>(c.n); uint32 data_size = n * sizeof(GLuint); GLuint* textures = GetImmediateDataAs<GLuint*>( c, data_size, immediate_data_size); if (textures == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } if (!GenGLObjects<GLGenTexturesHelper>(n, textures)) { - return parse_error::kParseInvalidArguments; + return error::kInvalidArguments; } - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetBooleanv( +error::Error GLES2DecoderImpl::HandleGetBooleanv( uint32 immediate_data_size, const gles2::GetBooleanv& c) { GLenum pname = static_cast<GLenum>(c.pname); GLboolean* params; @@ -842,13 +842,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetBooleanv( params = GetSharedMemoryAs<GLboolean*>( c.params_shm_id, c.params_shm_offset, params_size); if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetBooleanv(pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetBufferParameteriv( +error::Error GLES2DecoderImpl::HandleGetBufferParameteriv( uint32 immediate_data_size, const gles2::GetBufferParameteriv& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -859,28 +859,28 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetBufferParameteriv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumBufferParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetBufferParameteriv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetError( +error::Error GLES2DecoderImpl::HandleGetError( uint32 immediate_data_size, const gles2::GetError& c) { GLenum* result_dst = GetSharedMemoryAs<GLenum*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = GetGLError(); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetFloatv( +error::Error GLES2DecoderImpl::HandleGetFloatv( uint32 immediate_data_size, const gles2::GetFloatv& c) { GLenum pname = static_cast<GLenum>(c.pname); GLfloat* params; @@ -889,13 +889,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetFloatv( params = GetSharedMemoryAs<GLfloat*>( c.params_shm_id, c.params_shm_offset, params_size); if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetFloatv(pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetFramebufferAttachmentParameteriv( +error::Error GLES2DecoderImpl::HandleGetFramebufferAttachmentParameteriv( uint32 immediate_data_size, const gles2::GetFramebufferAttachmentParameteriv& c) { GLenum target = static_cast<GLenum>(c.target); @@ -908,24 +908,24 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetFramebufferAttachmentParamete c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumFrameBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumAttachment(attachment)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumFrameBufferParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetIntegerv( +error::Error GLES2DecoderImpl::HandleGetIntegerv( uint32 immediate_data_size, const gles2::GetIntegerv& c) { GLenum pname = static_cast<GLenum>(c.pname); GLint* params; @@ -934,18 +934,18 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetIntegerv( params = GetSharedMemoryAs<GLint*>( c.params_shm_id, c.params_shm_offset, params_size); if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetIntegerv(pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetProgramiv( +error::Error GLES2DecoderImpl::HandleGetProgramiv( uint32 immediate_data_size, const gles2::GetProgramiv& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLenum pname = static_cast<GLenum>(c.pname); GLint* params; @@ -955,21 +955,21 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetProgramiv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumProgramParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetProgramiv(program, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetProgramInfoLog( +error::Error GLES2DecoderImpl::HandleGetProgramInfoLog( uint32 immediate_data_size, const gles2::GetProgramInfoLog& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLsizei bufsize = static_cast<GLsizei>(c.bufsize); uint32 size_shm_id = c.length_shm_id; @@ -979,19 +979,19 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetProgramInfoLog( length = GetSharedMemoryAs<GLsizei*>( size_shm_id, size_shm_offset, sizeof(*length)); if (!length) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } } char* infolog = GetSharedMemoryAs<char*>( c.infolog_shm_id, c.infolog_shm_offset, bufsize); if (infolog == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetProgramInfoLog(program, bufsize, length, infolog); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetRenderbufferParameteriv( +error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( uint32 immediate_data_size, const gles2::GetRenderbufferParameteriv& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1002,25 +1002,25 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetRenderbufferParameteriv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumRenderBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumRenderBufferParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetRenderbufferParameterivEXT(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetShaderiv( +error::Error GLES2DecoderImpl::HandleGetShaderiv( uint32 immediate_data_size, const gles2::GetShaderiv& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLenum pname = static_cast<GLenum>(c.pname); GLint* params; @@ -1030,21 +1030,21 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetShaderiv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumShaderParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetShaderiv(shader, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetShaderInfoLog( +error::Error GLES2DecoderImpl::HandleGetShaderInfoLog( uint32 immediate_data_size, const gles2::GetShaderInfoLog& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLsizei bufsize = static_cast<GLsizei>(c.bufsize); uint32 size_shm_id = c.length_shm_id; @@ -1054,24 +1054,24 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetShaderInfoLog( length = GetSharedMemoryAs<GLsizei*>( size_shm_id, size_shm_offset, sizeof(*length)); if (!length) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } } char* infolog = GetSharedMemoryAs<char*>( c.infolog_shm_id, c.infolog_shm_offset, bufsize); if (infolog == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetShaderInfoLog(shader, bufsize, length, infolog); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetShaderSource( +error::Error GLES2DecoderImpl::HandleGetShaderSource( uint32 immediate_data_size, const gles2::GetShaderSource& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLsizei bufsize = static_cast<GLsizei>(c.bufsize); uint32 size_shm_id = c.length_shm_id; @@ -1081,30 +1081,30 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetShaderSource( length = GetSharedMemoryAs<GLsizei*>( size_shm_id, size_shm_offset, sizeof(*length)); if (!length) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } } char* source = GetSharedMemoryAs<char*>( c.source_shm_id, c.source_shm_offset, bufsize); if (source == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetShaderSource(shader, bufsize, length, source); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetString( +error::Error GLES2DecoderImpl::HandleGetString( uint32 immediate_data_size, const gles2::GetString& c) { GLenum name = static_cast<GLenum>(c.name); if (!ValidateGLenumStringType(name)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glGetString(name); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameterfv( +error::Error GLES2DecoderImpl::HandleGetTexParameterfv( uint32 immediate_data_size, const gles2::GetTexParameterfv& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1115,20 +1115,20 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameterfv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetTexParameterfv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameteriv( +error::Error GLES2DecoderImpl::HandleGetTexParameteriv( uint32 immediate_data_size, const gles2::GetTexParameteriv& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1139,20 +1139,20 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetTexParameteriv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetTexParameteriv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribfv( +error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( uint32 immediate_data_size, const gles2::GetVertexAttribfv& c) { GLuint index = static_cast<GLuint>(c.index); GLenum pname = static_cast<GLenum>(c.pname); @@ -1163,16 +1163,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribfv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumVertexAttribute(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetVertexAttribfv(index, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribiv( +error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( uint32 immediate_data_size, const gles2::GetVertexAttribiv& c) { GLuint index = static_cast<GLuint>(c.index); GLenum pname = static_cast<GLenum>(c.pname); @@ -1183,149 +1183,149 @@ parse_error::ParseError GLES2DecoderImpl::HandleGetVertexAttribiv( c.params_shm_id, c.params_shm_offset, params_size); if (!ValidateGLenumVertexAttribute(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glGetVertexAttribiv(index, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleHint( +error::Error GLES2DecoderImpl::HandleHint( uint32 immediate_data_size, const gles2::Hint& c) { GLenum target = static_cast<GLenum>(c.target); GLenum mode = static_cast<GLenum>(c.mode); if (!ValidateGLenumHintTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumHintMode(mode)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glHint(target, mode); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsBuffer( +error::Error GLES2DecoderImpl::HandleIsBuffer( uint32 immediate_data_size, const gles2::IsBuffer& c) { GLuint buffer; if (!id_manager_->GetServiceId(c.buffer, &buffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = glIsBuffer(buffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsEnabled( +error::Error GLES2DecoderImpl::HandleIsEnabled( uint32 immediate_data_size, const gles2::IsEnabled& c) { GLenum cap = static_cast<GLenum>(c.cap); GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); if (!ValidateGLenumCapability(cap)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } *result_dst = glIsEnabled(cap); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsFramebuffer( +error::Error GLES2DecoderImpl::HandleIsFramebuffer( uint32 immediate_data_size, const gles2::IsFramebuffer& c) { GLuint framebuffer; if (!id_manager_->GetServiceId(c.framebuffer, &framebuffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = glIsFramebufferEXT(framebuffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsProgram( +error::Error GLES2DecoderImpl::HandleIsProgram( uint32 immediate_data_size, const gles2::IsProgram& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = glIsProgram(program); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsRenderbuffer( +error::Error GLES2DecoderImpl::HandleIsRenderbuffer( uint32 immediate_data_size, const gles2::IsRenderbuffer& c) { GLuint renderbuffer; if (!id_manager_->GetServiceId(c.renderbuffer, &renderbuffer)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = glIsRenderbufferEXT(renderbuffer); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsShader( +error::Error GLES2DecoderImpl::HandleIsShader( uint32 immediate_data_size, const gles2::IsShader& c) { GLuint shader; if (!id_manager_->GetServiceId(c.shader, &shader)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = glIsShader(shader); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleIsTexture( +error::Error GLES2DecoderImpl::HandleIsTexture( uint32 immediate_data_size, const gles2::IsTexture& c) { GLuint texture; if (!id_manager_->GetServiceId(c.texture, &texture)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } GLboolean* result_dst = GetSharedMemoryAs<GLboolean*>( c.result_shm_id, c.result_shm_offset, sizeof(*result_dst)); *result_dst = glIsTexture(texture); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleLineWidth( +error::Error GLES2DecoderImpl::HandleLineWidth( uint32 immediate_data_size, const gles2::LineWidth& c) { GLfloat width = static_cast<GLfloat>(c.width); glLineWidth(width); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleLinkProgram( +error::Error GLES2DecoderImpl::HandleLinkProgram( uint32 immediate_data_size, const gles2::LinkProgram& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } DoLinkProgram(program); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandlePolygonOffset( +error::Error GLES2DecoderImpl::HandlePolygonOffset( uint32 immediate_data_size, const gles2::PolygonOffset& c) { GLfloat factor = static_cast<GLfloat>(c.factor); GLfloat units = static_cast<GLfloat>(c.units); glPolygonOffset(factor, units); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleRenderbufferStorage( +error::Error GLES2DecoderImpl::HandleRenderbufferStorage( uint32 immediate_data_size, const gles2::RenderbufferStorage& c) { GLenum target = static_cast<GLenum>(c.target); GLenum internalformat = static_cast<GLenum>(c.internalformat); @@ -1333,48 +1333,48 @@ parse_error::ParseError GLES2DecoderImpl::HandleRenderbufferStorage( GLsizei height = static_cast<GLsizei>(c.height); if (!ValidateGLenumRenderBufferTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumRenderBufferFormat(internalformat)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glRenderbufferStorageEXT(target, internalformat, width, height); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleSampleCoverage( +error::Error GLES2DecoderImpl::HandleSampleCoverage( uint32 immediate_data_size, const gles2::SampleCoverage& c) { GLclampf value = static_cast<GLclampf>(c.value); GLboolean invert = static_cast<GLboolean>(c.invert); glSampleCoverage(value, invert); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleScissor( +error::Error GLES2DecoderImpl::HandleScissor( uint32 immediate_data_size, const gles2::Scissor& c) { GLint x = static_cast<GLint>(c.x); GLint y = static_cast<GLint>(c.y); GLsizei width = static_cast<GLsizei>(c.width); GLsizei height = static_cast<GLsizei>(c.height); glScissor(x, y, width, height); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleStencilFunc( +error::Error GLES2DecoderImpl::HandleStencilFunc( uint32 immediate_data_size, const gles2::StencilFunc& c) { GLenum func = static_cast<GLenum>(c.func); GLint ref = static_cast<GLint>(c.ref); GLuint mask = static_cast<GLuint>(c.mask); if (!ValidateGLenumCmpFunction(func)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glStencilFunc(func, ref, mask); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleStencilFuncSeparate( +error::Error GLES2DecoderImpl::HandleStencilFuncSeparate( uint32 immediate_data_size, const gles2::StencilFuncSeparate& c) { GLenum face = static_cast<GLenum>(c.face); GLenum func = static_cast<GLenum>(c.func); @@ -1382,57 +1382,57 @@ parse_error::ParseError GLES2DecoderImpl::HandleStencilFuncSeparate( GLuint mask = static_cast<GLuint>(c.mask); if (!ValidateGLenumFaceType(face)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumCmpFunction(func)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glStencilFuncSeparate(face, func, ref, mask); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleStencilMask( +error::Error GLES2DecoderImpl::HandleStencilMask( uint32 immediate_data_size, const gles2::StencilMask& c) { GLuint mask = static_cast<GLuint>(c.mask); glStencilMask(mask); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleStencilMaskSeparate( +error::Error GLES2DecoderImpl::HandleStencilMaskSeparate( uint32 immediate_data_size, const gles2::StencilMaskSeparate& c) { GLenum face = static_cast<GLenum>(c.face); GLuint mask = static_cast<GLuint>(c.mask); if (!ValidateGLenumFaceType(face)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glStencilMaskSeparate(face, mask); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleStencilOp( +error::Error GLES2DecoderImpl::HandleStencilOp( uint32 immediate_data_size, const gles2::StencilOp& c) { GLenum fail = static_cast<GLenum>(c.fail); GLenum zfail = static_cast<GLenum>(c.zfail); GLenum zpass = static_cast<GLenum>(c.zpass); if (!ValidateGLenumStencilOp(fail)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumStencilOp(zfail)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumStencilOp(zpass)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glStencilOp(fail, zfail, zpass); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleStencilOpSeparate( +error::Error GLES2DecoderImpl::HandleStencilOpSeparate( uint32 immediate_data_size, const gles2::StencilOpSeparate& c) { GLenum face = static_cast<GLenum>(c.face); GLenum fail = static_cast<GLenum>(c.fail); @@ -1440,42 +1440,42 @@ parse_error::ParseError GLES2DecoderImpl::HandleStencilOpSeparate( GLenum zpass = static_cast<GLenum>(c.zpass); if (!ValidateGLenumFaceType(face)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumStencilOp(fail)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumStencilOp(zfail)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumStencilOp(zpass)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glStencilOpSeparate(face, fail, zfail, zpass); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexParameterf( +error::Error GLES2DecoderImpl::HandleTexParameterf( uint32 immediate_data_size, const gles2::TexParameterf& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); GLfloat param = static_cast<GLfloat>(c.param); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glTexParameterf(target, pname, param); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfv( +error::Error GLES2DecoderImpl::HandleTexParameterfv( uint32 immediate_data_size, const gles2::TexParameterfv& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1485,20 +1485,20 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfv( c.params_shm_id, c.params_shm_offset, data_size); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glTexParameterfv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfvImmediate( +error::Error GLES2DecoderImpl::HandleTexParameterfvImmediate( uint32 immediate_data_size, const gles2::TexParameterfvImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1508,37 +1508,37 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexParameterfvImmediate( c, data_size, immediate_data_size); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glTexParameterfv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexParameteri( +error::Error GLES2DecoderImpl::HandleTexParameteri( uint32 immediate_data_size, const gles2::TexParameteri& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); GLint param = static_cast<GLint>(c.param); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } glTexParameteri(target, pname, param); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexParameteriv( +error::Error GLES2DecoderImpl::HandleTexParameteriv( uint32 immediate_data_size, const gles2::TexParameteriv& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1548,20 +1548,20 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexParameteriv( c.params_shm_id, c.params_shm_offset, data_size); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glTexParameteriv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexParameterivImmediate( +error::Error GLES2DecoderImpl::HandleTexParameterivImmediate( uint32 immediate_data_size, const gles2::TexParameterivImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); @@ -1571,20 +1571,20 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexParameterivImmediate( c, data_size, immediate_data_size); if (!ValidateGLenumTextureBindTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureParameter(pname)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (params == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glTexParameteriv(target, pname, params); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2D( +error::Error GLES2DecoderImpl::HandleTexSubImage2D( uint32 immediate_data_size, const gles2::TexSubImage2D& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -1600,25 +1600,25 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2D( c.pixels_shm_id, c.pixels_shm_offset, data_size); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureFormat(format)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumPixelType(type)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (pixels == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2DImmediate( +error::Error GLES2DecoderImpl::HandleTexSubImage2DImmediate( uint32 immediate_data_size, const gles2::TexSubImage2DImmediate& c) { GLenum target = static_cast<GLenum>(c.target); GLint level = static_cast<GLint>(c.level); @@ -1634,33 +1634,33 @@ parse_error::ParseError GLES2DecoderImpl::HandleTexSubImage2DImmediate( c, data_size, immediate_data_size); if (!ValidateGLenumTextureTarget(target)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumTextureFormat(format)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (!ValidateGLenumPixelType(type)) { SetGLError(GL_INVALID_ENUM); - return parse_error::kParseNoError; + return error::kNoError; } if (pixels == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform1f( +error::Error GLES2DecoderImpl::HandleUniform1f( uint32 immediate_data_size, const gles2::Uniform1f& c) { GLint location = static_cast<GLint>(c.location); GLfloat x = static_cast<GLfloat>(c.x); glUniform1f(location, x); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform1fv( +error::Error GLES2DecoderImpl::HandleUniform1fv( uint32 immediate_data_size, const gles2::Uniform1fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1669,13 +1669,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform1fv( const GLfloat* v = GetSharedMemoryAs<const GLfloat*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform1fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform1fvImmediate( +error::Error GLES2DecoderImpl::HandleUniform1fvImmediate( uint32 immediate_data_size, const gles2::Uniform1fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1684,21 +1684,21 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform1fvImmediate( const GLfloat* v = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform1fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform1i( +error::Error GLES2DecoderImpl::HandleUniform1i( uint32 immediate_data_size, const gles2::Uniform1i& c) { GLint location = static_cast<GLint>(c.location); GLint x = static_cast<GLint>(c.x); glUniform1i(location, x); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform1iv( +error::Error GLES2DecoderImpl::HandleUniform1iv( uint32 immediate_data_size, const gles2::Uniform1iv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1707,13 +1707,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform1iv( const GLint* v = GetSharedMemoryAs<const GLint*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform1iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform1ivImmediate( +error::Error GLES2DecoderImpl::HandleUniform1ivImmediate( uint32 immediate_data_size, const gles2::Uniform1ivImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1722,22 +1722,22 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform1ivImmediate( const GLint* v = GetImmediateDataAs<const GLint*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform1iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform2f( +error::Error GLES2DecoderImpl::HandleUniform2f( uint32 immediate_data_size, const gles2::Uniform2f& c) { GLint location = static_cast<GLint>(c.location); GLfloat x = static_cast<GLfloat>(c.x); GLfloat y = static_cast<GLfloat>(c.y); glUniform2f(location, x, y); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform2fv( +error::Error GLES2DecoderImpl::HandleUniform2fv( uint32 immediate_data_size, const gles2::Uniform2fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1746,13 +1746,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform2fv( const GLfloat* v = GetSharedMemoryAs<const GLfloat*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform2fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform2fvImmediate( +error::Error GLES2DecoderImpl::HandleUniform2fvImmediate( uint32 immediate_data_size, const gles2::Uniform2fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1761,22 +1761,22 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform2fvImmediate( const GLfloat* v = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform2fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform2i( +error::Error GLES2DecoderImpl::HandleUniform2i( uint32 immediate_data_size, const gles2::Uniform2i& c) { GLint location = static_cast<GLint>(c.location); GLint x = static_cast<GLint>(c.x); GLint y = static_cast<GLint>(c.y); glUniform2i(location, x, y); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform2iv( +error::Error GLES2DecoderImpl::HandleUniform2iv( uint32 immediate_data_size, const gles2::Uniform2iv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1785,13 +1785,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform2iv( const GLint* v = GetSharedMemoryAs<const GLint*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform2iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform2ivImmediate( +error::Error GLES2DecoderImpl::HandleUniform2ivImmediate( uint32 immediate_data_size, const gles2::Uniform2ivImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1800,23 +1800,23 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform2ivImmediate( const GLint* v = GetImmediateDataAs<const GLint*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform2iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform3f( +error::Error GLES2DecoderImpl::HandleUniform3f( uint32 immediate_data_size, const gles2::Uniform3f& c) { GLint location = static_cast<GLint>(c.location); GLfloat x = static_cast<GLfloat>(c.x); GLfloat y = static_cast<GLfloat>(c.y); GLfloat z = static_cast<GLfloat>(c.z); glUniform3f(location, x, y, z); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform3fv( +error::Error GLES2DecoderImpl::HandleUniform3fv( uint32 immediate_data_size, const gles2::Uniform3fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1825,13 +1825,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform3fv( const GLfloat* v = GetSharedMemoryAs<const GLfloat*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform3fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform3fvImmediate( +error::Error GLES2DecoderImpl::HandleUniform3fvImmediate( uint32 immediate_data_size, const gles2::Uniform3fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1840,23 +1840,23 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform3fvImmediate( const GLfloat* v = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform3fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform3i( +error::Error GLES2DecoderImpl::HandleUniform3i( uint32 immediate_data_size, const gles2::Uniform3i& c) { GLint location = static_cast<GLint>(c.location); GLint x = static_cast<GLint>(c.x); GLint y = static_cast<GLint>(c.y); GLint z = static_cast<GLint>(c.z); glUniform3i(location, x, y, z); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform3iv( +error::Error GLES2DecoderImpl::HandleUniform3iv( uint32 immediate_data_size, const gles2::Uniform3iv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1865,13 +1865,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform3iv( const GLint* v = GetSharedMemoryAs<const GLint*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform3iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform3ivImmediate( +error::Error GLES2DecoderImpl::HandleUniform3ivImmediate( uint32 immediate_data_size, const gles2::Uniform3ivImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1880,13 +1880,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform3ivImmediate( const GLint* v = GetImmediateDataAs<const GLint*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform3iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform4f( +error::Error GLES2DecoderImpl::HandleUniform4f( uint32 immediate_data_size, const gles2::Uniform4f& c) { GLint location = static_cast<GLint>(c.location); GLfloat x = static_cast<GLfloat>(c.x); @@ -1894,10 +1894,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform4f( GLfloat z = static_cast<GLfloat>(c.z); GLfloat w = static_cast<GLfloat>(c.w); glUniform4f(location, x, y, z, w); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform4fv( +error::Error GLES2DecoderImpl::HandleUniform4fv( uint32 immediate_data_size, const gles2::Uniform4fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1906,13 +1906,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform4fv( const GLfloat* v = GetSharedMemoryAs<const GLfloat*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform4fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform4fvImmediate( +error::Error GLES2DecoderImpl::HandleUniform4fvImmediate( uint32 immediate_data_size, const gles2::Uniform4fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1921,13 +1921,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform4fvImmediate( const GLfloat* v = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform4fv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform4i( +error::Error GLES2DecoderImpl::HandleUniform4i( uint32 immediate_data_size, const gles2::Uniform4i& c) { GLint location = static_cast<GLint>(c.location); GLint x = static_cast<GLint>(c.x); @@ -1935,10 +1935,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform4i( GLint z = static_cast<GLint>(c.z); GLint w = static_cast<GLint>(c.w); glUniform4i(location, x, y, z, w); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform4iv( +error::Error GLES2DecoderImpl::HandleUniform4iv( uint32 immediate_data_size, const gles2::Uniform4iv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1947,13 +1947,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform4iv( const GLint* v = GetSharedMemoryAs<const GLint*>( c.v_shm_id, c.v_shm_offset, data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform4iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniform4ivImmediate( +error::Error GLES2DecoderImpl::HandleUniform4ivImmediate( uint32 immediate_data_size, const gles2::Uniform4ivImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1962,13 +1962,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniform4ivImmediate( const GLint* v = GetImmediateDataAs<const GLint*>( c, data_size, immediate_data_size); if (v == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniform4iv(location, count, v); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix2fv( +error::Error GLES2DecoderImpl::HandleUniformMatrix2fv( uint32 immediate_data_size, const gles2::UniformMatrix2fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1979,16 +1979,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix2fv( c.value_shm_id, c.value_shm_offset, data_size); if (!ValidateGLbooleanFalse(transpose)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (value == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniformMatrix2fv(location, count, transpose, value); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( +error::Error GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( uint32 immediate_data_size, const gles2::UniformMatrix2fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -1999,16 +1999,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix2fvImmediate( c, data_size, immediate_data_size); if (!ValidateGLbooleanFalse(transpose)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (value == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniformMatrix2fv(location, count, transpose, value); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix3fv( +error::Error GLES2DecoderImpl::HandleUniformMatrix3fv( uint32 immediate_data_size, const gles2::UniformMatrix3fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -2019,16 +2019,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix3fv( c.value_shm_id, c.value_shm_offset, data_size); if (!ValidateGLbooleanFalse(transpose)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (value == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniformMatrix3fv(location, count, transpose, value); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( +error::Error GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( uint32 immediate_data_size, const gles2::UniformMatrix3fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -2039,16 +2039,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix3fvImmediate( c, data_size, immediate_data_size); if (!ValidateGLbooleanFalse(transpose)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (value == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniformMatrix3fv(location, count, transpose, value); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix4fv( +error::Error GLES2DecoderImpl::HandleUniformMatrix4fv( uint32 immediate_data_size, const gles2::UniformMatrix4fv& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -2059,16 +2059,16 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix4fv( c.value_shm_id, c.value_shm_offset, data_size); if (!ValidateGLbooleanFalse(transpose)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (value == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniformMatrix4fv(location, count, transpose, value); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( +error::Error GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( uint32 immediate_data_size, const gles2::UniformMatrix4fvImmediate& c) { GLint location = static_cast<GLint>(c.location); GLsizei count = static_cast<GLsizei>(c.count); @@ -2079,46 +2079,46 @@ parse_error::ParseError GLES2DecoderImpl::HandleUniformMatrix4fvImmediate( c, data_size, immediate_data_size); if (!ValidateGLbooleanFalse(transpose)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } if (value == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glUniformMatrix4fv(location, count, transpose, value); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleUseProgram( +error::Error GLES2DecoderImpl::HandleUseProgram( uint32 immediate_data_size, const gles2::UseProgram& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } DoUseProgram(program); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleValidateProgram( +error::Error GLES2DecoderImpl::HandleValidateProgram( uint32 immediate_data_size, const gles2::ValidateProgram& c) { GLuint program; if (!id_manager_->GetServiceId(c.program, &program)) { SetGLError(GL_INVALID_VALUE); - return parse_error::kParseNoError; + return error::kNoError; } glValidateProgram(program); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib1f( +error::Error GLES2DecoderImpl::HandleVertexAttrib1f( uint32 immediate_data_size, const gles2::VertexAttrib1f& c) { GLuint indx = static_cast<GLuint>(c.indx); GLfloat x = static_cast<GLfloat>(c.x); glVertexAttrib1f(indx, x); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib1fv( +error::Error GLES2DecoderImpl::HandleVertexAttrib1fv( uint32 immediate_data_size, const gles2::VertexAttrib1fv& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2126,13 +2126,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib1fv( const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( c.values_shm_id, c.values_shm_offset, data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib1fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib1fvImmediate( +error::Error GLES2DecoderImpl::HandleVertexAttrib1fvImmediate( uint32 immediate_data_size, const gles2::VertexAttrib1fvImmediate& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2140,22 +2140,22 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib1fvImmediate( const GLfloat* values = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib1fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib2f( +error::Error GLES2DecoderImpl::HandleVertexAttrib2f( uint32 immediate_data_size, const gles2::VertexAttrib2f& c) { GLuint indx = static_cast<GLuint>(c.indx); GLfloat x = static_cast<GLfloat>(c.x); GLfloat y = static_cast<GLfloat>(c.y); glVertexAttrib2f(indx, x, y); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib2fv( +error::Error GLES2DecoderImpl::HandleVertexAttrib2fv( uint32 immediate_data_size, const gles2::VertexAttrib2fv& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2163,13 +2163,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib2fv( const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( c.values_shm_id, c.values_shm_offset, data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib2fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib2fvImmediate( +error::Error GLES2DecoderImpl::HandleVertexAttrib2fvImmediate( uint32 immediate_data_size, const gles2::VertexAttrib2fvImmediate& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2177,23 +2177,23 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib2fvImmediate( const GLfloat* values = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib2fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib3f( +error::Error GLES2DecoderImpl::HandleVertexAttrib3f( uint32 immediate_data_size, const gles2::VertexAttrib3f& c) { GLuint indx = static_cast<GLuint>(c.indx); GLfloat x = static_cast<GLfloat>(c.x); GLfloat y = static_cast<GLfloat>(c.y); GLfloat z = static_cast<GLfloat>(c.z); glVertexAttrib3f(indx, x, y, z); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib3fv( +error::Error GLES2DecoderImpl::HandleVertexAttrib3fv( uint32 immediate_data_size, const gles2::VertexAttrib3fv& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2201,13 +2201,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib3fv( const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( c.values_shm_id, c.values_shm_offset, data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib3fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib3fvImmediate( +error::Error GLES2DecoderImpl::HandleVertexAttrib3fvImmediate( uint32 immediate_data_size, const gles2::VertexAttrib3fvImmediate& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2215,13 +2215,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib3fvImmediate( const GLfloat* values = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib3fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib4f( +error::Error GLES2DecoderImpl::HandleVertexAttrib4f( uint32 immediate_data_size, const gles2::VertexAttrib4f& c) { GLuint indx = static_cast<GLuint>(c.indx); GLfloat x = static_cast<GLfloat>(c.x); @@ -2229,10 +2229,10 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib4f( GLfloat z = static_cast<GLfloat>(c.z); GLfloat w = static_cast<GLfloat>(c.w); glVertexAttrib4f(indx, x, y, z, w); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib4fv( +error::Error GLES2DecoderImpl::HandleVertexAttrib4fv( uint32 immediate_data_size, const gles2::VertexAttrib4fv& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2240,13 +2240,13 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib4fv( const GLfloat* values = GetSharedMemoryAs<const GLfloat*>( c.values_shm_id, c.values_shm_offset, data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib4fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib4fvImmediate( +error::Error GLES2DecoderImpl::HandleVertexAttrib4fvImmediate( uint32 immediate_data_size, const gles2::VertexAttrib4fvImmediate& c) { GLuint indx = static_cast<GLuint>(c.indx); uint32 data_size = @@ -2254,26 +2254,26 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttrib4fvImmediate( const GLfloat* values = GetImmediateDataAs<const GLfloat*>( c, data_size, immediate_data_size); if (values == NULL) { - return parse_error::kParseOutOfBounds; + return error::kOutOfBounds; } glVertexAttrib4fv(indx, values); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleViewport( +error::Error GLES2DecoderImpl::HandleViewport( uint32 immediate_data_size, const gles2::Viewport& c) { GLint x = static_cast<GLint>(c.x); GLint y = static_cast<GLint>(c.y); GLsizei width = static_cast<GLsizei>(c.width); GLsizei height = static_cast<GLsizei>(c.height); glViewport(x, y, width, height); - return parse_error::kParseNoError; + return error::kNoError; } -parse_error::ParseError GLES2DecoderImpl::HandleSwapBuffers( +error::Error GLES2DecoderImpl::HandleSwapBuffers( uint32 immediate_data_size, const gles2::SwapBuffers& c) { DoSwapBuffers(); - return parse_error::kParseNoError; + return error::kNoError; } #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index ccedc95..dba1043 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -26,9 +26,9 @@ class MockGLES2Decoder : public GLES2Decoder { MOCK_METHOD0(Destroy, void()); MOCK_METHOD0(MakeCurrent, bool()); MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); - MOCK_METHOD3(DoCommand, parse_error::ParseError(unsigned int command, - unsigned int arg_count, - const void* cmd_data)); + MOCK_METHOD3(DoCommand, error::Error(unsigned int command, + unsigned int arg_count, + const void* cmd_data)); MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc index 2aace97f..185c99f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc @@ -62,7 +62,7 @@ class GLES2DecoderTest : public testing::Test { int8 buffer[sizeof(T) + sizeof(client_id)]; T& cmd = *reinterpret_cast<T*>(&buffer); cmd.Init(1, &client_id); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_id))); } @@ -131,7 +131,7 @@ class GLES2DecoderTest : public testing::Test { .RetiresOnSaturation(); CreateProgram cmd; cmd.Init(client_program_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } { @@ -141,7 +141,7 @@ class GLES2DecoderTest : public testing::Test { .RetiresOnSaturation(); CreateShader cmd; cmd.Init(GL_VERTEX_SHADER, client_shader_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -161,7 +161,7 @@ class GLES2DecoderTest : public testing::Test { } template <typename T> - parse_error::ParseError ExecuteCmd(const T& cmd) { + error::Error ExecuteCmd(const T& cmd) { COMPILE_ASSERT(T::kArgFlags == cmd::kFixed, Cmd_kArgFlags_not_kFixed); return decoder_->DoCommand(cmd.kCmdId, ComputeNumEntries(sizeof(cmd)) - 1, @@ -169,7 +169,7 @@ class GLES2DecoderTest : public testing::Test { } template <typename T> - parse_error::ParseError ExecuteImmediateCmd(const T& cmd, size_t data_size) { + error::Error ExecuteImmediateCmd(const T& cmd, size_t data_size) { COMPILE_ASSERT(T::kArgFlags == cmd::kAtLeastN, Cmd_kArgFlags_not_kAtLeastN); return decoder_->DoCommand(cmd.kCmdId, ComputeNumEntries(sizeof(cmd) + data_size) - 1, @@ -191,7 +191,7 @@ class GLES2DecoderTest : public testing::Test { .RetiresOnSaturation(); GetError cmd; cmd.Init(shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); return *GetSharedMemoryAs<GLenum*>(); } @@ -339,7 +339,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { } } - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } { @@ -348,7 +348,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { .RetiresOnSaturation(); UseProgram cmd; cmd.Init(client_program_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } } @@ -366,7 +366,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { .RetiresOnSaturation(); EnableVertexAttribArray cmd; cmd.Init(index); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void DoBindBuffer(GLenum target, GLuint client_id, GLuint service_id) { @@ -375,7 +375,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { .RetiresOnSaturation(); BindBuffer cmd; cmd.Init(target, client_id); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void DoBufferData(GLenum target, GLsizei size) { @@ -384,7 +384,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { .RetiresOnSaturation(); BufferData cmd; cmd.Init(target, size, 0, 0, GL_STREAM_DRAW); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void DoBufferSubData( @@ -396,7 +396,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { memcpy(shared_memory_address_, data, size); BufferSubData cmd; cmd.Init(target, offset, size, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void DoDeleteBuffer(GLuint client_id, GLuint service_id) { @@ -406,7 +406,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { DeleteBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); memcpy(shared_memory_address_, &client_id, sizeof(client_id)); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void DoDeleteProgram(GLuint client_id, GLuint service_id) { @@ -415,7 +415,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { .RetiresOnSaturation(); DeleteProgram cmd; cmd.Init(client_id); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void DoVertexAttribPointer( @@ -427,7 +427,7 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderTest { .RetiresOnSaturation(); VertexAttribPointer cmd; cmd.Init(index, size, GL_FLOAT, GL_FALSE, stride, offset); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } void SetupVertexBuffer() { @@ -466,7 +466,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysNoAttributesSucceeds) { .RetiresOnSaturation(); DrawArrays cmd; cmd.Init(GL_TRIANGLES, 0, kNumVertices); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -477,7 +477,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysMissingAttributesFails) { .Times(0); DrawArrays cmd; cmd.Init(GL_TRIANGLES, 0, kNumVertices); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -490,7 +490,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysValidAttributesSucceeds) { .RetiresOnSaturation(); DrawArrays cmd; cmd.Init(GL_TRIANGLES, 0, kNumVertices); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -503,7 +503,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysDeletedBufferFails) { .Times(0); DrawArrays cmd; cmd.Init(GL_TRIANGLES, 0, kNumVertices); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -516,7 +516,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysDeletedProgramFails) { .Times(0); DrawArrays cmd; cmd.Init(GL_TRIANGLES, 0, kNumVertices); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -528,10 +528,10 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysWithInvalidModeFails) { .Times(0); DrawArrays cmd; cmd.Init(GL_QUADS, 0, 1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); cmd.Init(GL_POLYGON, 0, 1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); } @@ -543,33 +543,33 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysInvalidCountFails) { EXPECT_CALL(*gl_, DrawArrays(_, _, _)).Times(0); DrawArrays cmd; cmd.Init(GL_TRIANGLES, 1, kNumVertices); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); // Try with count > size cmd.Init(GL_TRIANGLES, 0, kNumVertices + 1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); // Try with attrib offset > 0 cmd.Init(GL_TRIANGLES, 0, kNumVertices); DoVertexAttribPointer(1, 2, GL_FLOAT, 0, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); // Try with size > 2 (ie, vec3 instead of vec2) DoVertexAttribPointer(1, 3, GL_FLOAT, 0, 0); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); // Try with stride > 8 (vec2 + vec2 byte) GLfloat f; DoVertexAttribPointer(1, 2, GL_FLOAT, sizeof(f) * 2 + 1, 0); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -584,7 +584,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsNoAttributesSucceeds) { DrawElements cmd; cmd.Init(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -597,7 +597,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsMissingAttributesFails) { DrawElements cmd; cmd.Init(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -614,7 +614,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsValidAttributesSucceeds) { DrawElements cmd; cmd.Init(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -629,7 +629,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsDeletedBufferFails) { DrawElements cmd; cmd.Init(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -644,7 +644,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsDeleteProgramFails) { DrawElements cmd; cmd.Init(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); } @@ -658,11 +658,11 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsWithInvalidModeFails) { DrawElements cmd; cmd.Init(GL_QUADS, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); cmd.Init(GL_POLYGON, kValidIndexRangeCount, GL_UNSIGNED_SHORT, kValidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); } @@ -675,13 +675,13 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsInvalidCountFails) { EXPECT_CALL(*gl_, DrawElements(_, _, _, _)).Times(0); DrawElements cmd; cmd.Init(GL_TRIANGLES, kNumIndices, GL_UNSIGNED_SHORT, 1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); // Try with count > size cmd.Init(GL_TRIANGLES, kNumIndices + 1, GL_UNSIGNED_SHORT, 0); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -696,7 +696,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsOutOfRangeIndicesFails) { DrawElements cmd; cmd.Init(GL_TRIANGLES, kInvalidIndexRangeCount, GL_UNSIGNED_SHORT, kInvalidIndexRangeStart); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } @@ -711,7 +711,7 @@ TEST_F(GLES2DecoderWithShaderTest, GetVertexAttribPointervSucceeds) { GetVertexAttribPointerv cmd; cmd.Init(kIndexToTest, GL_VERTEX_ATTRIB_ARRAY_POINTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(sizeof(*result_value), result_->size); EXPECT_EQ(0u, *result_value); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -719,7 +719,7 @@ TEST_F(GLES2DecoderWithShaderTest, GetVertexAttribPointervSucceeds) { // Set the value and see that we get it. SetupVertexBuffer(); DoVertexAttribPointer(kIndexToTest, 2, GL_FLOAT, 0, kOffsetToTestFor); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(sizeof(*result_value), result_->size); EXPECT_EQ(kOffsetToTestFor, *result_value); EXPECT_EQ(GL_NO_ERROR, GetGLError()); @@ -732,7 +732,7 @@ TEST_F(GLES2DecoderWithShaderTest, GetVertexAttribPointervBadArgsFails) { GetVertexAttribPointerv cmd; cmd.Init(kIndexToTest, GL_VERTEX_ATTRIB_ARRAY_POINTER + 1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(0u, result_->size); EXPECT_EQ(kInitialResult, *result_value); EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); @@ -740,7 +740,7 @@ TEST_F(GLES2DecoderWithShaderTest, GetVertexAttribPointervBadArgsFails) { // Test index out of range fails. cmd.Init(kNumVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_POINTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(0u, result_->size); EXPECT_EQ(kInitialResult, *result_value); EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); @@ -748,12 +748,12 @@ TEST_F(GLES2DecoderWithShaderTest, GetVertexAttribPointervBadArgsFails) { // Test memory id bad fails. cmd.Init(kIndexToTest, GL_VERTEX_ATTRIB_ARRAY_POINTER, kInvalidSharedMemoryId, shared_memory_offset_); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); // Test memory offset bad fails. cmd.Init(kIndexToTest, GL_VERTEX_ATTRIB_ARRAY_POINTER, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_autogen.h index 7adb61c..1675153 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_autogen.h @@ -14,7 +14,7 @@ TEST_F(GLES2DecoderTest, ActiveTextureValidArgs) { SpecializedSetup<ActiveTexture, 0>(); ActiveTexture cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, AttachShaderValidArgs) { @@ -22,7 +22,7 @@ TEST_F(GLES2DecoderTest, AttachShaderValidArgs) { SpecializedSetup<AttachShader, 0>(); AttachShader cmd; cmd.Init(client_program_id_, client_shader_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): BindAttribLocation @@ -34,7 +34,7 @@ TEST_F(GLES2DecoderTest, BindBufferValidArgs) { SpecializedSetup<BindBuffer, 0>(); BindBuffer cmd; cmd.Init(GL_ARRAY_BUFFER, client_buffer_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BindBufferInvalidArgs0_0) { @@ -42,7 +42,7 @@ TEST_F(GLES2DecoderTest, BindBufferInvalidArgs0_0) { SpecializedSetup<BindBuffer, 0>(); BindBuffer cmd; cmd.Init(GL_RENDERBUFFER, client_buffer_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BindFramebufferValidArgs) { @@ -50,7 +50,7 @@ TEST_F(GLES2DecoderTest, BindFramebufferValidArgs) { SpecializedSetup<BindFramebuffer, 0>(); BindFramebuffer cmd; cmd.Init(GL_FRAMEBUFFER, client_framebuffer_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BindRenderbufferValidArgs) { @@ -59,7 +59,7 @@ TEST_F(GLES2DecoderTest, BindRenderbufferValidArgs) { SpecializedSetup<BindRenderbuffer, 0>(); BindRenderbuffer cmd; cmd.Init(GL_RENDERBUFFER, client_renderbuffer_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BindTextureValidArgs) { @@ -67,7 +67,7 @@ TEST_F(GLES2DecoderTest, BindTextureValidArgs) { SpecializedSetup<BindTexture, 0>(); BindTexture cmd; cmd.Init(GL_TEXTURE_2D, client_texture_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BindTextureInvalidArgs0_0) { @@ -75,7 +75,7 @@ TEST_F(GLES2DecoderTest, BindTextureInvalidArgs0_0) { SpecializedSetup<BindTexture, 0>(); BindTexture cmd; cmd.Init(GL_TEXTURE_1D, client_texture_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BindTextureInvalidArgs0_1) { @@ -83,7 +83,7 @@ TEST_F(GLES2DecoderTest, BindTextureInvalidArgs0_1) { SpecializedSetup<BindTexture, 0>(); BindTexture cmd; cmd.Init(GL_TEXTURE_3D, client_texture_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendColorValidArgs) { @@ -91,7 +91,7 @@ TEST_F(GLES2DecoderTest, BlendColorValidArgs) { SpecializedSetup<BlendColor, 0>(); BlendColor cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationValidArgs) { @@ -99,7 +99,7 @@ TEST_F(GLES2DecoderTest, BlendEquationValidArgs) { SpecializedSetup<BlendEquation, 0>(); BlendEquation cmd; cmd.Init(GL_FUNC_ADD); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationInvalidArgs0_0) { @@ -107,7 +107,7 @@ TEST_F(GLES2DecoderTest, BlendEquationInvalidArgs0_0) { SpecializedSetup<BlendEquation, 0>(); BlendEquation cmd; cmd.Init(GL_MIN); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationInvalidArgs0_1) { @@ -115,7 +115,7 @@ TEST_F(GLES2DecoderTest, BlendEquationInvalidArgs0_1) { SpecializedSetup<BlendEquation, 0>(); BlendEquation cmd; cmd.Init(GL_MAX); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationSeparateValidArgs) { @@ -123,7 +123,7 @@ TEST_F(GLES2DecoderTest, BlendEquationSeparateValidArgs) { SpecializedSetup<BlendEquationSeparate, 0>(); BlendEquationSeparate cmd; cmd.Init(GL_FUNC_ADD, GL_FUNC_ADD); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs0_0) { @@ -131,7 +131,7 @@ TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs0_0) { SpecializedSetup<BlendEquationSeparate, 0>(); BlendEquationSeparate cmd; cmd.Init(GL_MIN, GL_FUNC_ADD); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs0_1) { @@ -139,7 +139,7 @@ TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs0_1) { SpecializedSetup<BlendEquationSeparate, 0>(); BlendEquationSeparate cmd; cmd.Init(GL_MAX, GL_FUNC_ADD); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs1_0) { @@ -147,7 +147,7 @@ TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs1_0) { SpecializedSetup<BlendEquationSeparate, 0>(); BlendEquationSeparate cmd; cmd.Init(GL_FUNC_ADD, GL_MIN); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs1_1) { @@ -155,7 +155,7 @@ TEST_F(GLES2DecoderTest, BlendEquationSeparateInvalidArgs1_1) { SpecializedSetup<BlendEquationSeparate, 0>(); BlendEquationSeparate cmd; cmd.Init(GL_FUNC_ADD, GL_MAX); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendFuncValidArgs) { @@ -163,7 +163,7 @@ TEST_F(GLES2DecoderTest, BlendFuncValidArgs) { SpecializedSetup<BlendFunc, 0>(); BlendFunc cmd; cmd.Init(GL_ZERO, GL_ZERO); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, BlendFuncSeparateValidArgs) { @@ -171,7 +171,7 @@ TEST_F(GLES2DecoderTest, BlendFuncSeparateValidArgs) { SpecializedSetup<BlendFuncSeparate, 0>(); BlendFuncSeparate cmd; cmd.Init(GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): BufferData @@ -187,7 +187,7 @@ TEST_F(GLES2DecoderTest, CheckFramebufferStatusValidArgs) { SpecializedSetup<CheckFramebufferStatus, 0>(); CheckFramebufferStatus cmd; cmd.Init(GL_FRAMEBUFFER); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, ClearValidArgs) { @@ -195,7 +195,7 @@ TEST_F(GLES2DecoderTest, ClearValidArgs) { SpecializedSetup<Clear, 0>(); Clear cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, ClearColorValidArgs) { @@ -203,7 +203,7 @@ TEST_F(GLES2DecoderTest, ClearColorValidArgs) { SpecializedSetup<ClearColor, 0>(); ClearColor cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, ClearDepthfValidArgs) { @@ -211,7 +211,7 @@ TEST_F(GLES2DecoderTest, ClearDepthfValidArgs) { SpecializedSetup<ClearDepthf, 0>(); ClearDepthf cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, ClearStencilValidArgs) { @@ -219,7 +219,7 @@ TEST_F(GLES2DecoderTest, ClearStencilValidArgs) { SpecializedSetup<ClearStencil, 0>(); ClearStencil cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, ColorMaskValidArgs) { @@ -227,7 +227,7 @@ TEST_F(GLES2DecoderTest, ColorMaskValidArgs) { SpecializedSetup<ColorMask, 0>(); ColorMask cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, CompileShaderValidArgs) { @@ -235,7 +235,7 @@ TEST_F(GLES2DecoderTest, CompileShaderValidArgs) { SpecializedSetup<CompileShader, 0>(); CompileShader cmd; cmd.Init(client_shader_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): CompressedTexImage2D @@ -251,7 +251,7 @@ TEST_F(GLES2DecoderTest, CopyTexImage2DValidArgs) { SpecializedSetup<CopyTexImage2D, 0>(); CopyTexImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, CopyTexImage2DInvalidArgs0_0) { @@ -259,7 +259,7 @@ TEST_F(GLES2DecoderTest, CopyTexImage2DInvalidArgs0_0) { SpecializedSetup<CopyTexImage2D, 0>(); CopyTexImage2D cmd; cmd.Init(GL_PROXY_TEXTURE_CUBE_MAP, 2, 3, 4, 5, 6, 7, 8); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, CopyTexSubImage2DValidArgs) { @@ -267,7 +267,7 @@ TEST_F(GLES2DecoderTest, CopyTexSubImage2DValidArgs) { SpecializedSetup<CopyTexSubImage2D, 0>(); CopyTexSubImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, CopyTexSubImage2DInvalidArgs0_0) { @@ -275,7 +275,7 @@ TEST_F(GLES2DecoderTest, CopyTexSubImage2DInvalidArgs0_0) { SpecializedSetup<CopyTexSubImage2D, 0>(); CopyTexSubImage2D cmd; cmd.Init(GL_PROXY_TEXTURE_CUBE_MAP, 2, 3, 4, 5, 6, 7, 8); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, CreateProgramValidArgs) { @@ -284,7 +284,7 @@ TEST_F(GLES2DecoderTest, CreateProgramValidArgs) { SpecializedSetup<CreateProgram, 0>(); CreateProgram cmd; cmd.Init(kNewClientId); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -294,7 +294,7 @@ TEST_F(GLES2DecoderTest, CreateShaderValidArgs) { SpecializedSetup<CreateShader, 0>(); CreateShader cmd; cmd.Init(GL_VERTEX_SHADER, kNewClientId); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -303,7 +303,7 @@ TEST_F(GLES2DecoderTest, CullFaceValidArgs) { SpecializedSetup<CullFace, 0>(); CullFace cmd; cmd.Init(GL_FRONT); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DeleteBuffersValidArgs) { @@ -315,7 +315,7 @@ TEST_F(GLES2DecoderTest, DeleteBuffersValidArgs) { SpecializedSetup<DeleteBuffers, 0>(); DeleteBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -326,7 +326,7 @@ TEST_F(GLES2DecoderTest, DeleteBuffersInvalidArgs) { SpecializedSetup<DeleteBuffers, 0>(); DeleteBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DeleteBuffersImmediateValidArgs) { @@ -337,7 +337,7 @@ TEST_F(GLES2DecoderTest, DeleteBuffersImmediateValidArgs) { DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); SpecializedSetup<DeleteBuffersImmediate, 0>(); cmd.Init(1, &client_buffer_id_); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_buffer_id_))); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -349,7 +349,7 @@ TEST_F(GLES2DecoderTest, DeleteBuffersImmediateInvalidArgs) { SpecializedSetup<DeleteBuffersImmediate, 0>(); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -362,7 +362,7 @@ TEST_F(GLES2DecoderTest, DeleteFramebuffersValidArgs) { SpecializedSetup<DeleteFramebuffers, 0>(); DeleteFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -373,7 +373,7 @@ TEST_F(GLES2DecoderTest, DeleteFramebuffersInvalidArgs) { SpecializedSetup<DeleteFramebuffers, 0>(); DeleteFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DeleteFramebuffersImmediateValidArgs) { @@ -385,7 +385,7 @@ TEST_F(GLES2DecoderTest, DeleteFramebuffersImmediateValidArgs) { *GetImmediateAs<DeleteFramebuffersImmediate>(); SpecializedSetup<DeleteFramebuffersImmediate, 0>(); cmd.Init(1, &client_framebuffer_id_); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_framebuffer_id_))); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -398,7 +398,7 @@ TEST_F(GLES2DecoderTest, DeleteFramebuffersImmediateInvalidArgs) { SpecializedSetup<DeleteFramebuffersImmediate, 0>(); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } // TODO(gman): DeleteProgram @@ -413,7 +413,7 @@ TEST_F(GLES2DecoderTest, DeleteRenderbuffersValidArgs) { SpecializedSetup<DeleteRenderbuffers, 0>(); DeleteRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -424,7 +424,7 @@ TEST_F(GLES2DecoderTest, DeleteRenderbuffersInvalidArgs) { SpecializedSetup<DeleteRenderbuffers, 0>(); DeleteRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DeleteRenderbuffersImmediateValidArgs) { @@ -436,7 +436,7 @@ TEST_F(GLES2DecoderTest, DeleteRenderbuffersImmediateValidArgs) { *GetImmediateAs<DeleteRenderbuffersImmediate>(); SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); cmd.Init(1, &client_renderbuffer_id_); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_renderbuffer_id_))); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -449,7 +449,7 @@ TEST_F(GLES2DecoderTest, DeleteRenderbuffersImmediateInvalidArgs) { SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } // TODO(gman): DeleteShader @@ -464,7 +464,7 @@ TEST_F(GLES2DecoderTest, DeleteTexturesValidArgs) { SpecializedSetup<DeleteTextures, 0>(); DeleteTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -475,7 +475,7 @@ TEST_F(GLES2DecoderTest, DeleteTexturesInvalidArgs) { SpecializedSetup<DeleteTextures, 0>(); DeleteTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DeleteTexturesImmediateValidArgs) { @@ -486,7 +486,7 @@ TEST_F(GLES2DecoderTest, DeleteTexturesImmediateValidArgs) { DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); SpecializedSetup<DeleteTexturesImmediate, 0>(); cmd.Init(1, &client_texture_id_); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_texture_id_))); EXPECT_EQ(GetServiceId(kNewClientId), 0u); } @@ -498,7 +498,7 @@ TEST_F(GLES2DecoderTest, DeleteTexturesImmediateInvalidArgs) { SpecializedSetup<DeleteTexturesImmediate, 0>(); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -507,7 +507,7 @@ TEST_F(GLES2DecoderTest, DepthFuncValidArgs) { SpecializedSetup<DepthFunc, 0>(); DepthFunc cmd; cmd.Init(GL_NEVER); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DepthMaskValidArgs) { @@ -515,7 +515,7 @@ TEST_F(GLES2DecoderTest, DepthMaskValidArgs) { SpecializedSetup<DepthMask, 0>(); DepthMask cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DepthRangefValidArgs) { @@ -523,7 +523,7 @@ TEST_F(GLES2DecoderTest, DepthRangefValidArgs) { SpecializedSetup<DepthRangef, 0>(); DepthRangef cmd; cmd.Init(1, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DetachShaderValidArgs) { @@ -531,7 +531,7 @@ TEST_F(GLES2DecoderTest, DetachShaderValidArgs) { SpecializedSetup<DetachShader, 0>(); DetachShader cmd; cmd.Init(client_program_id_, client_shader_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DisableValidArgs) { @@ -539,7 +539,7 @@ TEST_F(GLES2DecoderTest, DisableValidArgs) { SpecializedSetup<Disable, 0>(); Disable cmd; cmd.Init(GL_BLEND); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DisableInvalidArgs0_0) { @@ -547,7 +547,7 @@ TEST_F(GLES2DecoderTest, DisableInvalidArgs0_0) { SpecializedSetup<Disable, 0>(); Disable cmd; cmd.Init(GL_CLIP_PLANE0); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DisableInvalidArgs0_1) { @@ -555,7 +555,7 @@ TEST_F(GLES2DecoderTest, DisableInvalidArgs0_1) { SpecializedSetup<Disable, 0>(); Disable cmd; cmd.Init(GL_POINT_SPRITE); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, DisableVertexAttribArrayValidArgs) { @@ -563,7 +563,7 @@ TEST_F(GLES2DecoderTest, DisableVertexAttribArrayValidArgs) { SpecializedSetup<DisableVertexAttribArray, 0>(); DisableVertexAttribArray cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): DrawArrays // TODO(gman): DrawElements @@ -574,7 +574,7 @@ TEST_F(GLES2DecoderTest, EnableValidArgs) { SpecializedSetup<Enable, 0>(); Enable cmd; cmd.Init(GL_BLEND); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, EnableInvalidArgs0_0) { @@ -582,7 +582,7 @@ TEST_F(GLES2DecoderTest, EnableInvalidArgs0_0) { SpecializedSetup<Enable, 0>(); Enable cmd; cmd.Init(GL_CLIP_PLANE0); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, EnableInvalidArgs0_1) { @@ -590,7 +590,7 @@ TEST_F(GLES2DecoderTest, EnableInvalidArgs0_1) { SpecializedSetup<Enable, 0>(); Enable cmd; cmd.Init(GL_POINT_SPRITE); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, EnableVertexAttribArrayValidArgs) { @@ -598,7 +598,7 @@ TEST_F(GLES2DecoderTest, EnableVertexAttribArrayValidArgs) { SpecializedSetup<EnableVertexAttribArray, 0>(); EnableVertexAttribArray cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, FinishValidArgs) { @@ -606,7 +606,7 @@ TEST_F(GLES2DecoderTest, FinishValidArgs) { SpecializedSetup<Finish, 0>(); Finish cmd; cmd.Init(); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, FlushValidArgs) { @@ -614,7 +614,7 @@ TEST_F(GLES2DecoderTest, FlushValidArgs) { SpecializedSetup<Flush, 0>(); Flush cmd; cmd.Init(); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, FramebufferRenderbufferValidArgs) { @@ -627,7 +627,7 @@ TEST_F(GLES2DecoderTest, FramebufferRenderbufferValidArgs) { cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, client_renderbuffer_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, FramebufferTexture2DValidArgs) { @@ -640,7 +640,7 @@ TEST_F(GLES2DecoderTest, FramebufferTexture2DValidArgs) { cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, 5); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, FramebufferTexture2DInvalidArgs2_0) { @@ -650,7 +650,7 @@ TEST_F(GLES2DecoderTest, FramebufferTexture2DInvalidArgs2_0) { cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_PROXY_TEXTURE_CUBE_MAP, client_texture_id_, 5); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, FrontFaceValidArgs) { @@ -658,7 +658,7 @@ TEST_F(GLES2DecoderTest, FrontFaceValidArgs) { SpecializedSetup<FrontFace, 0>(); FrontFace cmd; cmd.Init(GL_CW); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenBuffersValidArgs) { @@ -668,7 +668,7 @@ TEST_F(GLES2DecoderTest, GenBuffersValidArgs) { SpecializedSetup<GenBuffers, 0>(); GenBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -678,7 +678,7 @@ TEST_F(GLES2DecoderTest, GenBuffersInvalidArgs) { SpecializedSetup<GenBuffers, 0>(); GenBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); + EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenBuffersImmediateValidArgs) { @@ -688,7 +688,7 @@ TEST_F(GLES2DecoderTest, GenBuffersImmediateValidArgs) { GLuint temp = kNewClientId; SpecializedSetup<GenBuffersImmediate, 0>(); cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -698,7 +698,7 @@ TEST_F(GLES2DecoderTest, GenBuffersImmediateInvalidArgs) { GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); SpecializedSetup<GenBuffersImmediate, 0>(); cmd.Init(1, &client_buffer_id_); - EXPECT_EQ(parse_error::kParseInvalidArguments, + EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_buffer_id_))); } @@ -707,7 +707,7 @@ TEST_F(GLES2DecoderTest, GenerateMipmapValidArgs) { SpecializedSetup<GenerateMipmap, 0>(); GenerateMipmap cmd; cmd.Init(GL_TEXTURE_2D); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenerateMipmapInvalidArgs0_0) { @@ -715,7 +715,7 @@ TEST_F(GLES2DecoderTest, GenerateMipmapInvalidArgs0_0) { SpecializedSetup<GenerateMipmap, 0>(); GenerateMipmap cmd; cmd.Init(GL_TEXTURE_1D); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenerateMipmapInvalidArgs0_1) { @@ -723,7 +723,7 @@ TEST_F(GLES2DecoderTest, GenerateMipmapInvalidArgs0_1) { SpecializedSetup<GenerateMipmap, 0>(); GenerateMipmap cmd; cmd.Init(GL_TEXTURE_3D); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenFramebuffersValidArgs) { @@ -733,7 +733,7 @@ TEST_F(GLES2DecoderTest, GenFramebuffersValidArgs) { SpecializedSetup<GenFramebuffers, 0>(); GenFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -743,7 +743,7 @@ TEST_F(GLES2DecoderTest, GenFramebuffersInvalidArgs) { SpecializedSetup<GenFramebuffers, 0>(); GenFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); + EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenFramebuffersImmediateValidArgs) { @@ -753,7 +753,7 @@ TEST_F(GLES2DecoderTest, GenFramebuffersImmediateValidArgs) { GLuint temp = kNewClientId; SpecializedSetup<GenFramebuffersImmediate, 0>(); cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -763,7 +763,7 @@ TEST_F(GLES2DecoderTest, GenFramebuffersImmediateInvalidArgs) { GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); SpecializedSetup<GenFramebuffersImmediate, 0>(); cmd.Init(1, &client_framebuffer_id_); - EXPECT_EQ(parse_error::kParseInvalidArguments, + EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_framebuffer_id_))); } @@ -774,7 +774,7 @@ TEST_F(GLES2DecoderTest, GenRenderbuffersValidArgs) { SpecializedSetup<GenRenderbuffers, 0>(); GenRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -784,7 +784,7 @@ TEST_F(GLES2DecoderTest, GenRenderbuffersInvalidArgs) { SpecializedSetup<GenRenderbuffers, 0>(); GenRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); + EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenRenderbuffersImmediateValidArgs) { @@ -795,7 +795,7 @@ TEST_F(GLES2DecoderTest, GenRenderbuffersImmediateValidArgs) { GLuint temp = kNewClientId; SpecializedSetup<GenRenderbuffersImmediate, 0>(); cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -806,7 +806,7 @@ TEST_F(GLES2DecoderTest, GenRenderbuffersImmediateInvalidArgs) { *GetImmediateAs<GenRenderbuffersImmediate>(); SpecializedSetup<GenRenderbuffersImmediate, 0>(); cmd.Init(1, &client_renderbuffer_id_); - EXPECT_EQ(parse_error::kParseInvalidArguments, + EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_renderbuffer_id_))); } @@ -817,7 +817,7 @@ TEST_F(GLES2DecoderTest, GenTexturesValidArgs) { SpecializedSetup<GenTextures, 0>(); GenTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -827,7 +827,7 @@ TEST_F(GLES2DecoderTest, GenTexturesInvalidArgs) { SpecializedSetup<GenTextures, 0>(); GenTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseInvalidArguments, ExecuteCmd(cmd)); + EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GenTexturesImmediateValidArgs) { @@ -837,7 +837,7 @@ TEST_F(GLES2DecoderTest, GenTexturesImmediateValidArgs) { GLuint temp = kNewClientId; SpecializedSetup<GenTexturesImmediate, 0>(); cmd.Init(1, &temp); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); EXPECT_EQ(GetServiceId(kNewClientId), kNewServiceId); } @@ -847,7 +847,7 @@ TEST_F(GLES2DecoderTest, GenTexturesImmediateInvalidArgs) { GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); SpecializedSetup<GenTexturesImmediate, 0>(); cmd.Init(1, &client_texture_id_); - EXPECT_EQ(parse_error::kParseInvalidArguments, + EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_texture_id_))); } // TODO(gman): GetActiveAttrib @@ -868,7 +868,7 @@ TEST_F(GLES2DecoderTest, GetBooleanvValidArgs) { SpecializedSetup<GetBooleanv, 0>(); GetBooleanv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBooleanvInvalidArgs1_0) { @@ -876,7 +876,7 @@ TEST_F(GLES2DecoderTest, GetBooleanvInvalidArgs1_0) { SpecializedSetup<GetBooleanv, 0>(); GetBooleanv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBooleanvInvalidArgs1_1) { @@ -884,7 +884,7 @@ TEST_F(GLES2DecoderTest, GetBooleanvInvalidArgs1_1) { SpecializedSetup<GetBooleanv, 0>(); GetBooleanv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBufferParameterivValidArgs) { @@ -897,7 +897,7 @@ TEST_F(GLES2DecoderTest, GetBufferParameterivValidArgs) { cmd.Init( GL_ARRAY_BUFFER, GL_BUFFER_SIZE, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs0_0) { @@ -907,7 +907,7 @@ TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs0_0) { cmd.Init( GL_RENDERBUFFER, GL_BUFFER_SIZE, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs1_0) { @@ -917,7 +917,7 @@ TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs1_0) { cmd.Init( GL_ARRAY_BUFFER, GL_PIXEL_PACK_BUFFER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs2_0) { @@ -925,7 +925,7 @@ TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs2_0) { SpecializedSetup<GetBufferParameteriv, 0>(); GetBufferParameteriv cmd; cmd.Init(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs2_1) { @@ -935,7 +935,7 @@ TEST_F(GLES2DecoderTest, GetBufferParameterivInvalidArgs2_1) { cmd.Init( GL_ARRAY_BUFFER, GL_BUFFER_SIZE, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetErrorValidArgs) { @@ -943,7 +943,7 @@ TEST_F(GLES2DecoderTest, GetErrorValidArgs) { SpecializedSetup<GetError, 0>(); GetError cmd; cmd.Init(shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetFloatvValidArgs) { @@ -952,7 +952,7 @@ TEST_F(GLES2DecoderTest, GetFloatvValidArgs) { SpecializedSetup<GetFloatv, 0>(); GetFloatv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetFloatvInvalidArgs1_0) { @@ -960,7 +960,7 @@ TEST_F(GLES2DecoderTest, GetFloatvInvalidArgs1_0) { SpecializedSetup<GetFloatv, 0>(); GetFloatv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetFloatvInvalidArgs1_1) { @@ -968,7 +968,7 @@ TEST_F(GLES2DecoderTest, GetFloatvInvalidArgs1_1) { SpecializedSetup<GetFloatv, 0>(); GetFloatv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivValidArgs) { @@ -983,7 +983,7 @@ TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivValidArgs) { GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivInvalidArgs3_0) { @@ -994,7 +994,7 @@ TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivInvalidArgs3_0) { cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivInvalidArgs3_1) { @@ -1006,7 +1006,7 @@ TEST_F(GLES2DecoderTest, GetFramebufferAttachmentParameterivInvalidArgs3_1) { GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetIntegervValidArgs) { @@ -1015,7 +1015,7 @@ TEST_F(GLES2DecoderTest, GetIntegervValidArgs) { SpecializedSetup<GetIntegerv, 0>(); GetIntegerv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetIntegervInvalidArgs1_0) { @@ -1023,7 +1023,7 @@ TEST_F(GLES2DecoderTest, GetIntegervInvalidArgs1_0) { SpecializedSetup<GetIntegerv, 0>(); GetIntegerv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetIntegervInvalidArgs1_1) { @@ -1031,7 +1031,7 @@ TEST_F(GLES2DecoderTest, GetIntegervInvalidArgs1_1) { SpecializedSetup<GetIntegerv, 0>(); GetIntegerv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetProgramivValidArgs) { @@ -1044,7 +1044,7 @@ TEST_F(GLES2DecoderTest, GetProgramivValidArgs) { cmd.Init( client_program_id_, GL_DELETE_STATUS, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetProgramivInvalidArgs2_0) { @@ -1052,7 +1052,7 @@ TEST_F(GLES2DecoderTest, GetProgramivInvalidArgs2_0) { SpecializedSetup<GetProgramiv, 0>(); GetProgramiv cmd; cmd.Init(client_program_id_, GL_DELETE_STATUS, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetProgramivInvalidArgs2_1) { @@ -1062,7 +1062,7 @@ TEST_F(GLES2DecoderTest, GetProgramivInvalidArgs2_1) { cmd.Init( client_program_id_, GL_DELETE_STATUS, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } // TODO(gman): GetProgramInfoLog @@ -1077,7 +1077,7 @@ TEST_F(GLES2DecoderTest, GetRenderbufferParameterivValidArgs) { cmd.Init( GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetRenderbufferParameterivInvalidArgs2_0) { @@ -1085,7 +1085,7 @@ TEST_F(GLES2DecoderTest, GetRenderbufferParameterivInvalidArgs2_0) { SpecializedSetup<GetRenderbufferParameteriv, 0>(); GetRenderbufferParameteriv cmd; cmd.Init(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetRenderbufferParameterivInvalidArgs2_1) { @@ -1095,7 +1095,7 @@ TEST_F(GLES2DecoderTest, GetRenderbufferParameterivInvalidArgs2_1) { cmd.Init( GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetShaderivValidArgs) { @@ -1108,7 +1108,7 @@ TEST_F(GLES2DecoderTest, GetShaderivValidArgs) { cmd.Init( client_shader_id_, GL_SHADER_TYPE, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetShaderivInvalidArgs2_0) { @@ -1116,7 +1116,7 @@ TEST_F(GLES2DecoderTest, GetShaderivInvalidArgs2_0) { SpecializedSetup<GetShaderiv, 0>(); GetShaderiv cmd; cmd.Init(client_shader_id_, GL_SHADER_TYPE, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetShaderivInvalidArgs2_1) { @@ -1126,7 +1126,7 @@ TEST_F(GLES2DecoderTest, GetShaderivInvalidArgs2_1) { cmd.Init( client_shader_id_, GL_SHADER_TYPE, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } // TODO(gman): GetShaderInfoLog @@ -1140,7 +1140,7 @@ TEST_F(GLES2DecoderTest, GetStringValidArgs) { SpecializedSetup<GetString, 0>(); GetString cmd; cmd.Init(GL_VENDOR); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterfvValidArgs) { @@ -1153,7 +1153,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterfvValidArgs) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs0_0) { @@ -1163,7 +1163,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs0_0) { cmd.Init( GL_PROXY_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs1_0) { @@ -1173,7 +1173,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs1_0) { cmd.Init( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs2_0) { @@ -1181,7 +1181,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs2_0) { SpecializedSetup<GetTexParameterfv, 0>(); GetTexParameterfv cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs2_1) { @@ -1191,7 +1191,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterfvInvalidArgs2_1) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterivValidArgs) { @@ -1204,7 +1204,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterivValidArgs) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs0_0) { @@ -1214,7 +1214,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs0_0) { cmd.Init( GL_PROXY_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs1_0) { @@ -1224,7 +1224,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs1_0) { cmd.Init( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs2_0) { @@ -1232,7 +1232,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs2_0) { SpecializedSetup<GetTexParameteriv, 0>(); GetTexParameteriv cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs2_1) { @@ -1242,7 +1242,7 @@ TEST_F(GLES2DecoderTest, GetTexParameterivInvalidArgs2_1) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } // TODO(gman): GetUniformfv @@ -1263,7 +1263,7 @@ TEST_F(GLES2DecoderTest, GetVertexAttribfvValidArgs) { cmd.Init( 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetVertexAttribfvInvalidArgs2_0) { @@ -1272,7 +1272,7 @@ TEST_F(GLES2DecoderTest, GetVertexAttribfvInvalidArgs2_0) { GetVertexAttribfv cmd; cmd.Init( 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetVertexAttribfvInvalidArgs2_1) { @@ -1282,7 +1282,7 @@ TEST_F(GLES2DecoderTest, GetVertexAttribfvInvalidArgs2_1) { cmd.Init( 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetVertexAttribivValidArgs) { @@ -1295,7 +1295,7 @@ TEST_F(GLES2DecoderTest, GetVertexAttribivValidArgs) { cmd.Init( 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetVertexAttribivInvalidArgs2_0) { @@ -1304,7 +1304,7 @@ TEST_F(GLES2DecoderTest, GetVertexAttribivInvalidArgs2_0) { GetVertexAttribiv cmd; cmd.Init( 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, GetVertexAttribivInvalidArgs2_1) { @@ -1314,7 +1314,7 @@ TEST_F(GLES2DecoderTest, GetVertexAttribivInvalidArgs2_1) { cmd.Init( 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } // TODO(gman): GetVertexAttribPointerv @@ -1324,7 +1324,7 @@ TEST_F(GLES2DecoderTest, HintValidArgs) { SpecializedSetup<Hint, 0>(); Hint cmd; cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, HintInvalidArgs0_0) { @@ -1332,7 +1332,7 @@ TEST_F(GLES2DecoderTest, HintInvalidArgs0_0) { SpecializedSetup<Hint, 0>(); Hint cmd; cmd.Init(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsBufferValidArgs) { @@ -1340,7 +1340,7 @@ TEST_F(GLES2DecoderTest, IsBufferValidArgs) { SpecializedSetup<IsBuffer, 0>(); IsBuffer cmd; cmd.Init(client_buffer_id_, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsEnabledValidArgs) { @@ -1348,7 +1348,7 @@ TEST_F(GLES2DecoderTest, IsEnabledValidArgs) { SpecializedSetup<IsEnabled, 0>(); IsEnabled cmd; cmd.Init(GL_BLEND, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsEnabledInvalidArgs0_0) { @@ -1356,7 +1356,7 @@ TEST_F(GLES2DecoderTest, IsEnabledInvalidArgs0_0) { SpecializedSetup<IsEnabled, 0>(); IsEnabled cmd; cmd.Init(GL_CLIP_PLANE0, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsEnabledInvalidArgs0_1) { @@ -1364,7 +1364,7 @@ TEST_F(GLES2DecoderTest, IsEnabledInvalidArgs0_1) { SpecializedSetup<IsEnabled, 0>(); IsEnabled cmd; cmd.Init(GL_POINT_SPRITE, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsFramebufferValidArgs) { @@ -1372,7 +1372,7 @@ TEST_F(GLES2DecoderTest, IsFramebufferValidArgs) { SpecializedSetup<IsFramebuffer, 0>(); IsFramebuffer cmd; cmd.Init(client_framebuffer_id_, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsProgramValidArgs) { @@ -1380,7 +1380,7 @@ TEST_F(GLES2DecoderTest, IsProgramValidArgs) { SpecializedSetup<IsProgram, 0>(); IsProgram cmd; cmd.Init(client_program_id_, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsRenderbufferValidArgs) { @@ -1388,7 +1388,7 @@ TEST_F(GLES2DecoderTest, IsRenderbufferValidArgs) { SpecializedSetup<IsRenderbuffer, 0>(); IsRenderbuffer cmd; cmd.Init(client_renderbuffer_id_, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsShaderValidArgs) { @@ -1396,7 +1396,7 @@ TEST_F(GLES2DecoderTest, IsShaderValidArgs) { SpecializedSetup<IsShader, 0>(); IsShader cmd; cmd.Init(client_shader_id_, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, IsTextureValidArgs) { @@ -1404,7 +1404,7 @@ TEST_F(GLES2DecoderTest, IsTextureValidArgs) { SpecializedSetup<IsTexture, 0>(); IsTexture cmd; cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, LineWidthValidArgs) { @@ -1412,7 +1412,7 @@ TEST_F(GLES2DecoderTest, LineWidthValidArgs) { SpecializedSetup<LineWidth, 0>(); LineWidth cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, LinkProgramValidArgs) { @@ -1420,7 +1420,7 @@ TEST_F(GLES2DecoderTest, LinkProgramValidArgs) { SpecializedSetup<LinkProgram, 0>(); LinkProgram cmd; cmd.Init(client_program_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): PixelStorei @@ -1430,7 +1430,7 @@ TEST_F(GLES2DecoderTest, PolygonOffsetValidArgs) { SpecializedSetup<PolygonOffset, 0>(); PolygonOffset cmd; cmd.Init(1, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): ReadPixels @@ -1440,7 +1440,7 @@ TEST_F(GLES2DecoderTest, RenderbufferStorageValidArgs) { SpecializedSetup<RenderbufferStorage, 0>(); RenderbufferStorage cmd; cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, SampleCoverageValidArgs) { @@ -1448,7 +1448,7 @@ TEST_F(GLES2DecoderTest, SampleCoverageValidArgs) { SpecializedSetup<SampleCoverage, 0>(); SampleCoverage cmd; cmd.Init(1, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, ScissorValidArgs) { @@ -1456,7 +1456,7 @@ TEST_F(GLES2DecoderTest, ScissorValidArgs) { SpecializedSetup<Scissor, 0>(); Scissor cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): ShaderSource @@ -1468,7 +1468,7 @@ TEST_F(GLES2DecoderTest, StencilFuncValidArgs) { SpecializedSetup<StencilFunc, 0>(); StencilFunc cmd; cmd.Init(GL_NEVER, 2, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, StencilFuncSeparateValidArgs) { @@ -1476,7 +1476,7 @@ TEST_F(GLES2DecoderTest, StencilFuncSeparateValidArgs) { SpecializedSetup<StencilFuncSeparate, 0>(); StencilFuncSeparate cmd; cmd.Init(GL_FRONT, GL_NEVER, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, StencilMaskValidArgs) { @@ -1484,7 +1484,7 @@ TEST_F(GLES2DecoderTest, StencilMaskValidArgs) { SpecializedSetup<StencilMask, 0>(); StencilMask cmd; cmd.Init(1); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, StencilMaskSeparateValidArgs) { @@ -1492,7 +1492,7 @@ TEST_F(GLES2DecoderTest, StencilMaskSeparateValidArgs) { SpecializedSetup<StencilMaskSeparate, 0>(); StencilMaskSeparate cmd; cmd.Init(GL_FRONT, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, StencilOpValidArgs) { @@ -1500,7 +1500,7 @@ TEST_F(GLES2DecoderTest, StencilOpValidArgs) { SpecializedSetup<StencilOp, 0>(); StencilOp cmd; cmd.Init(GL_KEEP, GL_KEEP, GL_KEEP); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, StencilOpSeparateValidArgs) { @@ -1508,7 +1508,7 @@ TEST_F(GLES2DecoderTest, StencilOpSeparateValidArgs) { SpecializedSetup<StencilOpSeparate, 0>(); StencilOpSeparate cmd; cmd.Init(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): TexImage2D @@ -1520,7 +1520,7 @@ TEST_F(GLES2DecoderTest, TexParameterfValidArgs) { SpecializedSetup<TexParameterf, 0>(); TexParameterf cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs0_0) { @@ -1528,7 +1528,7 @@ TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs0_0) { SpecializedSetup<TexParameterf, 0>(); TexParameterf cmd; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs0_1) { @@ -1536,7 +1536,7 @@ TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs0_1) { SpecializedSetup<TexParameterf, 0>(); TexParameterf cmd; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs1_0) { @@ -1544,7 +1544,7 @@ TEST_F(GLES2DecoderTest, TexParameterfInvalidArgs1_0) { SpecializedSetup<TexParameterf, 0>(); TexParameterf cmd; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvValidArgs) { @@ -1557,7 +1557,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvValidArgs) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs0_0) { @@ -1567,7 +1567,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs0_0) { cmd.Init( GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs0_1) { @@ -1577,7 +1577,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs0_1) { cmd.Init( GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs1_0) { @@ -1587,7 +1587,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs1_0) { cmd.Init( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs2_0) { @@ -1595,7 +1595,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs2_0) { SpecializedSetup<TexParameterfv, 0>(); TexParameterfv cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs2_1) { @@ -1605,7 +1605,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvInvalidArgs2_1) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterfvImmediateValidArgs) { @@ -1617,7 +1617,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvImmediateValidArgs) { SpecializedSetup<TexParameterfvImmediate, 0>(); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1627,7 +1627,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvImmediateInvalidArgs0_0) { SpecializedSetup<TexParameterfvImmediate, 0>(); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1637,7 +1637,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvImmediateInvalidArgs0_1) { SpecializedSetup<TexParameterfvImmediate, 0>(); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1647,7 +1647,7 @@ TEST_F(GLES2DecoderTest, TexParameterfvImmediateInvalidArgs1_0) { SpecializedSetup<TexParameterfvImmediate, 0>(); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1656,7 +1656,7 @@ TEST_F(GLES2DecoderTest, TexParameteriValidArgs) { SpecializedSetup<TexParameteri, 0>(); TexParameteri cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs0_0) { @@ -1664,7 +1664,7 @@ TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs0_0) { SpecializedSetup<TexParameteri, 0>(); TexParameteri cmd; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs0_1) { @@ -1672,7 +1672,7 @@ TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs0_1) { SpecializedSetup<TexParameteri, 0>(); TexParameteri cmd; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs1_0) { @@ -1680,7 +1680,7 @@ TEST_F(GLES2DecoderTest, TexParameteriInvalidArgs1_0) { SpecializedSetup<TexParameteri, 0>(); TexParameteri cmd; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivValidArgs) { @@ -1693,7 +1693,7 @@ TEST_F(GLES2DecoderTest, TexParameterivValidArgs) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs0_0) { @@ -1703,7 +1703,7 @@ TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs0_0) { cmd.Init( GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs0_1) { @@ -1713,7 +1713,7 @@ TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs0_1) { cmd.Init( GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs1_0) { @@ -1723,7 +1723,7 @@ TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs1_0) { cmd.Init( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs2_0) { @@ -1731,7 +1731,7 @@ TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs2_0) { SpecializedSetup<TexParameteriv, 0>(); TexParameteriv cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs2_1) { @@ -1741,7 +1741,7 @@ TEST_F(GLES2DecoderTest, TexParameterivInvalidArgs2_1) { cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, TexParameterivImmediateValidArgs) { @@ -1753,7 +1753,7 @@ TEST_F(GLES2DecoderTest, TexParameterivImmediateValidArgs) { SpecializedSetup<TexParameterivImmediate, 0>(); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1763,7 +1763,7 @@ TEST_F(GLES2DecoderTest, TexParameterivImmediateInvalidArgs0_0) { SpecializedSetup<TexParameterivImmediate, 0>(); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1773,7 +1773,7 @@ TEST_F(GLES2DecoderTest, TexParameterivImmediateInvalidArgs0_1) { SpecializedSetup<TexParameterivImmediate, 0>(); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1783,7 +1783,7 @@ TEST_F(GLES2DecoderTest, TexParameterivImmediateInvalidArgs1_0) { SpecializedSetup<TexParameterivImmediate, 0>(); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } // TODO(gman): TexSubImage2D @@ -1796,7 +1796,7 @@ TEST_F(GLES2DecoderTest, Uniform1fValidArgs) { SpecializedSetup<Uniform1f, 0>(); Uniform1f cmd; cmd.Init(1, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1fvValidArgs) { @@ -1806,7 +1806,7 @@ TEST_F(GLES2DecoderTest, Uniform1fvValidArgs) { SpecializedSetup<Uniform1fv, 0>(); Uniform1fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1fvInvalidArgs2_0) { @@ -1814,7 +1814,7 @@ TEST_F(GLES2DecoderTest, Uniform1fvInvalidArgs2_0) { SpecializedSetup<Uniform1fv, 0>(); Uniform1fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1fvInvalidArgs2_1) { @@ -1822,7 +1822,7 @@ TEST_F(GLES2DecoderTest, Uniform1fvInvalidArgs2_1) { SpecializedSetup<Uniform1fv, 0>(); Uniform1fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1fvImmediateValidArgs) { @@ -1834,7 +1834,7 @@ TEST_F(GLES2DecoderTest, Uniform1fvImmediateValidArgs) { SpecializedSetup<Uniform1fvImmediate, 0>(); GLfloat temp[1 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1843,7 +1843,7 @@ TEST_F(GLES2DecoderTest, Uniform1iValidArgs) { SpecializedSetup<Uniform1i, 0>(); Uniform1i cmd; cmd.Init(1, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1ivValidArgs) { @@ -1853,7 +1853,7 @@ TEST_F(GLES2DecoderTest, Uniform1ivValidArgs) { SpecializedSetup<Uniform1iv, 0>(); Uniform1iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1ivInvalidArgs2_0) { @@ -1861,7 +1861,7 @@ TEST_F(GLES2DecoderTest, Uniform1ivInvalidArgs2_0) { SpecializedSetup<Uniform1iv, 0>(); Uniform1iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1ivInvalidArgs2_1) { @@ -1869,7 +1869,7 @@ TEST_F(GLES2DecoderTest, Uniform1ivInvalidArgs2_1) { SpecializedSetup<Uniform1iv, 0>(); Uniform1iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform1ivImmediateValidArgs) { @@ -1881,7 +1881,7 @@ TEST_F(GLES2DecoderTest, Uniform1ivImmediateValidArgs) { SpecializedSetup<Uniform1ivImmediate, 0>(); GLint temp[1 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1890,7 +1890,7 @@ TEST_F(GLES2DecoderTest, Uniform2fValidArgs) { SpecializedSetup<Uniform2f, 0>(); Uniform2f cmd; cmd.Init(1, 2, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2fvValidArgs) { @@ -1900,7 +1900,7 @@ TEST_F(GLES2DecoderTest, Uniform2fvValidArgs) { SpecializedSetup<Uniform2fv, 0>(); Uniform2fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2fvInvalidArgs2_0) { @@ -1908,7 +1908,7 @@ TEST_F(GLES2DecoderTest, Uniform2fvInvalidArgs2_0) { SpecializedSetup<Uniform2fv, 0>(); Uniform2fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2fvInvalidArgs2_1) { @@ -1916,7 +1916,7 @@ TEST_F(GLES2DecoderTest, Uniform2fvInvalidArgs2_1) { SpecializedSetup<Uniform2fv, 0>(); Uniform2fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2fvImmediateValidArgs) { @@ -1928,7 +1928,7 @@ TEST_F(GLES2DecoderTest, Uniform2fvImmediateValidArgs) { SpecializedSetup<Uniform2fvImmediate, 0>(); GLfloat temp[2 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1937,7 +1937,7 @@ TEST_F(GLES2DecoderTest, Uniform2iValidArgs) { SpecializedSetup<Uniform2i, 0>(); Uniform2i cmd; cmd.Init(1, 2, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2ivValidArgs) { @@ -1947,7 +1947,7 @@ TEST_F(GLES2DecoderTest, Uniform2ivValidArgs) { SpecializedSetup<Uniform2iv, 0>(); Uniform2iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2ivInvalidArgs2_0) { @@ -1955,7 +1955,7 @@ TEST_F(GLES2DecoderTest, Uniform2ivInvalidArgs2_0) { SpecializedSetup<Uniform2iv, 0>(); Uniform2iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2ivInvalidArgs2_1) { @@ -1963,7 +1963,7 @@ TEST_F(GLES2DecoderTest, Uniform2ivInvalidArgs2_1) { SpecializedSetup<Uniform2iv, 0>(); Uniform2iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform2ivImmediateValidArgs) { @@ -1975,7 +1975,7 @@ TEST_F(GLES2DecoderTest, Uniform2ivImmediateValidArgs) { SpecializedSetup<Uniform2ivImmediate, 0>(); GLint temp[2 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -1984,7 +1984,7 @@ TEST_F(GLES2DecoderTest, Uniform3fValidArgs) { SpecializedSetup<Uniform3f, 0>(); Uniform3f cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3fvValidArgs) { @@ -1994,7 +1994,7 @@ TEST_F(GLES2DecoderTest, Uniform3fvValidArgs) { SpecializedSetup<Uniform3fv, 0>(); Uniform3fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3fvInvalidArgs2_0) { @@ -2002,7 +2002,7 @@ TEST_F(GLES2DecoderTest, Uniform3fvInvalidArgs2_0) { SpecializedSetup<Uniform3fv, 0>(); Uniform3fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3fvInvalidArgs2_1) { @@ -2010,7 +2010,7 @@ TEST_F(GLES2DecoderTest, Uniform3fvInvalidArgs2_1) { SpecializedSetup<Uniform3fv, 0>(); Uniform3fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3fvImmediateValidArgs) { @@ -2022,7 +2022,7 @@ TEST_F(GLES2DecoderTest, Uniform3fvImmediateValidArgs) { SpecializedSetup<Uniform3fvImmediate, 0>(); GLfloat temp[3 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2031,7 +2031,7 @@ TEST_F(GLES2DecoderTest, Uniform3iValidArgs) { SpecializedSetup<Uniform3i, 0>(); Uniform3i cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3ivValidArgs) { @@ -2041,7 +2041,7 @@ TEST_F(GLES2DecoderTest, Uniform3ivValidArgs) { SpecializedSetup<Uniform3iv, 0>(); Uniform3iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3ivInvalidArgs2_0) { @@ -2049,7 +2049,7 @@ TEST_F(GLES2DecoderTest, Uniform3ivInvalidArgs2_0) { SpecializedSetup<Uniform3iv, 0>(); Uniform3iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3ivInvalidArgs2_1) { @@ -2057,7 +2057,7 @@ TEST_F(GLES2DecoderTest, Uniform3ivInvalidArgs2_1) { SpecializedSetup<Uniform3iv, 0>(); Uniform3iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform3ivImmediateValidArgs) { @@ -2069,7 +2069,7 @@ TEST_F(GLES2DecoderTest, Uniform3ivImmediateValidArgs) { SpecializedSetup<Uniform3ivImmediate, 0>(); GLint temp[3 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2078,7 +2078,7 @@ TEST_F(GLES2DecoderTest, Uniform4fValidArgs) { SpecializedSetup<Uniform4f, 0>(); Uniform4f cmd; cmd.Init(1, 2, 3, 4, 5); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4fvValidArgs) { @@ -2088,7 +2088,7 @@ TEST_F(GLES2DecoderTest, Uniform4fvValidArgs) { SpecializedSetup<Uniform4fv, 0>(); Uniform4fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4fvInvalidArgs2_0) { @@ -2096,7 +2096,7 @@ TEST_F(GLES2DecoderTest, Uniform4fvInvalidArgs2_0) { SpecializedSetup<Uniform4fv, 0>(); Uniform4fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4fvInvalidArgs2_1) { @@ -2104,7 +2104,7 @@ TEST_F(GLES2DecoderTest, Uniform4fvInvalidArgs2_1) { SpecializedSetup<Uniform4fv, 0>(); Uniform4fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4fvImmediateValidArgs) { @@ -2116,7 +2116,7 @@ TEST_F(GLES2DecoderTest, Uniform4fvImmediateValidArgs) { SpecializedSetup<Uniform4fvImmediate, 0>(); GLfloat temp[4 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2125,7 +2125,7 @@ TEST_F(GLES2DecoderTest, Uniform4iValidArgs) { SpecializedSetup<Uniform4i, 0>(); Uniform4i cmd; cmd.Init(1, 2, 3, 4, 5); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4ivValidArgs) { @@ -2135,7 +2135,7 @@ TEST_F(GLES2DecoderTest, Uniform4ivValidArgs) { SpecializedSetup<Uniform4iv, 0>(); Uniform4iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4ivInvalidArgs2_0) { @@ -2143,7 +2143,7 @@ TEST_F(GLES2DecoderTest, Uniform4ivInvalidArgs2_0) { SpecializedSetup<Uniform4iv, 0>(); Uniform4iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4ivInvalidArgs2_1) { @@ -2151,7 +2151,7 @@ TEST_F(GLES2DecoderTest, Uniform4ivInvalidArgs2_1) { SpecializedSetup<Uniform4iv, 0>(); Uniform4iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, Uniform4ivImmediateValidArgs) { @@ -2163,7 +2163,7 @@ TEST_F(GLES2DecoderTest, Uniform4ivImmediateValidArgs) { SpecializedSetup<Uniform4ivImmediate, 0>(); GLint temp[4 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2175,7 +2175,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix2fvValidArgs) { SpecializedSetup<UniformMatrix2fv, 0>(); UniformMatrix2fv cmd; cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs2_0) { @@ -2183,7 +2183,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs2_0) { SpecializedSetup<UniformMatrix2fv, 0>(); UniformMatrix2fv cmd; cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs3_0) { @@ -2191,7 +2191,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs3_0) { SpecializedSetup<UniformMatrix2fv, 0>(); UniformMatrix2fv cmd; cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs3_1) { @@ -2199,7 +2199,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix2fvInvalidArgs3_1) { SpecializedSetup<UniformMatrix2fv, 0>(); UniformMatrix2fv cmd; cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix2fvImmediateValidArgs) { @@ -2212,7 +2212,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix2fvImmediateValidArgs) { SpecializedSetup<UniformMatrix2fvImmediate, 0>(); GLfloat temp[4 * 2] = { 0, }; cmd.Init(1, 2, false, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2223,7 +2223,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix2fvImmediateInvalidArgs2_0) { SpecializedSetup<UniformMatrix2fvImmediate, 0>(); GLfloat temp[4 * 2] = { 0, }; cmd.Init(1, 2, true, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2235,7 +2235,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix3fvValidArgs) { SpecializedSetup<UniformMatrix3fv, 0>(); UniformMatrix3fv cmd; cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs2_0) { @@ -2243,7 +2243,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs2_0) { SpecializedSetup<UniformMatrix3fv, 0>(); UniformMatrix3fv cmd; cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs3_0) { @@ -2251,7 +2251,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs3_0) { SpecializedSetup<UniformMatrix3fv, 0>(); UniformMatrix3fv cmd; cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs3_1) { @@ -2259,7 +2259,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix3fvInvalidArgs3_1) { SpecializedSetup<UniformMatrix3fv, 0>(); UniformMatrix3fv cmd; cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix3fvImmediateValidArgs) { @@ -2272,7 +2272,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix3fvImmediateValidArgs) { SpecializedSetup<UniformMatrix3fvImmediate, 0>(); GLfloat temp[9 * 2] = { 0, }; cmd.Init(1, 2, false, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2283,7 +2283,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix3fvImmediateInvalidArgs2_0) { SpecializedSetup<UniformMatrix3fvImmediate, 0>(); GLfloat temp[9 * 2] = { 0, }; cmd.Init(1, 2, true, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2295,7 +2295,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix4fvValidArgs) { SpecializedSetup<UniformMatrix4fv, 0>(); UniformMatrix4fv cmd; cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs2_0) { @@ -2303,7 +2303,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs2_0) { SpecializedSetup<UniformMatrix4fv, 0>(); UniformMatrix4fv cmd; cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs3_0) { @@ -2311,7 +2311,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs3_0) { SpecializedSetup<UniformMatrix4fv, 0>(); UniformMatrix4fv cmd; cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs3_1) { @@ -2319,7 +2319,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix4fvInvalidArgs3_1) { SpecializedSetup<UniformMatrix4fv, 0>(); UniformMatrix4fv cmd; cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, UniformMatrix4fvImmediateValidArgs) { @@ -2332,7 +2332,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix4fvImmediateValidArgs) { SpecializedSetup<UniformMatrix4fvImmediate, 0>(); GLfloat temp[16 * 2] = { 0, }; cmd.Init(1, 2, false, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2343,7 +2343,7 @@ TEST_F(GLES2DecoderTest, UniformMatrix4fvImmediateInvalidArgs2_0) { SpecializedSetup<UniformMatrix4fvImmediate, 0>(); GLfloat temp[16 * 2] = { 0, }; cmd.Init(1, 2, true, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } // TODO(gman): UseProgram @@ -2353,7 +2353,7 @@ TEST_F(GLES2DecoderTest, ValidateProgramValidArgs) { SpecializedSetup<ValidateProgram, 0>(); ValidateProgram cmd; cmd.Init(client_program_id_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib1fValidArgs) { @@ -2361,7 +2361,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib1fValidArgs) { SpecializedSetup<VertexAttrib1f, 0>(); VertexAttrib1f cmd; cmd.Init(1, 2); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib1fvValidArgs) { @@ -2371,7 +2371,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib1fvValidArgs) { SpecializedSetup<VertexAttrib1fv, 0>(); VertexAttrib1fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib1fvInvalidArgs1_0) { @@ -2379,7 +2379,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib1fvInvalidArgs1_0) { SpecializedSetup<VertexAttrib1fv, 0>(); VertexAttrib1fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib1fvInvalidArgs1_1) { @@ -2387,7 +2387,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib1fvInvalidArgs1_1) { SpecializedSetup<VertexAttrib1fv, 0>(); VertexAttrib1fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib1fvImmediateValidArgs) { @@ -2399,7 +2399,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib1fvImmediateValidArgs) { SpecializedSetup<VertexAttrib1fvImmediate, 0>(); GLfloat temp[1] = { 0, }; cmd.Init(1, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2408,7 +2408,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib2fValidArgs) { SpecializedSetup<VertexAttrib2f, 0>(); VertexAttrib2f cmd; cmd.Init(1, 2, 3); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib2fvValidArgs) { @@ -2418,7 +2418,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib2fvValidArgs) { SpecializedSetup<VertexAttrib2fv, 0>(); VertexAttrib2fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib2fvInvalidArgs1_0) { @@ -2426,7 +2426,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib2fvInvalidArgs1_0) { SpecializedSetup<VertexAttrib2fv, 0>(); VertexAttrib2fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib2fvInvalidArgs1_1) { @@ -2434,7 +2434,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib2fvInvalidArgs1_1) { SpecializedSetup<VertexAttrib2fv, 0>(); VertexAttrib2fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib2fvImmediateValidArgs) { @@ -2446,7 +2446,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib2fvImmediateValidArgs) { SpecializedSetup<VertexAttrib2fvImmediate, 0>(); GLfloat temp[2] = { 0, }; cmd.Init(1, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2455,7 +2455,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib3fValidArgs) { SpecializedSetup<VertexAttrib3f, 0>(); VertexAttrib3f cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib3fvValidArgs) { @@ -2465,7 +2465,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib3fvValidArgs) { SpecializedSetup<VertexAttrib3fv, 0>(); VertexAttrib3fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib3fvInvalidArgs1_0) { @@ -2473,7 +2473,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib3fvInvalidArgs1_0) { SpecializedSetup<VertexAttrib3fv, 0>(); VertexAttrib3fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib3fvInvalidArgs1_1) { @@ -2481,7 +2481,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib3fvInvalidArgs1_1) { SpecializedSetup<VertexAttrib3fv, 0>(); VertexAttrib3fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib3fvImmediateValidArgs) { @@ -2493,7 +2493,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib3fvImmediateValidArgs) { SpecializedSetup<VertexAttrib3fvImmediate, 0>(); GLfloat temp[3] = { 0, }; cmd.Init(1, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } @@ -2502,7 +2502,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib4fValidArgs) { SpecializedSetup<VertexAttrib4f, 0>(); VertexAttrib4f cmd; cmd.Init(1, 2, 3, 4, 5); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib4fvValidArgs) { @@ -2512,7 +2512,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib4fvValidArgs) { SpecializedSetup<VertexAttrib4fv, 0>(); VertexAttrib4fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib4fvInvalidArgs1_0) { @@ -2520,7 +2520,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib4fvInvalidArgs1_0) { SpecializedSetup<VertexAttrib4fv, 0>(); VertexAttrib4fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib4fvInvalidArgs1_1) { @@ -2528,7 +2528,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib4fvInvalidArgs1_1) { SpecializedSetup<VertexAttrib4fv, 0>(); VertexAttrib4fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); - EXPECT_EQ(parse_error::kParseOutOfBounds, ExecuteCmd(cmd)); + EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); } TEST_F(GLES2DecoderTest, VertexAttrib4fvImmediateValidArgs) { @@ -2540,7 +2540,7 @@ TEST_F(GLES2DecoderTest, VertexAttrib4fvImmediateValidArgs) { SpecializedSetup<VertexAttrib4fvImmediate, 0>(); GLfloat temp[4] = { 0, }; cmd.Init(1, &temp[0]); - EXPECT_EQ(parse_error::kParseNoError, + EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); } // TODO(gman): VertexAttribPointer @@ -2551,7 +2551,7 @@ TEST_F(GLES2DecoderTest, ViewportValidArgs) { SpecializedSetup<Viewport, 0>(); Viewport cmd; cmd.Init(1, 2, 3, 4); - EXPECT_EQ(parse_error::kParseNoError, ExecuteCmd(cmd)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } // TODO(gman): SwapBuffers #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_validation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_autogen.h index 7520b58..c7047a6 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_autogen.h @@ -7,45 +7,45 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_AUTOGEN_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_AUTOGEN_H_ +bool ValidateGLenumAttachment(GLenum value); bool ValidateGLenumBufferParameter(GLenum value); -bool ValidateGLenumProgramParameter(GLenum value); +bool ValidateGLenumBufferTarget(GLenum value); +bool ValidateGLenumBufferUsage(GLenum value); +bool ValidateGLenumCapability(GLenum value); +bool ValidateGLenumCmpFunction(GLenum value); +bool ValidateGLenumDrawMode(GLenum value); +bool ValidateGLenumDstBlendFactor(GLenum value); +bool ValidateGLenumEquation(GLenum value); bool ValidateGLenumFaceMode(GLenum value); -bool ValidateGLenumShaderParameter(GLenum value); +bool ValidateGLenumFaceType(GLenum value); +bool ValidateGLbooleanFalse(GLenum value); +bool ValidateGLenumFrameBufferParameter(GLenum value); +bool ValidateGLenumFrameBufferTarget(GLenum value); +bool ValidateGLenumHintMode(GLenum value); +bool ValidateGLenumHintTarget(GLenum value); bool ValidateGLenumIndexType(GLenum value); -bool ValidateGLenumVertexAttribute(GLenum value); +bool ValidateGLenumPixelStore(GLenum value); +bool ValidateGLintPixelStoreAlignment(GLenum value); bool ValidateGLenumPixelType(GLenum value); -bool ValidateGLenumEquation(GLenum value); -bool ValidateGLenumRenderBufferTarget(GLenum value); -bool ValidateGLenumShaderPercision(GLenum value); +bool ValidateGLenumProgramParameter(GLenum value); bool ValidateGLenumReadPixelFormat(GLenum value); -bool ValidateGLenumTextureBindTarget(GLenum value); -bool ValidateGLenumCmpFunction(GLenum value); -bool ValidateGLenumCapability(GLenum value); -bool ValidateGLenumDstBlendFactor(GLenum value); -bool ValidateGLenumAttachment(GLenum value); bool ValidateGLenumRenderBufferFormat(GLenum value); -bool ValidateGLenumDrawMode(GLenum value); -bool ValidateGLenumBufferUsage(GLenum value); -bool ValidateGLenumHintTarget(GLenum value); -bool ValidateGLenumHintMode(GLenum value); -bool ValidateGLenumTextureFormat(GLenum value); +bool ValidateGLenumRenderBufferParameter(GLenum value); +bool ValidateGLenumRenderBufferTarget(GLenum value); +bool ValidateGLenumShaderParameter(GLenum value); +bool ValidateGLenumShaderPercision(GLenum value); +bool ValidateGLenumShaderType(GLenum value); +bool ValidateGLenumSrcBlendFactor(GLenum value); +bool ValidateGLenumStencilOp(GLenum value); bool ValidateGLenumStringType(GLenum value); +bool ValidateGLenumTextureBindTarget(GLenum value); bool ValidateGLintTextureBorder(GLenum value); -bool ValidateGLenumFrameBufferTarget(GLenum value); -bool ValidateGLbooleanFalse(GLenum value); -bool ValidateGLintPixelStoreAlignment(GLenum value); +bool ValidateGLenumTextureFormat(GLenum value); bool ValidateGLenumTextureParameter(GLenum value); bool ValidateGLenumTextureTarget(GLenum value); -bool ValidateGLenumShaderType(GLenum value); -bool ValidateGLenumFaceType(GLenum value); -bool ValidateGLenumSrcBlendFactor(GLenum value); -bool ValidateGLenumVertexAttribType(GLenum value); -bool ValidateGLenumStencilOp(GLenum value); bool ValidateGLintVertexAttribSize(GLenum value); -bool ValidateGLenumBufferTarget(GLenum value); -bool ValidateGLenumPixelStore(GLenum value); -bool ValidateGLenumRenderBufferParameter(GLenum value); -bool ValidateGLenumFrameBufferParameter(GLenum value); +bool ValidateGLenumVertexAttribType(GLenum value); +bool ValidateGLenumVertexAttribute(GLenum value); bool ValidateGLenumVertexPointer(GLenum value); #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_AUTOGEN_H_ diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h index 20a0f84..1513a43 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h @@ -7,278 +7,264 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_ -bool ValidateGLenumBufferParameter(GLenum value) { +bool ValidateGLenumAttachment(GLenum value) { switch (value) { - case GL_BUFFER_SIZE: - case GL_BUFFER_USAGE: + case GL_COLOR_ATTACHMENT0: + case GL_DEPTH_ATTACHMENT: + case GL_STENCIL_ATTACHMENT: return true; default: return false; } } -bool ValidateGLenumProgramParameter(GLenum value) { +bool ValidateGLenumBufferParameter(GLenum value) { switch (value) { - case GL_DELETE_STATUS: - case GL_LINK_STATUS: - case GL_VALIDATE_STATUS: - case GL_INFO_LOG_LENGTH: - case GL_ATTACHED_SHADERS: - case GL_ACTIVE_ATTRIBUTES: - case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: - case GL_ACTIVE_UNIFORMS: - case GL_ACTIVE_UNIFORM_MAX_LENGTH: + case GL_BUFFER_SIZE: + case GL_BUFFER_USAGE: return true; default: return false; } } -bool ValidateGLenumFaceMode(GLenum value) { +bool ValidateGLenumBufferTarget(GLenum value) { switch (value) { - case GL_CW: - case GL_CCW: + case GL_ARRAY_BUFFER: + case GL_ELEMENT_ARRAY_BUFFER: return true; default: return false; } } -bool ValidateGLenumShaderParameter(GLenum value) { +bool ValidateGLenumBufferUsage(GLenum value) { switch (value) { - case GL_SHADER_TYPE: - case GL_DELETE_STATUS: - case GL_COMPILE_STATUS: - case GL_INFO_LOG_LENGTH: - case GL_SHADER_SOURCE_LENGTH: + case GL_STREAM_DRAW: + case GL_STATIC_DRAW: + case GL_DYNAMIC_DRAW: return true; default: return false; } } -bool ValidateGLenumIndexType(GLenum value) { +bool ValidateGLenumCapability(GLenum value) { switch (value) { - case GL_UNSIGNED_BYTE: - case GL_UNSIGNED_SHORT: + case GL_BLEND: + case GL_CULL_FACE: + case GL_DEPTH_TEST: + case GL_DITHER: + case GL_POLYGON_OFFSET_FILL: + case GL_SAMPLE_ALPHA_TO_COVERAGE: + case GL_SAMPLE_COVERAGE: + case GL_SCISSOR_TEST: + case GL_STENCIL_TEST: return true; default: return false; } } -bool ValidateGLenumVertexAttribute(GLenum value) { +bool ValidateGLenumCmpFunction(GLenum value) { switch (value) { - case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: - case GL_VERTEX_ATTRIB_ARRAY_ENABLED: - case GL_VERTEX_ATTRIB_ARRAY_SIZE: - case GL_VERTEX_ATTRIB_ARRAY_STRIDE: - case GL_VERTEX_ATTRIB_ARRAY_TYPE: - case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: - case GL_CURRENT_VERTEX_ATTRIB: + case GL_NEVER: + case GL_LESS: + case GL_EQUAL: + case GL_LEQUAL: + case GL_GREATER: + case GL_NOTEQUAL: + case GL_GEQUAL: + case GL_ALWAYS: return true; default: return false; } } -bool ValidateGLenumPixelType(GLenum value) { +bool ValidateGLenumDrawMode(GLenum value) { switch (value) { - case GL_UNSIGNED_BYTE: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_POINTS: + case GL_LINE_STRIP: + case GL_LINE_LOOP: + case GL_LINES: + case GL_TRIANGLE_STRIP: + case GL_TRIANGLE_FAN: + case GL_TRIANGLES: return true; default: return false; } } -bool ValidateGLenumEquation(GLenum value) { +bool ValidateGLenumDstBlendFactor(GLenum value) { switch (value) { - case GL_FUNC_ADD: - case GL_FUNC_SUBTRACT: - case GL_FUNC_REVERSE_SUBTRACT: + case GL_ZERO: + case GL_ONE: + case GL_SRC_COLOR: + case GL_ONE_MINUS_SRC_COLOR: + case GL_DST_COLOR: + case GL_ONE_MINUS_DST_COLOR: + case GL_SRC_ALPHA: + case GL_ONE_MINUS_SRC_ALPHA: + case GL_DST_ALPHA: + case GL_ONE_MINUS_DST_ALPHA: + case GL_CONSTANT_COLOR: + case GL_ONE_MINUS_CONSTANT_COLOR: + case GL_CONSTANT_ALPHA: + case GL_ONE_MINUS_CONSTANT_ALPHA: return true; default: return false; } } -bool ValidateGLenumRenderBufferTarget(GLenum value) { +bool ValidateGLenumEquation(GLenum value) { switch (value) { - case GL_RENDERBUFFER: + case GL_FUNC_ADD: + case GL_FUNC_SUBTRACT: + case GL_FUNC_REVERSE_SUBTRACT: return true; default: return false; } } -bool ValidateGLenumShaderPercision(GLenum value) { +bool ValidateGLenumFaceMode(GLenum value) { switch (value) { - case GL_LOW_FLOAT: - case GL_MEDIUM_FLOAT: - case GL_HIGH_FLOAT: - case GL_LOW_INT: - case GL_MEDIUM_INT: - case GL_HIGH_INT: + case GL_CW: + case GL_CCW: return true; default: return false; } } -bool ValidateGLenumReadPixelFormat(GLenum value) { +bool ValidateGLenumFaceType(GLenum value) { switch (value) { - case GL_ALPHA: - case GL_RGB: - case GL_RGBA: + case GL_FRONT: + case GL_BACK: + case GL_FRONT_AND_BACK: return true; default: return false; } } -bool ValidateGLenumTextureBindTarget(GLenum value) { +bool ValidateGLbooleanFalse(GLenum value) { switch (value) { - case GL_TEXTURE_2D: - case GL_TEXTURE_CUBE_MAP: + case false: return true; default: return false; } } -bool ValidateGLenumCmpFunction(GLenum value) { +bool ValidateGLenumFrameBufferParameter(GLenum value) { switch (value) { - case GL_NEVER: - case GL_LESS: - case GL_EQUAL: - case GL_LEQUAL: - case GL_GREATER: - case GL_NOTEQUAL: - case GL_GEQUAL: - case GL_ALWAYS: + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: return true; default: return false; } } -bool ValidateGLenumCapability(GLenum value) { +bool ValidateGLenumFrameBufferTarget(GLenum value) { switch (value) { - case GL_BLEND: - case GL_CULL_FACE: - case GL_DEPTH_TEST: - case GL_DITHER: - case GL_POLYGON_OFFSET_FILL: - case GL_SAMPLE_ALPHA_TO_COVERAGE: - case GL_SAMPLE_COVERAGE: - case GL_SCISSOR_TEST: - case GL_STENCIL_TEST: + case GL_FRAMEBUFFER: return true; default: return false; } } -bool ValidateGLenumDstBlendFactor(GLenum value) { +bool ValidateGLenumHintMode(GLenum value) { switch (value) { - case GL_ZERO: - case GL_ONE: - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - case GL_DST_COLOR: - case GL_ONE_MINUS_DST_COLOR: - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - case GL_DST_ALPHA: - case GL_ONE_MINUS_DST_ALPHA: - case GL_CONSTANT_COLOR: - case GL_ONE_MINUS_CONSTANT_COLOR: - case GL_CONSTANT_ALPHA: - case GL_ONE_MINUS_CONSTANT_ALPHA: + case GL_FASTEST: + case GL_NICEST: + case GL_DONT_CARE: return true; default: return false; } } -bool ValidateGLenumAttachment(GLenum value) { +bool ValidateGLenumHintTarget(GLenum value) { switch (value) { - case GL_COLOR_ATTACHMENT0: - case GL_DEPTH_ATTACHMENT: - case GL_STENCIL_ATTACHMENT: + case GL_GENERATE_MIPMAP_HINT: return true; default: return false; } } -bool ValidateGLenumRenderBufferFormat(GLenum value) { +bool ValidateGLenumIndexType(GLenum value) { switch (value) { - case GL_RGBA4: - case GL_RGB565: - case GL_RGB5_A1: - case GL_DEPTH_COMPONENT16: - case GL_STENCIL_INDEX8: + case GL_UNSIGNED_BYTE: + case GL_UNSIGNED_SHORT: return true; default: return false; } } -bool ValidateGLenumDrawMode(GLenum value) { +bool ValidateGLenumPixelStore(GLenum value) { switch (value) { - case GL_POINTS: - case GL_LINE_STRIP: - case GL_LINE_LOOP: - case GL_LINES: - case GL_TRIANGLE_STRIP: - case GL_TRIANGLE_FAN: - case GL_TRIANGLES: + case GL_PACK_ALIGNMENT: + case GL_UNPACK_ALIGNMENT: return true; default: return false; } } -bool ValidateGLenumBufferUsage(GLenum value) { +bool ValidateGLintPixelStoreAlignment(GLenum value) { switch (value) { - case GL_STREAM_DRAW: - case GL_STATIC_DRAW: - case GL_DYNAMIC_DRAW: + case 1: + case 2: + case 4: + case 8: return true; default: return false; } } -bool ValidateGLenumHintTarget(GLenum value) { +bool ValidateGLenumPixelType(GLenum value) { switch (value) { - case GL_GENERATE_MIPMAP_HINT: + case GL_UNSIGNED_BYTE: + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_5_5_5_1: return true; default: return false; } } -bool ValidateGLenumHintMode(GLenum value) { +bool ValidateGLenumProgramParameter(GLenum value) { switch (value) { - case GL_FASTEST: - case GL_NICEST: - case GL_DONT_CARE: + case GL_DELETE_STATUS: + case GL_LINK_STATUS: + case GL_VALIDATE_STATUS: + case GL_INFO_LOG_LENGTH: + case GL_ATTACHED_SHADERS: + case GL_ACTIVE_ATTRIBUTES: + case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH: + case GL_ACTIVE_UNIFORMS: + case GL_ACTIVE_UNIFORM_MAX_LENGTH: return true; default: return false; } } -bool ValidateGLenumTextureFormat(GLenum value) { +bool ValidateGLenumReadPixelFormat(GLenum value) { switch (value) { case GL_ALPHA: - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: case GL_RGB: case GL_RGBA: return true; @@ -287,79 +273,66 @@ bool ValidateGLenumTextureFormat(GLenum value) { } } -bool ValidateGLenumStringType(GLenum value) { - switch (value) { - case GL_VENDOR: - case GL_RENDERER: - case GL_VERSION: - case GL_SHADING_LANGUAGE_VERSION: - case GL_EXTENSIONS: - return true; - default: - return false; - } -} - -bool ValidateGLintTextureBorder(GLenum value) { - switch (value) { - case 0: - return true; - default: - return false; - } -} - -bool ValidateGLenumFrameBufferTarget(GLenum value) { +bool ValidateGLenumRenderBufferFormat(GLenum value) { switch (value) { - case GL_FRAMEBUFFER: + case GL_RGBA4: + case GL_RGB565: + case GL_RGB5_A1: + case GL_DEPTH_COMPONENT16: + case GL_STENCIL_INDEX8: return true; default: return false; } } -bool ValidateGLbooleanFalse(GLenum value) { +bool ValidateGLenumRenderBufferParameter(GLenum value) { switch (value) { - case false: + case GL_RENDERBUFFER_WIDTH: + case GL_RENDERBUFFER_HEIGHT: + case GL_RENDERBUFFER_INTERNAL_FORMAT: + case GL_RENDERBUFFER_RED_SIZE: + case GL_RENDERBUFFER_GREEN_SIZE: + case GL_RENDERBUFFER_BLUE_SIZE: + case GL_RENDERBUFFER_ALPHA_SIZE: + case GL_RENDERBUFFER_DEPTH_SIZE: + case GL_RENDERBUFFER_STENCIL_SIZE: return true; default: return false; } } -bool ValidateGLintPixelStoreAlignment(GLenum value) { +bool ValidateGLenumRenderBufferTarget(GLenum value) { switch (value) { - case 1: - case 2: - case 4: - case 8: + case GL_RENDERBUFFER: return true; default: return false; } } -bool ValidateGLenumTextureParameter(GLenum value) { +bool ValidateGLenumShaderParameter(GLenum value) { switch (value) { - case GL_TEXTURE_MAG_FILTER: - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: + case GL_SHADER_TYPE: + case GL_DELETE_STATUS: + case GL_COMPILE_STATUS: + case GL_INFO_LOG_LENGTH: + case GL_SHADER_SOURCE_LENGTH: return true; default: return false; } } -bool ValidateGLenumTextureTarget(GLenum value) { +bool ValidateGLenumShaderPercision(GLenum value) { switch (value) { - case GL_TEXTURE_2D: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + case GL_LOW_FLOAT: + case GL_MEDIUM_FLOAT: + case GL_HIGH_FLOAT: + case GL_LOW_INT: + case GL_MEDIUM_INT: + case GL_HIGH_INT: return true; default: return false; @@ -376,17 +349,6 @@ bool ValidateGLenumShaderType(GLenum value) { } } -bool ValidateGLenumFaceType(GLenum value) { - switch (value) { - case GL_FRONT: - case GL_BACK: - case GL_FRONT_AND_BACK: - return true; - default: - return false; - } -} - bool ValidateGLenumSrcBlendFactor(GLenum value) { switch (value) { case GL_ZERO: @@ -410,19 +372,6 @@ bool ValidateGLenumSrcBlendFactor(GLenum value) { } } -bool ValidateGLenumVertexAttribType(GLenum value) { - switch (value) { - case GL_BYTE: - case GL_UNSIGNED_BYTE: - case GL_SHORT: - case GL_UNSIGNED_SHORT: - case GL_FLOAT: - return true; - default: - return false; - } -} - bool ValidateGLenumStencilOp(GLenum value) { switch (value) { case GL_KEEP: @@ -439,61 +388,112 @@ bool ValidateGLenumStencilOp(GLenum value) { } } -bool ValidateGLintVertexAttribSize(GLenum value) { +bool ValidateGLenumStringType(GLenum value) { switch (value) { - case 1: - case 2: - case 3: - case 4: + case GL_VENDOR: + case GL_RENDERER: + case GL_VERSION: + case GL_SHADING_LANGUAGE_VERSION: + case GL_EXTENSIONS: return true; default: return false; } } -bool ValidateGLenumBufferTarget(GLenum value) { +bool ValidateGLenumTextureBindTarget(GLenum value) { switch (value) { - case GL_ARRAY_BUFFER: - case GL_ELEMENT_ARRAY_BUFFER: + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: return true; default: return false; } } -bool ValidateGLenumPixelStore(GLenum value) { +bool ValidateGLintTextureBorder(GLenum value) { switch (value) { - case GL_PACK_ALIGNMENT: - case GL_UNPACK_ALIGNMENT: + case 0: return true; default: return false; } } -bool ValidateGLenumRenderBufferParameter(GLenum value) { +bool ValidateGLenumTextureFormat(GLenum value) { switch (value) { - case GL_RENDERBUFFER_WIDTH: - case GL_RENDERBUFFER_HEIGHT: - case GL_RENDERBUFFER_INTERNAL_FORMAT: - case GL_RENDERBUFFER_RED_SIZE: - case GL_RENDERBUFFER_GREEN_SIZE: - case GL_RENDERBUFFER_BLUE_SIZE: - case GL_RENDERBUFFER_ALPHA_SIZE: - case GL_RENDERBUFFER_DEPTH_SIZE: - case GL_RENDERBUFFER_STENCIL_SIZE: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_RGB: + case GL_RGBA: return true; default: return false; } } -bool ValidateGLenumFrameBufferParameter(GLenum value) { +bool ValidateGLenumTextureParameter(GLenum value) { switch (value) { - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: + case GL_TEXTURE_MAG_FILTER: + case GL_TEXTURE_MIN_FILTER: + case GL_TEXTURE_WRAP_S: + case GL_TEXTURE_WRAP_T: + return true; + default: + return false; + } +} + +bool ValidateGLenumTextureTarget(GLenum value) { + switch (value) { + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + return true; + default: + return false; + } +} + +bool ValidateGLintVertexAttribSize(GLenum value) { + switch (value) { + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +bool ValidateGLenumVertexAttribType(GLenum value) { + switch (value) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_FLOAT: + return true; + default: + return false; + } +} + +bool ValidateGLenumVertexAttribute(GLenum value) { + switch (value) { + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: + case GL_VERTEX_ATTRIB_ARRAY_ENABLED: + case GL_VERTEX_ATTRIB_ARRAY_SIZE: + case GL_VERTEX_ATTRIB_ARRAY_STRIDE: + case GL_VERTEX_ATTRIB_ARRAY_TYPE: + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + case GL_CURRENT_VERTEX_ATTRIB: return true; default: return false; diff --git a/gpu/command_buffer/service/gpu_processor.cc b/gpu/command_buffer/service/gpu_processor.cc index 30f07ef..c9b8c6f 100644 --- a/gpu/command_buffer/service/gpu_processor.cc +++ b/gpu/command_buffer/service/gpu_processor.cc @@ -33,7 +33,7 @@ GPUProcessor::~GPUProcessor() { void GPUProcessor::ProcessCommands() { CommandBuffer::State state = command_buffer_->GetState(); - if (state.error != parse_error::kParseNoError) + if (state.error != error::kNoError) return; if (decoder_.get()) { @@ -46,9 +46,9 @@ void GPUProcessor::ProcessCommands() { int commands_processed = 0; while (commands_processed < commands_per_update_ && !parser_->IsEmpty()) { - parse_error::ParseError parse_error = parser_->ProcessCommand(); - if (parse_error != parse_error::kParseNoError) { - command_buffer_->SetParseError(parse_error); + error::Error error = parser_->ProcessCommand(); + if (error != error::kNoError) { + command_buffer_->SetParseError(error); return; } ++commands_processed; diff --git a/gpu/command_buffer/service/gpu_processor_unittest.cc b/gpu/command_buffer/service/gpu_processor_unittest.cc index 4f97acc..428b726 100644 --- a/gpu/command_buffer/service/gpu_processor_unittest.cc +++ b/gpu/command_buffer/service/gpu_processor_unittest.cc @@ -68,7 +68,7 @@ class GPUProcessorTest : public testing::Test { MessageLoop::current()->RunAllPending(); } - parse_error::ParseError GetError() { + error::Error GetError() { return command_buffer_->GetState().error; } @@ -112,7 +112,7 @@ TEST_F(GPUProcessorTest, ProcessesOneCommand) { EXPECT_CALL(*command_buffer_, SetGetOffset(2)); EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0])) - .WillOnce(Return(parse_error::kParseNoError)); + .WillOnce(Return(error::kNoError)); EXPECT_CALL(*command_buffer_, SetParseError(_)) .Times(0); @@ -136,10 +136,10 @@ TEST_F(GPUProcessorTest, ProcessesTwoCommands) { EXPECT_CALL(*command_buffer_, SetGetOffset(3)); EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0])) - .WillOnce(Return(parse_error::kParseNoError)); + .WillOnce(Return(error::kNoError)); EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[2])) - .WillOnce(Return(parse_error::kParseNoError)); + .WillOnce(Return(error::kNoError)); processor_->ProcessCommands(); } @@ -175,10 +175,10 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) { .WillOnce(Return(state)); EXPECT_CALL(*async_api_, DoCommand(7, 1, &buffer_[0])) - .WillOnce(Return(parse_error::kParseNoError)); + .WillOnce(Return(error::kNoError)); EXPECT_CALL(*async_api_, DoCommand(8, 0, &buffer_[2])) - .WillOnce(Return(parse_error::kParseNoError)); + .WillOnce(Return(error::kNoError)); EXPECT_CALL(*command_buffer_, SetGetOffset(3)); @@ -191,7 +191,7 @@ TEST_F(GPUProcessorTest, PostsTaskToFinishRemainingCommands) { .WillOnce(Return(state)); EXPECT_CALL(*async_api_, DoCommand(9, 0, &buffer_[3])) - .WillOnce(Return(parse_error::kParseNoError)); + .WillOnce(Return(error::kNoError)); EXPECT_CALL(*command_buffer_, SetGetOffset(4)); @@ -211,17 +211,17 @@ TEST_F(GPUProcessorTest, SetsErrorCodeOnCommandBuffer) { EXPECT_CALL(*async_api_, DoCommand(7, 0, &buffer_[0])) .WillOnce(Return( - parse_error::kParseUnknownCommand)); + error::kUnknownCommand)); EXPECT_CALL(*command_buffer_, - SetParseError(parse_error::kParseUnknownCommand)); + SetParseError(error::kUnknownCommand)); processor_->ProcessCommands(); } TEST_F(GPUProcessorTest, ProcessCommandsDoesNothingAfterError) { CommandBuffer::State state; - state.error = parse_error::kParseGenericError; + state.error = error::kGenericError; EXPECT_CALL(*command_buffer_, GetState()) .WillOnce(Return(state)); diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h index c2b610a..a7eea11 100644 --- a/gpu/command_buffer/service/mocks.h +++ b/gpu/command_buffer/service/mocks.h @@ -22,8 +22,8 @@ namespace gpu { class AsyncAPIMock : public AsyncAPIInterface { public: AsyncAPIMock() { - testing::DefaultValue<parse_error::ParseError>::Set( - parse_error::kParseNoError); + testing::DefaultValue<error::Error>::Set( + error::kNoError); } // Predicate that matches args passed to DoCommand, by looking at the values. @@ -48,7 +48,7 @@ class AsyncAPIMock : public AsyncAPIInterface { CommandBufferEntry *args_; }; - MOCK_METHOD3(DoCommand, parse_error::ParseError( + MOCK_METHOD3(DoCommand, error::Error( unsigned int command, unsigned int arg_count, const void* cmd_data)); diff --git a/gpu/demos/framework/plugin.cc b/gpu/demos/framework/plugin.cc index dafcffe..153cd97 100644 --- a/gpu/demos/framework/plugin.cc +++ b/gpu/demos/framework/plugin.cc @@ -119,7 +119,7 @@ void Plugin::SetWindow(const NPWindow& window) { if (!pgl_context_) { // Initialize a 3D context. NPDeviceContext3DConfig config; - config.commandBufferEntries = kCommandBufferSize; + config.commandBufferSize = kCommandBufferSize; device3d_->initializeContext(npp_, &config, &context3d_); // Create a PGL context. diff --git a/gpu/pgl/command_buffer_pepper.cc b/gpu/pgl/command_buffer_pepper.cc index 8522bbe..0c77d1e 100644 --- a/gpu/pgl/command_buffer_pepper.cc +++ b/gpu/pgl/command_buffer_pepper.cc @@ -36,13 +36,13 @@ bool CommandBufferPepper::Initialize(int32 size) { Buffer CommandBufferPepper::GetRingBuffer() { Buffer buffer; buffer.ptr = context_->commandBuffer; - buffer.size = context_->commandBufferEntries * sizeof(int32); + buffer.size = context_->commandBufferSize * sizeof(int32); return buffer; } CommandBuffer::State CommandBufferPepper::GetState() { if (NPERR_NO_ERROR != device_->flushContext(npp_, context_, NULL, NULL)) - context_->error = gpu::parse_error::kParseGenericError; + context_->error = NPDeviceContext3DError_GenericError; return ConvertState(); } @@ -51,7 +51,7 @@ CommandBuffer::State CommandBufferPepper::Flush(int32 put_offset) { context_->putOffset = put_offset; if (NPERR_NO_ERROR != device_->flushContext(npp_, context_, NULL, NULL)) - context_->error = gpu::parse_error::kParseGenericError; + context_->error = NPDeviceContext3DError_GenericError; return ConvertState(); } @@ -90,18 +90,18 @@ void CommandBufferPepper::SetToken(int32 token) { } void CommandBufferPepper::SetParseError( - gpu::parse_error::ParseError parse_error) { + gpu::error::Error error) { // Not implemented by proxy. NOTREACHED(); } CommandBuffer::State CommandBufferPepper::ConvertState() { CommandBuffer::State state; - state.size = context_->commandBufferEntries; + state.size = context_->commandBufferSize; state.get_offset = context_->getOffset; state.put_offset = context_->putOffset; state.token = context_->token; - state.error = static_cast<gpu::parse_error::ParseError>( + state.error = static_cast<gpu::error::Error>( context_->error); return state; } diff --git a/gpu/pgl/command_buffer_pepper.h b/gpu/pgl/command_buffer_pepper.h index b3efaea..3719e39 100644 --- a/gpu/pgl/command_buffer_pepper.h +++ b/gpu/pgl/command_buffer_pepper.h @@ -35,7 +35,7 @@ class CommandBufferPepper : public gpu::CommandBuffer { virtual void DestroyTransferBuffer(int32 id); virtual gpu::Buffer GetTransferBuffer(int32 handle); virtual void SetToken(int32 token); - virtual void SetParseError(gpu::parse_error::ParseError parse_error); + virtual void SetParseError(gpu::error::Error error); private: CommandBuffer::State ConvertState(); diff --git a/third_party/npapi/bindings/npapi_extensions.h b/third_party/npapi/bindings/npapi_extensions.h index c60a82a..f566b40 100644 --- a/third_party/npapi/bindings/npapi_extensions.h +++ b/third_party/npapi/bindings/npapi_extensions.h @@ -268,16 +268,25 @@ typedef struct _NPDeviceContext2D #define NPPepper3DDevice 2 typedef struct _NPDeviceContext3DConfig { - int32 commandBufferEntries; + int32 commandBufferSize; } NPDeviceContext3DConfig; +typedef enum _NPDeviceContext3DError { + NPDeviceContext3DError_NoError, + NPDeviceContext3DError_InvalidSize, + NPDeviceContext3DError_OutOfBounds, + NPDeviceContext3DError_UnknownCommand, + NPDeviceContext3DError_InvalidArguments, + NPDeviceContext3DError_GenericError, +} NPDeviceContext3DError; + typedef struct _NPDeviceContext3D { void* reserved; // Buffer in which commands are stored. void* commandBuffer; - int32 commandBufferEntries; + int32 commandBufferSize; // Offset in command buffer reader has reached. Synchronized on flush. int32 getOffset; @@ -289,7 +298,7 @@ typedef struct _NPDeviceContext3D int32 token; // Error status. Synchronized on flush. - int32 error; + NPDeviceContext3DError error; } NPDeviceContext3D; /* Audio --------------------------------------------------------------------*/ diff --git a/webkit/tools/pepper_test_plugin/plugin_object.cc b/webkit/tools/pepper_test_plugin/plugin_object.cc index 7738a8cc..a2075ec 100644 --- a/webkit/tools/pepper_test_plugin/plugin_object.cc +++ b/webkit/tools/pepper_test_plugin/plugin_object.cc @@ -372,7 +372,7 @@ void PluginObject::SetWindow(const NPWindow& window) { if (!pgl_context_) { // Initialize a 3D context. NPDeviceContext3DConfig config; - config.commandBufferEntries = kCommandBufferSize; + config.commandBufferSize = kCommandBufferSize; device3d_->initializeContext(npp_, &config, &context3d_); // Create a PGL context. |