diff options
Diffstat (limited to 'gpu/command_buffer')
11 files changed, 992 insertions, 475 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index a211450..750dfdb 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -795,12 +795,14 @@ _ENUM_LISTS = { 'VertexAttribute': { 'type': 'GLenum', 'valid': [ + # some enum that the decoder actually passes through to GL needs + # to be the first listed here since it's used in unit tests. + 'GL_VERTEX_ATTRIB_ARRAY_NORMALIZED', 'GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING', 'GL_VERTEX_ATTRIB_ARRAY_ENABLED', 'GL_VERTEX_ATTRIB_ARRAY_SIZE', 'GL_VERTEX_ATTRIB_ARRAY_STRIDE', 'GL_VERTEX_ATTRIB_ARRAY_TYPE', - 'GL_VERTEX_ATTRIB_ARRAY_NORMALIZED', 'GL_CURRENT_VERTEX_ATTRIB', ], }, @@ -1261,11 +1263,15 @@ _FUNCTION_INFO = { 'type': 'GETn', 'result': ['SizedResult<GLfloat>'], 'impl_decl': False, + 'decoder_func': 'DoGetVertexAttribfv', + 'expectation': False, }, 'GetVertexAttribiv': { 'type': 'GETn', 'result': ['SizedResult<GLint>'], 'impl_decl': False, + 'decoder_func': 'DoGetVertexAttribiv', + 'expectation': False, }, 'GetVertexAttribPointerv': { 'type': 'Custom', @@ -1410,10 +1416,34 @@ _FUNCTION_INFO = { 'UniformMatrix4fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 16}, 'UseProgram': {'decoder_func': 'DoUseProgram', 'unit_test': False}, 'ValidateProgram': {'decoder_func': 'DoValidateProgram'}, - 'VertexAttrib1fv': {'type': 'PUT', 'data_type': 'GLfloat', 'count': 1}, - 'VertexAttrib2fv': {'type': 'PUT', 'data_type': 'GLfloat', 'count': 2}, - 'VertexAttrib3fv': {'type': 'PUT', 'data_type': 'GLfloat', 'count': 3}, - 'VertexAttrib4fv': {'type': 'PUT', 'data_type': 'GLfloat', 'count': 4}, + 'VertexAttrib1f': {'decoder_func': 'DoVertexAttrib1f'}, + 'VertexAttrib1fv': { + 'type': 'PUT', + 'data_type': 'GLfloat', + 'count': 1, + 'decoder_func': 'DoVertexAttrib1fv', + }, + 'VertexAttrib2f': {'decoder_func': 'DoVertexAttrib2f'}, + 'VertexAttrib2fv': { + 'type': 'PUT', + 'data_type': 'GLfloat', + 'count': 2, + 'decoder_func': 'DoVertexAttrib2fv', + }, + 'VertexAttrib3f': {'decoder_func': 'DoVertexAttrib3f'}, + 'VertexAttrib3fv': { + 'type': 'PUT', + 'data_type': 'GLfloat', + 'count': 3, + 'decoder_func': 'DoVertexAttrib3fv', + }, + 'VertexAttrib4f': {'decoder_func': 'DoVertexAttrib4f'}, + 'VertexAttrib4fv': { + 'type': 'PUT', + 'data_type': 'GLfloat', + 'count': 4, + 'decoder_func': 'DoVertexAttrib4fv', + }, 'VertexAttribPointer': { 'type': 'Manual', 'cmd_args': 'GLuint indx, GLint size, GLenum type, GLboolean normalized, ' @@ -1853,7 +1883,7 @@ COMPILE_ASSERT(offsetof(%(cmd_name)s::Result, %(field_name)s) == %(offset)d, valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1865,7 +1895,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s @@ -2275,7 +2305,7 @@ class BindHandler(TypeHandler): valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -2286,7 +2316,7 @@ TEST_F(%(test_name)s, %(name)sValidArgsNewId) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(first_gl_arg)s, kNewServiceId)); EXPECT_CALL(*gl_, %(gl_gen_func_name)s(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(first_arg)s, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -2306,7 +2336,7 @@ TEST_F(%(test_name)s, %(name)sValidArgsNewId) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s @@ -2407,7 +2437,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -2422,7 +2452,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { TEST_F(%(test_name)s, %(name)sInvalidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0); GetSharedMemoryAs<GLuint*>()[0] = client_%(resource_name)s_id_; - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); @@ -2440,7 +2470,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { .WillOnce(SetArgumentPointee<1>(kNewServiceId)); %(name)s& cmd = *GetImmediateAs<%(name)s>(); GLuint temp = kNewClientId; - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); @@ -2455,7 +2485,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { TEST_F(%(test_name)s, %(name)sInvalidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(_, _)).Times(0); %(name)s& cmd = *GetImmediateAs<%(name)s>(); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); cmd.Init(1, &client_%(resource_name)s_id_); EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_%(resource_name)s_id_))); @@ -2578,7 +2608,7 @@ class CreateHandler(TypeHandler): TEST_F(%(test_name)s, %(name)sValidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) .WillOnce(Return(kNewServiceId)); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s%(comma)skNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -2596,7 +2626,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s%(comma)skNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));%(gl_error_test)s @@ -2675,7 +2705,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId))) .Times(1); GetSharedMemoryAs<GLuint*>()[0] = client_%(resource_name)s_id_; - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -2692,7 +2722,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs) { GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -2709,7 +2739,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId))) .Times(1); %(name)s& cmd = *GetImmediateAs<%(name)s>(); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); cmd.Init(1, &client_%(resource_name)s_id_); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_%(resource_name)s_id_))); @@ -2726,7 +2756,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs) { %(name)s& cmd = *GetImmediateAs<%(name)s>(); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, @@ -2888,7 +2918,8 @@ class GETnHandler(TypeHandler): arg.WriteGetCode(file) code = """ typedef %(func_name)s::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); %(last_arg_type)s params = result ? result->GetData() : NULL; @@ -2950,7 +2981,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); typedef %(name)s::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL(*gl_, %(gl_func_name)s(%(local_gl_args)s)); @@ -2986,7 +3017,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s::Result* result = static_cast<%(name)s::Result*>(shared_memory_address_); result->size = 0; @@ -3014,7 +3045,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { *gl_, %(gl_func_name)s(%(gl_args)s, reinterpret_cast<%(data_type)s*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(data_type)s temp[%(data_count)s] = { 0, }; cmd.Init(%(gl_args)s, &temp[0]); EXPECT_EQ(error::kNoError, @@ -3041,7 +3072,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { %(name)s& cmd = *GetImmediateAs<%(name)s>(); EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(data_type)s temp[%(data_count)s] = { 0, }; cmd.Init(%(all_but_last_args)s, &temp[0]); EXPECT_EQ(error::%(parse_result)s, @@ -3193,7 +3224,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { *gl_, %(gl_func_name)s(%(gl_args)s, reinterpret_cast<%(data_type)s*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(data_type)s temp[%(data_count)s * 2] = { 0, }; cmd.Init(%(gl_args)s, &temp[0]); EXPECT_EQ(error::kNoError, @@ -3220,7 +3251,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { %(name)s& cmd = *GetImmediateAs<%(name)s>(); EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_any_args)s, _)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(data_type)s temp[%(data_count)s * 2] = { 0, }; cmd.Init(%(all_but_last_args)s, &temp[0]); EXPECT_EQ(error::%(parse_result)s, @@ -3386,7 +3417,7 @@ class PUTXnHandler(TypeHandler): valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { EXPECT_CALL(*gl_, Uniform%(count)sfv(%(local_args)s)); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -3403,7 +3434,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { EXPECT_CALL(*gl_, Uniform%(count)s(_, _, _).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s); EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s @@ -3545,7 +3576,7 @@ class IsHandler(TypeHandler): valid_test = """ TEST_F(%(test_name)s, %(name)sValidArgs) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(name)s cmd; cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -3562,7 +3593,7 @@ TEST_F(%(test_name)s, %(name)sValidArgs) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s%(comma)sshared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::%(parse_result)s, ExecuteCmd(cmd));%(gl_error_test)s @@ -3575,7 +3606,7 @@ TEST_F(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) { invalid_test = """ TEST_F(%(test_name)s, %(name)sInvalidArgsBadSharedMemoryId) { EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)).Times(0); - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(false); %(name)s cmd; cmd.Init(%(args)s%(comma)skInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -3687,7 +3718,7 @@ class STRnHandler(TypeHandler): TEST_F(%(test_name)s, %(name)sValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; - SpecializedSetup<%(name)s, 0>(); + SpecializedSetup<%(name)s, 0>(true); %(expect_len_code)s EXPECT_CALL(*gl_, %(gl_func_name)s(%(gl_args)s)) .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)), diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index bc84352..3d68326 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -298,6 +298,9 @@ class VertexAttribManager { class VertexAttribInfo { public: typedef std::list<VertexAttribInfo*> VertexAttribInfoList; + struct Vec4 { + float v[4]; + }; VertexAttribInfo() : index_(0), @@ -305,8 +308,14 @@ class VertexAttribManager { size_(4), type_(GL_FLOAT), offset_(0), + normalized_(GL_FALSE), + gl_stride_(0), real_stride_(16), list_(NULL) { + value_.v[0] = 0.0f; + value_.v[1] = 0.0f; + value_.v[2] = 0.0f; + value_.v[3] = 1.0f; } // Returns true if this VertexAttrib can access index. @@ -324,16 +333,36 @@ class VertexAttribManager { return index_; } + GLint size() const { + return size_; + } + + GLenum type() const { + return type_; + } + + GLboolean normalized() const { + return normalized_; + } + + GLsizei gl_stride() const { + return gl_stride_; + } + void SetInfo( BufferManager::BufferInfo* buffer, GLint size, GLenum type, + GLboolean normalized, + GLsizei gl_stride, GLsizei real_stride, GLsizei offset) { DCHECK_GT(real_stride, 0); buffer_ = buffer; size_ = size; type_ = type; + normalized_ = normalized; + gl_stride_ = gl_stride; real_stride_ = real_stride; offset_ = offset; } @@ -346,6 +375,14 @@ class VertexAttribManager { return enabled_; } + void set_value(const Vec4& value) { + value_ = value; + } + + const Vec4& value() const { + return value_; + } + private: friend class VertexAttribManager; @@ -383,11 +420,19 @@ class VertexAttribManager { // The offset into the buffer. GLsizei offset_; + GLboolean normalized_; + + // The stride passed to glVertexAttribPointer. + GLsizei gl_stride_; + // The stride that will be used to access the buffer. This is the actual // stide, NOT the GL bogus stride. In other words there is never a stride // of 0. GLsizei real_stride_; + // The current value of the attrib. + Vec4 value_; + // The buffer bound to this attribute. BufferManager::BufferInfo::Ref buffer_; @@ -413,8 +458,10 @@ class VertexAttribManager { } VertexAttribInfo* GetVertexAttribInfo(GLuint index) { - DCHECK(index < max_vertex_attribs_); - return &vertex_attrib_infos_[index]; + if (index < max_vertex_attribs_) { + return &vertex_attrib_infos_[index]; + } + return NULL; } private: @@ -867,6 +914,10 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, // Wrapper for glGetShaderiv void DoGetShaderiv(GLuint shader, GLenum pname, GLint* params); + // Wrappers for glGetVertexAttrib. + void DoGetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params); + void DoGetVertexAttribiv(GLuint index, GLenum pname, GLint *params); + // Wrappers for glIsXXX functions. bool DoIsBuffer(GLuint client_id); bool DoIsFramebuffer(GLuint client_id); @@ -906,6 +957,17 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, void DoUniform3fv(GLint location, GLsizei count, const GLfloat* value); void DoUniform4fv(GLint location, GLsizei count, const GLfloat* value); + // Wrappers for glVertexAttrib?? + void DoVertexAttrib1f(GLuint index, GLfloat v0); + void DoVertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1); + void DoVertexAttrib3f(GLuint index, GLfloat v0, GLfloat v1, GLfloat v2); + void DoVertexAttrib4f( + GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); + void DoVertexAttrib1fv(GLuint index, const GLfloat *v); + void DoVertexAttrib2fv(GLuint index, const GLfloat *v); + void DoVertexAttrib3fv(GLuint index, const GLfloat *v); + void DoVertexAttrib4fv(GLuint index, const GLfloat *v); + // Wrapper for glUseProgram void DoUseProgram(GLuint program); @@ -935,6 +997,10 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, // Checks if the current program and vertex attributes are valid for drawing. bool IsDrawValid(GLuint max_vertex_accessed); + // Returns true if attrib0 was simulated. + bool SimulateAttrib0(GLuint max_vertex_accessed); + void RestoreStateForSimulatedAttrib0(); + void SetBlackTextureForNonRenderableTextures( bool* has_non_renderable_textures); void RestoreStateForNonRenderableTextures(); @@ -1038,6 +1104,15 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, // Class that manages vertex attribs. VertexAttribManager vertex_attrib_manager_; + // The buffer we bind to attrib 0 since OpenGL requires it (ES does not). + GLuint attrib_0_buffer_id_; + + // The value currently in attrib_0. + VertexAttribManager::VertexAttribInfo::Vec4 attrib_0_value_; + + // The size of attrib 0. + GLsizei attrib_0_size_; + // Current active texture by 0 - n index. // In other words, if we call glActiveTexture(GL_TEXTURE2) this value would // be 2. @@ -1337,11 +1412,17 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) util_(0), // TODO(gman): Set to actual num compress texture formats. pack_alignment_(4), unpack_alignment_(4), + attrib_0_buffer_id_(0), + attrib_0_size_(0), active_texture_unit_(0), black_2d_texture_id_(0), black_cube_texture_id_(0), anti_aliased_(false), use_shader_translator_(true) { + attrib_0_value_.v[0] = 0.0f; + attrib_0_value_.v[1] = 0.0f; + attrib_0_value_.v[2] = 0.0f; + attrib_0_value_.v[3] = 1.0f; } bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, @@ -1379,6 +1460,13 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, } vertex_attrib_manager_.Initialize(group_->max_vertex_attribs()); + // We have to enable vertex array 0 on OpenGL or it won't render. Note that + // OpenGL ES 2.0 does not have this issue. + glEnableVertexAttribArray(0); + glGenBuffersARB(1, &attrib_0_buffer_id_); + glBindBuffer(GL_ARRAY_BUFFER, attrib_0_buffer_id_); + glVertexAttribPointer(0, 1, GL_FLOAT, GL_FALSE, 0, NULL); + glBindBuffer(GL_ARRAY_BUFFER, 0); texture_units_.reset( new TextureUnit[group_->max_texture_units()]); @@ -1774,6 +1862,16 @@ void GLES2DecoderImpl::Destroy() { if (context_) { MakeCurrent(); + if (black_2d_texture_id_) { + glDeleteTextures(1, &black_2d_texture_id_); + } + if (black_cube_texture_id_) { + glDeleteTextures(1, &black_cube_texture_id_); + } + if (attrib_0_buffer_id_) { + glDeleteBuffersARB(1, &attrib_0_buffer_id_); + } + // Remove the saved frame buffer mapping from the parent decoder. The // parent pointer is a weak pointer so it will be null if the parent has // already been destroyed. @@ -2057,7 +2155,9 @@ void GLES2DecoderImpl::DoBindTexture(GLenum target, GLuint client_id) { void GLES2DecoderImpl::DoDisableVertexAttribArray(GLuint index) { if (vertex_attrib_manager_.Enable(index, false)) { - glDisableVertexAttribArray(index); + if (index != 0) { + glDisableVertexAttribArray(index); + } } else { SetGLError(GL_INVALID_VALUE, "glDisableVertexAttribArray: index out of range"); @@ -2499,11 +2599,15 @@ void GLES2DecoderImpl::DoDrawArrays( GLenum mode, GLint first, GLsizei count) { if (IsDrawValid(first + count - 1)) { bool has_non_renderable_textures; + bool simulated_attrib_0 = SimulateAttrib0(first + count - 1); SetBlackTextureForNonRenderableTextures(&has_non_renderable_textures); glDrawArrays(mode, first, count); if (has_non_renderable_textures) { RestoreStateForNonRenderableTextures(); } + if (simulated_attrib_0) { + RestoreStateForSimulatedAttrib0(); + } } } @@ -2938,7 +3042,64 @@ bool GLES2DecoderImpl::IsDrawValid(GLuint max_vertex_accessed) { } } return true; -}; +} + +bool GLES2DecoderImpl::SimulateAttrib0(GLuint max_vertex_accessed) { +#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) + const VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(0); + // If it's enabled or it's not used then we don't need to do anything. + if (info->enabled() || !current_program_->GetAttribInfoByLocation(0)) { + return false; + } + + typedef VertexAttribManager::VertexAttribInfo::Vec4 Vec4; + + glBindBuffer(GL_ARRAY_BUFFER, attrib_0_buffer_id_); + + // Make a buffer with a single repeated vec4 value enough to + // simulate the constant value that is supposed to be here. + // This is required to emulate GLES2 on GL. + GLsizei num_vertices = max_vertex_accessed + 1; + GLsizei size_needed = num_vertices * sizeof(Vec4); // NOLINT + if (size_needed > attrib_0_size_ || + info->value().v[0] != attrib_0_value_.v[0] || + info->value().v[1] != attrib_0_value_.v[1] || + info->value().v[2] != attrib_0_value_.v[2] || + info->value().v[3] != attrib_0_value_.v[3]) { + scoped_array<Vec4> temp(new Vec4[num_vertices]); + for (GLsizei ii = 0; ii < num_vertices; ++ii) { + temp[ii] = info->value(); + } + glBufferData( + GL_ARRAY_BUFFER, + size_needed, + &temp[0].v[0], + GL_DYNAMIC_DRAW); + attrib_0_value_ = info->value(); + attrib_0_size_ = size_needed; + } + + glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL); + + return true; +#else // GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2 + return false; +#endif // GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2 +} + +void GLES2DecoderImpl::RestoreStateForSimulatedAttrib0() { + const VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(0); + const void* ptr = reinterpret_cast<const void*>(info->offset()); + BufferManager::BufferInfo* buffer_info = info->buffer(); + glBindBuffer(GL_ARRAY_BUFFER, buffer_info ? buffer_info->service_id() : 0); + glVertexAttribPointer( + 0, info->size(), info->type(), info->normalized(), info->gl_stride(), + ptr); + glBindBuffer(GL_ARRAY_BUFFER, + bound_array_buffer_ ? bound_array_buffer_->service_id() : 0); +} error::Error GLES2DecoderImpl::HandleDrawElements( uint32 immediate_data_size, const gles2::DrawElements& c) { @@ -2980,6 +3141,7 @@ error::Error GLES2DecoderImpl::HandleDrawElements( if (IsDrawValid(max_vertex_accessed)) { bool has_non_renderable_textures; + bool simulated_attrib_0 = SimulateAttrib0(max_vertex_accessed); SetBlackTextureForNonRenderableTextures( &has_non_renderable_textures); const GLvoid* indices = reinterpret_cast<const GLvoid*>(offset); @@ -2987,6 +3149,9 @@ error::Error GLES2DecoderImpl::HandleDrawElements( if (has_non_renderable_textures) { RestoreStateForNonRenderableTextures(); } + if (simulated_attrib_0) { + RestoreStateForSimulatedAttrib0(); + } } return error::kNoError; } @@ -3243,6 +3408,226 @@ void GLES2DecoderImpl::DoValidateProgram(GLuint program_client_id) { glValidateProgram(info->service_id()); } +void GLES2DecoderImpl::DoGetVertexAttribfv( + GLuint index, GLenum pname, GLfloat* params) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glGetVertexAttribfv: index out of range"); + return; + } + switch (pname) { + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: { + BufferManager::BufferInfo* buffer = info->buffer(); + if (buffer && !buffer->IsDeleted()) { + GLuint client_id; + buffer_manager()->GetClientId(buffer->service_id(), &client_id); + *params = static_cast<GLfloat>(client_id); + } + break; + } + case GL_VERTEX_ATTRIB_ARRAY_ENABLED: + *params = static_cast<GLfloat>(info->enabled()); + break; + case GL_VERTEX_ATTRIB_ARRAY_SIZE: + *params = static_cast<GLfloat>(info->size()); + break; + case GL_VERTEX_ATTRIB_ARRAY_STRIDE: + *params = static_cast<GLfloat>(info->gl_stride()); + break; + case GL_VERTEX_ATTRIB_ARRAY_TYPE: + *params = static_cast<GLfloat>(info->type()); + break; + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + *params = static_cast<GLfloat>(info->normalized()); + break; + case GL_CURRENT_VERTEX_ATTRIB: + params[0] = info->value().v[0]; + params[1] = info->value().v[1]; + params[2] = info->value().v[2]; + params[3] = info->value().v[3]; + break; + default: + NOTREACHED(); + break; + } +} + +void GLES2DecoderImpl::DoGetVertexAttribiv( + GLuint index, GLenum pname, GLint* params) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glGetVertexAttribiv: index out of range"); + return; + } + switch (pname) { + case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: { + BufferManager::BufferInfo* buffer = info->buffer(); + if (buffer && !buffer->IsDeleted()) { + GLuint client_id; + buffer_manager()->GetClientId(buffer->service_id(), &client_id); + *params = client_id; + } + break; + } + case GL_VERTEX_ATTRIB_ARRAY_ENABLED: + *params = info->enabled(); + break; + case GL_VERTEX_ATTRIB_ARRAY_SIZE: + *params = info->size(); + break; + case GL_VERTEX_ATTRIB_ARRAY_STRIDE: + *params = info->gl_stride(); + break; + case GL_VERTEX_ATTRIB_ARRAY_TYPE: + *params = info->type(); + break; + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: + *params = static_cast<GLint>(info->normalized()); + break; + case GL_CURRENT_VERTEX_ATTRIB: + params[0] = static_cast<GLint>(info->value().v[0]); + params[1] = static_cast<GLint>(info->value().v[1]); + params[2] = static_cast<GLint>(info->value().v[2]); + params[3] = static_cast<GLint>(info->value().v[3]); + break; + default: + NOTREACHED(); + break; + } +} + +void GLES2DecoderImpl::DoVertexAttrib1f(GLuint index, GLfloat v0) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib1f: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v0; + value.v[1] = 0.0f; + value.v[2] = 0.0f; + value.v[3] = 1.0f; + info->set_value(value); + glVertexAttrib1f(index, v0); +} + +void GLES2DecoderImpl::DoVertexAttrib2f(GLuint index, GLfloat v0, GLfloat v1) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib2f: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v0; + value.v[1] = v1; + value.v[2] = 0.0f; + value.v[3] = 1.0f; + info->set_value(value); + glVertexAttrib2f(index, v0, v1); +} + +void GLES2DecoderImpl::DoVertexAttrib3f( + GLuint index, GLfloat v0, GLfloat v1, GLfloat v2) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib3f: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v0; + value.v[1] = v1; + value.v[2] = v2; + value.v[3] = 1.0f; + info->set_value(value); + glVertexAttrib3f(index, v0, v1, v2); +} + +void GLES2DecoderImpl::DoVertexAttrib4f( + GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib4f: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v0; + value.v[1] = v1; + value.v[2] = v2; + value.v[3] = v3; + info->set_value(value); + glVertexAttrib4f(index, v0, v1, v2, v3); +} + +void GLES2DecoderImpl::DoVertexAttrib1fv(GLuint index, const GLfloat* v) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib1fv: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v[0]; + value.v[1] = 0.0f; + value.v[2] = 0.0f; + value.v[3] = 1.0f; + info->set_value(value); + glVertexAttrib1fv(index, v); +} + +void GLES2DecoderImpl::DoVertexAttrib2fv(GLuint index, const GLfloat* v) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib2fv: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v[0]; + value.v[1] = v[1]; + value.v[2] = 0.0f; + value.v[3] = 1.0f; + info->set_value(value); + glVertexAttrib2fv(index, v); +} + +void GLES2DecoderImpl::DoVertexAttrib3fv(GLuint index, const GLfloat* v) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib3fv: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v[0]; + value.v[1] = v[1]; + value.v[2] = v[2]; + value.v[3] = 1.0f; + info->set_value(value); + glVertexAttrib3fv(index, v); +} + +void GLES2DecoderImpl::DoVertexAttrib4fv(GLuint index, const GLfloat* v) { + VertexAttribManager::VertexAttribInfo* info = + vertex_attrib_manager_.GetVertexAttribInfo(index); + if (!info) { + SetGLError(GL_INVALID_VALUE, "glVertexAttrib4fv: index out of range"); + return; + } + VertexAttribManager::VertexAttribInfo::Vec4 value; + value.v[0] = v[0]; + value.v[1] = v[1]; + value.v[2] = v[2]; + value.v[3] = v[3]; + info->set_value(value); + glVertexAttrib4fv(index, v); +} + error::Error GLES2DecoderImpl::HandleVertexAttribPointer( uint32 immediate_data_size, const gles2::VertexAttribPointer& c) { if (!bound_array_buffer_ || bound_array_buffer_->IsDeleted()) { @@ -3289,7 +3674,6 @@ error::Error GLES2DecoderImpl::HandleVertexAttribPointer( } GLsizei component_size = GLES2Util::GetGLTypeSizeForTexturesAndBuffers(type); - GLsizei real_stride = stride != 0 ? stride : component_size * size; if (offset % component_size > 0) { SetGLError(GL_INVALID_VALUE, "glVertexAttribPointer: stride not valid for type"); @@ -3299,7 +3683,9 @@ error::Error GLES2DecoderImpl::HandleVertexAttribPointer( bound_array_buffer_, size, type, - real_stride, + normalized, + stride, + stride != 0 ? stride : component_size * size, offset); glVertexAttribPointer(indx, size, type, normalized, stride, ptr); return error::kNoError; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 0b595e4..d6de595 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h @@ -954,7 +954,8 @@ error::Error GLES2DecoderImpl::HandleGetBooleanv( uint32 immediate_data_size, const gles2::GetBooleanv& c) { GLenum pname = static_cast<GLenum>(c.pname); typedef GetBooleanv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLboolean* params = result ? result->GetData() : NULL; @@ -985,7 +986,8 @@ error::Error GLES2DecoderImpl::HandleGetBufferParameteriv( GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); typedef GetBufferParameteriv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1033,7 +1035,8 @@ error::Error GLES2DecoderImpl::HandleGetFloatv( uint32 immediate_data_size, const gles2::GetFloatv& c) { GLenum pname = static_cast<GLenum>(c.pname); typedef GetFloatv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLfloat* params = result ? result->GetData() : NULL; @@ -1066,7 +1069,8 @@ error::Error GLES2DecoderImpl::HandleGetFramebufferAttachmentParameteriv( GLenum attachment = static_cast<GLenum>(c.attachment); GLenum pname = static_cast<GLenum>(c.pname); typedef GetFramebufferAttachmentParameteriv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1110,7 +1114,8 @@ error::Error GLES2DecoderImpl::HandleGetIntegerv( uint32 immediate_data_size, const gles2::GetIntegerv& c) { GLenum pname = static_cast<GLenum>(c.pname); typedef GetIntegerv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1141,7 +1146,8 @@ error::Error GLES2DecoderImpl::HandleGetProgramiv( GLuint program = c.program; GLenum pname = static_cast<GLenum>(c.pname); typedef GetProgramiv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1172,7 +1178,8 @@ error::Error GLES2DecoderImpl::HandleGetRenderbufferParameteriv( GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); typedef GetRenderbufferParameteriv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1211,7 +1218,8 @@ error::Error GLES2DecoderImpl::HandleGetShaderiv( GLuint shader = c.shader; GLenum pname = static_cast<GLenum>(c.pname); typedef GetShaderiv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1242,7 +1250,8 @@ error::Error GLES2DecoderImpl::HandleGetTexParameterfv( GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); typedef GetTexParameterfv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLfloat* params = result ? result->GetData() : NULL; @@ -1277,7 +1286,8 @@ error::Error GLES2DecoderImpl::HandleGetTexParameteriv( GLenum target = static_cast<GLenum>(c.target); GLenum pname = static_cast<GLenum>(c.pname); typedef GetTexParameteriv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1312,7 +1322,8 @@ error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( GLuint index = static_cast<GLuint>(c.index); GLenum pname = static_cast<GLenum>(c.pname); typedef GetVertexAttribfv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLfloat* params = result ? result->GetData() : NULL; @@ -1328,7 +1339,7 @@ error::Error GLES2DecoderImpl::HandleGetVertexAttribfv( return error::kInvalidArguments; } CopyRealGLErrorsToWrapper(); - glGetVertexAttribfv(index, pname, params); + DoGetVertexAttribfv(index, pname, params); GLenum error = glGetError(); if (error == GL_NO_ERROR) { result->SetNumResults(num_values); @@ -1343,7 +1354,8 @@ error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( GLuint index = static_cast<GLuint>(c.index); GLenum pname = static_cast<GLenum>(c.pname); typedef GetVertexAttribiv::Result Result; - GLsizei num_values = GetNumValuesReturnedForGLGet(pname, &num_values); + GLsizei num_values = 0; + GetNumValuesReturnedForGLGet(pname, &num_values); Result* result = GetSharedMemoryAs<Result*>( c.params_shm_id, c.params_shm_offset, Result::ComputeSize(num_values)); GLint* params = result ? result->GetData() : NULL; @@ -1359,7 +1371,7 @@ error::Error GLES2DecoderImpl::HandleGetVertexAttribiv( return error::kInvalidArguments; } CopyRealGLErrorsToWrapper(); - glGetVertexAttribiv(index, pname, params); + DoGetVertexAttribiv(index, pname, params); GLenum error = glGetError(); if (error == GL_NO_ERROR) { result->SetNumResults(num_values); @@ -2519,7 +2531,7 @@ 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); + DoVertexAttrib1f(indx, x); return error::kNoError; } @@ -2535,7 +2547,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib1fv( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib1fv(indx, values); + DoVertexAttrib1fv(indx, values); return error::kNoError; } @@ -2554,7 +2566,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib1fvImmediate( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib1fv(indx, values); + DoVertexAttrib1fv(indx, values); return error::kNoError; } @@ -2563,7 +2575,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib2f( 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); + DoVertexAttrib2f(indx, x, y); return error::kNoError; } @@ -2579,7 +2591,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib2fv( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib2fv(indx, values); + DoVertexAttrib2fv(indx, values); return error::kNoError; } @@ -2598,7 +2610,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib2fvImmediate( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib2fv(indx, values); + DoVertexAttrib2fv(indx, values); return error::kNoError; } @@ -2608,7 +2620,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib3f( 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); + DoVertexAttrib3f(indx, x, y, z); return error::kNoError; } @@ -2624,7 +2636,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib3fv( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib3fv(indx, values); + DoVertexAttrib3fv(indx, values); return error::kNoError; } @@ -2643,7 +2655,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib3fvImmediate( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib3fv(indx, values); + DoVertexAttrib3fv(indx, values); return error::kNoError; } @@ -2654,7 +2666,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib4f( GLfloat y = static_cast<GLfloat>(c.y); GLfloat z = static_cast<GLfloat>(c.z); GLfloat w = static_cast<GLfloat>(c.w); - glVertexAttrib4f(indx, x, y, z, w); + DoVertexAttrib4f(indx, x, y, z, w); return error::kNoError; } @@ -2670,7 +2682,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib4fv( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib4fv(indx, values); + DoVertexAttrib4fv(indx, values); return error::kNoError; } @@ -2689,7 +2701,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttrib4fvImmediate( if (values == NULL) { return error::kOutOfBounds; } - glVertexAttrib4fv(indx, values); + DoVertexAttrib4fv(indx, values); return error::kNoError; } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc index 7a5b708..766dfae 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc @@ -45,10 +45,38 @@ class GLES2DecoderWithShaderTest : public GLES2DecoderWithShaderTestBase { GLES2DecoderWithShaderTest() : GLES2DecoderWithShaderTestBase() { } + + void AddExpectationsForSimulatedAttrib0( + GLsizei num_vertices, GLuint buffer_id) { +#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) + EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceAttrib0BufferId)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, BufferData(GL_ARRAY_BUFFER, + num_vertices * sizeof(GLfloat) * 4, + _, GL_DYNAMIC_DRAW)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, VertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, NULL)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, buffer_id)) + .Times(1) + .RetiresOnSaturation(); + } +#endif // !GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2 }; TEST_F(GLES2DecoderWithShaderTest, DrawArraysNoAttributesSucceeds) { SetupTexture(); + AddExpectationsForSimulatedAttrib0(kNumVertices, 0); + EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) .Times(1) .RetiresOnSaturation(); @@ -64,6 +92,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysBadTextureUsesBlack) { // this should trigger replacing with black textures before rendering. DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, 0); + AddExpectationsForSimulatedAttrib0(kNumVertices, 0); { InSequence sequence; EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) @@ -106,6 +135,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysValidAttributesSucceeds) { SetupTexture(); SetupVertexBuffer(); DoVertexAttribPointer(1, 2, GL_FLOAT, 0, 0); + AddExpectationsForSimulatedAttrib0(kNumVertices, kServiceBufferId); EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) .Times(1) @@ -200,6 +230,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawArraysInvalidCountFails) { TEST_F(GLES2DecoderWithShaderTest, DrawElementsNoAttributesSucceeds) { SetupTexture(); SetupIndexBuffer(); + AddExpectationsForSimulatedAttrib0(kMaxValidIndex + 1, 0); EXPECT_CALL(*gl_, DrawElements(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, BufferOffset(kValidIndexRangeStart * 2))) @@ -243,6 +274,7 @@ TEST_F(GLES2DecoderWithShaderTest, DrawElementsValidAttributesSucceeds) { SetupVertexBuffer(); SetupIndexBuffer(); DoVertexAttribPointer(1, 2, GL_FLOAT, 0, 0); + AddExpectationsForSimulatedAttrib0(kMaxValidIndex + 1, kServiceBufferId); EXPECT_CALL(*gl_, DrawElements(GL_TRIANGLES, kValidIndexRangeCount, GL_UNSIGNED_SHORT, @@ -1026,7 +1058,7 @@ TEST_F(GLES2DecoderTest, GenerateMipmapWrongFormatsFails) { TEST_F(GLES2DecoderWithShaderTest, Uniform1iValidArgs) { EXPECT_CALL(*gl_, Uniform1i(kUniform1Location, 2)); - SpecializedSetup<Uniform1i, 0>(); + SpecializedSetup<Uniform1i, 0>(true); Uniform1i cmd; cmd.Init(kUniform1Location, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1037,7 +1069,7 @@ TEST_F(GLES2DecoderWithShaderTest, Uniform1ivValidArgs) { *gl_, Uniform1iv( kUniform1Location, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); - SpecializedSetup<Uniform1iv, 0>(); + SpecializedSetup<Uniform1iv, 0>(true); Uniform1iv cmd; cmd.Init(kUniform1Location, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1045,7 +1077,7 @@ TEST_F(GLES2DecoderWithShaderTest, Uniform1ivValidArgs) { TEST_F(GLES2DecoderWithShaderTest, Uniform1ivInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform1iv(_, _, _)).Times(0); - SpecializedSetup<Uniform1iv, 0>(); + SpecializedSetup<Uniform1iv, 0>(false); Uniform1iv cmd; cmd.Init(kUniform1Location, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1053,7 +1085,7 @@ TEST_F(GLES2DecoderWithShaderTest, Uniform1ivInvalidArgs2_0) { TEST_F(GLES2DecoderWithShaderTest, Uniform1ivInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform1iv(_, _, _)).Times(0); - SpecializedSetup<Uniform1iv, 0>(); + SpecializedSetup<Uniform1iv, 0>(false); Uniform1iv cmd; cmd.Init(kUniform1Location, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1065,7 +1097,7 @@ TEST_F(GLES2DecoderWithShaderTest, Uniform1ivImmediateValidArgs) { *gl_, Uniform1iv(kUniform1Location, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform1ivImmediate, 0>(); + SpecializedSetup<Uniform1ivImmediate, 0>(true); GLint temp[1 * 2] = { 0, }; cmd.Init(kUniform1Location, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1077,6 +1109,7 @@ TEST_F(GLES2DecoderWithShaderTest, BindBufferToDifferentTargetFails) { DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); // Attempt to rebind to GL_ELEMENT_ARRAY_BUFFER // NOTE: Real GLES2 does not have this restriction but WebGL and we do. + // This can be restriction can be removed at runtime. EXPECT_CALL(*gl_, BindBuffer(_, _)) .Times(0); BindBuffer cmd; @@ -1087,16 +1120,16 @@ TEST_F(GLES2DecoderWithShaderTest, BindBufferToDifferentTargetFails) { TEST_F(GLES2DecoderTest, ActiveTextureValidArgs) { EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)); - SpecializedSetup<ActiveTexture, 0>(); + SpecializedSetup<ActiveTexture, 0>(true); ActiveTexture cmd; cmd.Init(GL_TEXTURE1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } -TEST_F(GLES2DecoderTest, ActiveTextureInalidArgs) { +TEST_F(GLES2DecoderTest, ActiveTextureInvalidArgs) { EXPECT_CALL(*gl_, ActiveTexture(_)).Times(0); - SpecializedSetup<ActiveTexture, 0>(); + SpecializedSetup<ActiveTexture, 0>(false); ActiveTexture cmd; cmd.Init(GL_TEXTURE0 - 1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc index cd78e98..7be16d6 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc @@ -33,7 +33,8 @@ class GLES2DecoderTest1 : public GLES2DecoderTestBase { }; template <> -void GLES2DecoderTestBase::SpecializedSetup<GenerateMipmap, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<GenerateMipmap, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); DoTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, @@ -41,32 +42,36 @@ void GLES2DecoderTestBase::SpecializedSetup<GenerateMipmap, 0>() { }; template <> -void GLES2DecoderTestBase::SpecializedSetup<CheckFramebufferStatus, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<CheckFramebufferStatus, 0>( + bool /* valid */) { DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<FramebufferRenderbuffer, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<FramebufferRenderbuffer, 0>( + bool /* valid */) { DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<FramebufferTexture2D, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<FramebufferTexture2D, 0>( + bool /* valid */) { DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); }; template <> void GLES2DecoderTestBase::SpecializedSetup<GetFramebufferAttachmentParameteriv, - 0>() { + 0>(bool /* valid */) { DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<GetRenderbufferParameteriv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<GetRenderbufferParameteriv, 0>( + bool /* valid */) { DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); }; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h index 4379a10..824c051 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h @@ -12,7 +12,7 @@ TEST_F(GLES2DecoderTest1, AttachShaderValidArgs) { EXPECT_CALL(*gl_, AttachShader(kServiceProgramId, kServiceShaderId)); - SpecializedSetup<AttachShader, 0>(); + SpecializedSetup<AttachShader, 0>(true); AttachShader cmd; cmd.Init(client_program_id_, client_shader_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -26,7 +26,7 @@ TEST_F(GLES2DecoderTest1, AttachShaderValidArgs) { TEST_F(GLES2DecoderTest1, BindBufferValidArgs) { EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceBufferId)); - SpecializedSetup<BindBuffer, 0>(); + SpecializedSetup<BindBuffer, 0>(true); BindBuffer cmd; cmd.Init(GL_ARRAY_BUFFER, client_buffer_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -37,7 +37,7 @@ TEST_F(GLES2DecoderTest1, BindBufferValidArgsNewId) { EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kNewServiceId)); EXPECT_CALL(*gl_, GenBuffersARB(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); - SpecializedSetup<BindBuffer, 0>(); + SpecializedSetup<BindBuffer, 0>(true); BindBuffer cmd; cmd.Init(GL_ARRAY_BUFFER, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -47,7 +47,7 @@ TEST_F(GLES2DecoderTest1, BindBufferValidArgsNewId) { TEST_F(GLES2DecoderTest1, BindBufferInvalidArgs0_0) { EXPECT_CALL(*gl_, BindBuffer(_, _)).Times(0); - SpecializedSetup<BindBuffer, 0>(); + SpecializedSetup<BindBuffer, 0>(false); BindBuffer cmd; cmd.Init(GL_RENDERBUFFER, client_buffer_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -56,7 +56,7 @@ TEST_F(GLES2DecoderTest1, BindBufferInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, BindFramebufferValidArgs) { EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kServiceFramebufferId)); - SpecializedSetup<BindFramebuffer, 0>(); + SpecializedSetup<BindFramebuffer, 0>(true); BindFramebuffer cmd; cmd.Init(GL_FRAMEBUFFER, client_framebuffer_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -67,7 +67,7 @@ TEST_F(GLES2DecoderTest1, BindFramebufferValidArgsNewId) { EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, kNewServiceId)); EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); - SpecializedSetup<BindFramebuffer, 0>(); + SpecializedSetup<BindFramebuffer, 0>(true); BindFramebuffer cmd; cmd.Init(GL_FRAMEBUFFER, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -77,7 +77,7 @@ TEST_F(GLES2DecoderTest1, BindFramebufferValidArgsNewId) { TEST_F(GLES2DecoderTest1, BindFramebufferInvalidArgs0_0) { EXPECT_CALL(*gl_, BindFramebufferEXT(_, _)).Times(0); - SpecializedSetup<BindFramebuffer, 0>(); + SpecializedSetup<BindFramebuffer, 0>(false); BindFramebuffer cmd; cmd.Init(GL_RENDERBUFFER, client_framebuffer_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -87,7 +87,7 @@ TEST_F(GLES2DecoderTest1, BindFramebufferInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgs) { EXPECT_CALL( *gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kServiceRenderbufferId)); - SpecializedSetup<BindRenderbuffer, 0>(); + SpecializedSetup<BindRenderbuffer, 0>(true); BindRenderbuffer cmd; cmd.Init(GL_RENDERBUFFER, client_renderbuffer_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -98,7 +98,7 @@ TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgsNewId) { EXPECT_CALL(*gl_, BindRenderbufferEXT(GL_RENDERBUFFER, kNewServiceId)); EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); - SpecializedSetup<BindRenderbuffer, 0>(); + SpecializedSetup<BindRenderbuffer, 0>(true); BindRenderbuffer cmd; cmd.Init(GL_RENDERBUFFER, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -108,7 +108,7 @@ TEST_F(GLES2DecoderTest1, BindRenderbufferValidArgsNewId) { TEST_F(GLES2DecoderTest1, BindRenderbufferInvalidArgs0_0) { EXPECT_CALL(*gl_, BindRenderbufferEXT(_, _)).Times(0); - SpecializedSetup<BindRenderbuffer, 0>(); + SpecializedSetup<BindRenderbuffer, 0>(false); BindRenderbuffer cmd; cmd.Init(GL_FRAMEBUFFER, client_renderbuffer_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -117,7 +117,7 @@ TEST_F(GLES2DecoderTest1, BindRenderbufferInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, BindTextureValidArgs) { EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)); - SpecializedSetup<BindTexture, 0>(); + SpecializedSetup<BindTexture, 0>(true); BindTexture cmd; cmd.Init(GL_TEXTURE_2D, client_texture_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -128,7 +128,7 @@ TEST_F(GLES2DecoderTest1, BindTextureValidArgsNewId) { EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kNewServiceId)); EXPECT_CALL(*gl_, GenTextures(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); - SpecializedSetup<BindTexture, 0>(); + SpecializedSetup<BindTexture, 0>(true); BindTexture cmd; cmd.Init(GL_TEXTURE_2D, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -138,7 +138,7 @@ TEST_F(GLES2DecoderTest1, BindTextureValidArgsNewId) { TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_0) { EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0); - SpecializedSetup<BindTexture, 0>(); + SpecializedSetup<BindTexture, 0>(false); BindTexture cmd; cmd.Init(GL_TEXTURE_1D, client_texture_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -147,7 +147,7 @@ TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_1) { EXPECT_CALL(*gl_, BindTexture(_, _)).Times(0); - SpecializedSetup<BindTexture, 0>(); + SpecializedSetup<BindTexture, 0>(false); BindTexture cmd; cmd.Init(GL_TEXTURE_3D, client_texture_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -156,7 +156,7 @@ TEST_F(GLES2DecoderTest1, BindTextureInvalidArgs0_1) { TEST_F(GLES2DecoderTest1, BlendColorValidArgs) { EXPECT_CALL(*gl_, BlendColor(1, 2, 3, 4)); - SpecializedSetup<BlendColor, 0>(); + SpecializedSetup<BlendColor, 0>(true); BlendColor cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -165,7 +165,7 @@ TEST_F(GLES2DecoderTest1, BlendColorValidArgs) { TEST_F(GLES2DecoderTest1, BlendEquationValidArgs) { EXPECT_CALL(*gl_, BlendEquation(GL_FUNC_ADD)); - SpecializedSetup<BlendEquation, 0>(); + SpecializedSetup<BlendEquation, 0>(true); BlendEquation cmd; cmd.Init(GL_FUNC_ADD); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -174,7 +174,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationValidArgs) { TEST_F(GLES2DecoderTest1, BlendEquationInvalidArgs0_0) { EXPECT_CALL(*gl_, BlendEquation(_)).Times(0); - SpecializedSetup<BlendEquation, 0>(); + SpecializedSetup<BlendEquation, 0>(false); BlendEquation cmd; cmd.Init(GL_MIN); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -183,7 +183,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, BlendEquationInvalidArgs0_1) { EXPECT_CALL(*gl_, BlendEquation(_)).Times(0); - SpecializedSetup<BlendEquation, 0>(); + SpecializedSetup<BlendEquation, 0>(false); BlendEquation cmd; cmd.Init(GL_MAX); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -192,7 +192,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationInvalidArgs0_1) { TEST_F(GLES2DecoderTest1, BlendEquationSeparateValidArgs) { EXPECT_CALL(*gl_, BlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD)); - SpecializedSetup<BlendEquationSeparate, 0>(); + SpecializedSetup<BlendEquationSeparate, 0>(true); BlendEquationSeparate cmd; cmd.Init(GL_FUNC_ADD, GL_FUNC_ADD); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -201,7 +201,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationSeparateValidArgs) { TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs0_0) { EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); - SpecializedSetup<BlendEquationSeparate, 0>(); + SpecializedSetup<BlendEquationSeparate, 0>(false); BlendEquationSeparate cmd; cmd.Init(GL_MIN, GL_FUNC_ADD); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -210,7 +210,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs0_1) { EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); - SpecializedSetup<BlendEquationSeparate, 0>(); + SpecializedSetup<BlendEquationSeparate, 0>(false); BlendEquationSeparate cmd; cmd.Init(GL_MAX, GL_FUNC_ADD); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -219,7 +219,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs0_1) { TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs1_0) { EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); - SpecializedSetup<BlendEquationSeparate, 0>(); + SpecializedSetup<BlendEquationSeparate, 0>(false); BlendEquationSeparate cmd; cmd.Init(GL_FUNC_ADD, GL_MIN); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -228,7 +228,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs1_1) { EXPECT_CALL(*gl_, BlendEquationSeparate(_, _)).Times(0); - SpecializedSetup<BlendEquationSeparate, 0>(); + SpecializedSetup<BlendEquationSeparate, 0>(false); BlendEquationSeparate cmd; cmd.Init(GL_FUNC_ADD, GL_MAX); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -237,7 +237,7 @@ TEST_F(GLES2DecoderTest1, BlendEquationSeparateInvalidArgs1_1) { TEST_F(GLES2DecoderTest1, BlendFuncValidArgs) { EXPECT_CALL(*gl_, BlendFunc(GL_ZERO, GL_ZERO)); - SpecializedSetup<BlendFunc, 0>(); + SpecializedSetup<BlendFunc, 0>(true); BlendFunc cmd; cmd.Init(GL_ZERO, GL_ZERO); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -246,7 +246,7 @@ TEST_F(GLES2DecoderTest1, BlendFuncValidArgs) { TEST_F(GLES2DecoderTest1, BlendFuncSeparateValidArgs) { EXPECT_CALL(*gl_, BlendFuncSeparate(GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO)); - SpecializedSetup<BlendFuncSeparate, 0>(); + SpecializedSetup<BlendFuncSeparate, 0>(true); BlendFuncSeparate cmd; cmd.Init(GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -263,7 +263,7 @@ TEST_F(GLES2DecoderTest1, BlendFuncSeparateValidArgs) { TEST_F(GLES2DecoderTest1, CheckFramebufferStatusValidArgs) { EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)); - SpecializedSetup<CheckFramebufferStatus, 0>(); + SpecializedSetup<CheckFramebufferStatus, 0>(true); CheckFramebufferStatus cmd; cmd.Init(GL_FRAMEBUFFER, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -272,7 +272,7 @@ TEST_F(GLES2DecoderTest1, CheckFramebufferStatusValidArgs) { TEST_F(GLES2DecoderTest1, CheckFramebufferStatusInvalidArgs0_0) { EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(_)).Times(0); - SpecializedSetup<CheckFramebufferStatus, 0>(); + SpecializedSetup<CheckFramebufferStatus, 0>(false); CheckFramebufferStatus cmd; cmd.Init(GL_RENDERBUFFER, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -281,7 +281,7 @@ TEST_F(GLES2DecoderTest1, CheckFramebufferStatusInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, CheckFramebufferStatusInvalidArgsBadSharedMemoryId) { EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)).Times(0); - SpecializedSetup<CheckFramebufferStatus, 0>(); + SpecializedSetup<CheckFramebufferStatus, 0>(false); CheckFramebufferStatus cmd; cmd.Init(GL_FRAMEBUFFER, kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -291,7 +291,7 @@ TEST_F(GLES2DecoderTest1, CheckFramebufferStatusInvalidArgsBadSharedMemoryId) { TEST_F(GLES2DecoderTest1, ClearValidArgs) { EXPECT_CALL(*gl_, Clear(1)); - SpecializedSetup<Clear, 0>(); + SpecializedSetup<Clear, 0>(true); Clear cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -300,7 +300,7 @@ TEST_F(GLES2DecoderTest1, ClearValidArgs) { TEST_F(GLES2DecoderTest1, ClearColorValidArgs) { EXPECT_CALL(*gl_, ClearColor(1, 2, 3, 4)); - SpecializedSetup<ClearColor, 0>(); + SpecializedSetup<ClearColor, 0>(true); ClearColor cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -309,7 +309,7 @@ TEST_F(GLES2DecoderTest1, ClearColorValidArgs) { TEST_F(GLES2DecoderTest1, ClearDepthfValidArgs) { EXPECT_CALL(*gl_, ClearDepth(1)); - SpecializedSetup<ClearDepthf, 0>(); + SpecializedSetup<ClearDepthf, 0>(true); ClearDepthf cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -318,7 +318,7 @@ TEST_F(GLES2DecoderTest1, ClearDepthfValidArgs) { TEST_F(GLES2DecoderTest1, ClearStencilValidArgs) { EXPECT_CALL(*gl_, ClearStencil(1)); - SpecializedSetup<ClearStencil, 0>(); + SpecializedSetup<ClearStencil, 0>(true); ClearStencil cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -327,7 +327,7 @@ TEST_F(GLES2DecoderTest1, ClearStencilValidArgs) { TEST_F(GLES2DecoderTest1, ColorMaskValidArgs) { EXPECT_CALL(*gl_, ColorMask(1, 2, 3, 4)); - SpecializedSetup<ColorMask, 0>(); + SpecializedSetup<ColorMask, 0>(true); ColorMask cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -347,7 +347,7 @@ TEST_F(GLES2DecoderTest1, ColorMaskValidArgs) { TEST_F(GLES2DecoderTest1, CopyTexImage2DValidArgs) { EXPECT_CALL(*gl_, CopyTexImage2D(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8)); - SpecializedSetup<CopyTexImage2D, 0>(); + SpecializedSetup<CopyTexImage2D, 0>(true); CopyTexImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -356,7 +356,7 @@ TEST_F(GLES2DecoderTest1, CopyTexImage2DValidArgs) { TEST_F(GLES2DecoderTest1, CopyTexImage2DInvalidArgs0_0) { EXPECT_CALL(*gl_, CopyTexImage2D(_, _, _, _, _, _, _, _)).Times(0); - SpecializedSetup<CopyTexImage2D, 0>(); + SpecializedSetup<CopyTexImage2D, 0>(false); CopyTexImage2D cmd; cmd.Init(GL_PROXY_TEXTURE_CUBE_MAP, 2, 3, 4, 5, 6, 7, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -365,7 +365,7 @@ TEST_F(GLES2DecoderTest1, CopyTexImage2DInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, CopyTexImage2DInvalidArgs5_0) { EXPECT_CALL(*gl_, CopyTexImage2D(_, _, _, _, _, _, _, _)).Times(0); - SpecializedSetup<CopyTexImage2D, 0>(); + SpecializedSetup<CopyTexImage2D, 0>(false); CopyTexImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, -1, 7, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -374,7 +374,7 @@ TEST_F(GLES2DecoderTest1, CopyTexImage2DInvalidArgs5_0) { TEST_F(GLES2DecoderTest1, CopyTexImage2DInvalidArgs6_0) { EXPECT_CALL(*gl_, CopyTexImage2D(_, _, _, _, _, _, _, _)).Times(0); - SpecializedSetup<CopyTexImage2D, 0>(); + SpecializedSetup<CopyTexImage2D, 0>(false); CopyTexImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, -1, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -383,7 +383,7 @@ TEST_F(GLES2DecoderTest1, CopyTexImage2DInvalidArgs6_0) { TEST_F(GLES2DecoderTest1, CopyTexSubImage2DValidArgs) { EXPECT_CALL(*gl_, CopyTexSubImage2D(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8)); - SpecializedSetup<CopyTexSubImage2D, 0>(); + SpecializedSetup<CopyTexSubImage2D, 0>(true); CopyTexSubImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -392,7 +392,7 @@ TEST_F(GLES2DecoderTest1, CopyTexSubImage2DValidArgs) { TEST_F(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs0_0) { EXPECT_CALL(*gl_, CopyTexSubImage2D(_, _, _, _, _, _, _, _)).Times(0); - SpecializedSetup<CopyTexSubImage2D, 0>(); + SpecializedSetup<CopyTexSubImage2D, 0>(false); CopyTexSubImage2D cmd; cmd.Init(GL_PROXY_TEXTURE_CUBE_MAP, 2, 3, 4, 5, 6, 7, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -401,7 +401,7 @@ TEST_F(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs6_0) { EXPECT_CALL(*gl_, CopyTexSubImage2D(_, _, _, _, _, _, _, _)).Times(0); - SpecializedSetup<CopyTexSubImage2D, 0>(); + SpecializedSetup<CopyTexSubImage2D, 0>(false); CopyTexSubImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, -1, 8); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -410,7 +410,7 @@ TEST_F(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs6_0) { TEST_F(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs7_0) { EXPECT_CALL(*gl_, CopyTexSubImage2D(_, _, _, _, _, _, _, _)).Times(0); - SpecializedSetup<CopyTexSubImage2D, 0>(); + SpecializedSetup<CopyTexSubImage2D, 0>(false); CopyTexSubImage2D cmd; cmd.Init(GL_TEXTURE_2D, 2, 3, 4, 5, 6, 7, -1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -420,7 +420,7 @@ TEST_F(GLES2DecoderTest1, CopyTexSubImage2DInvalidArgs7_0) { TEST_F(GLES2DecoderTest1, CreateProgramValidArgs) { EXPECT_CALL(*gl_, CreateProgram()) .WillOnce(Return(kNewServiceId)); - SpecializedSetup<CreateProgram, 0>(); + SpecializedSetup<CreateProgram, 0>(true); CreateProgram cmd; cmd.Init(kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -431,7 +431,7 @@ TEST_F(GLES2DecoderTest1, CreateProgramValidArgs) { TEST_F(GLES2DecoderTest1, CreateShaderValidArgs) { EXPECT_CALL(*gl_, CreateShader(GL_VERTEX_SHADER)) .WillOnce(Return(kNewServiceId)); - SpecializedSetup<CreateShader, 0>(); + SpecializedSetup<CreateShader, 0>(true); CreateShader cmd; cmd.Init(GL_VERTEX_SHADER, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -441,7 +441,7 @@ TEST_F(GLES2DecoderTest1, CreateShaderValidArgs) { TEST_F(GLES2DecoderTest1, CreateShaderInvalidArgs0_0) { EXPECT_CALL(*gl_, CreateShader(_)).Times(0); - SpecializedSetup<CreateShader, 0>(); + SpecializedSetup<CreateShader, 0>(false); CreateShader cmd; cmd.Init(GL_GEOMETRY_SHADER, kNewClientId); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -450,7 +450,7 @@ TEST_F(GLES2DecoderTest1, CreateShaderInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, CullFaceValidArgs) { EXPECT_CALL(*gl_, CullFace(GL_FRONT)); - SpecializedSetup<CullFace, 0>(); + SpecializedSetup<CullFace, 0>(true); CullFace cmd; cmd.Init(GL_FRONT); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -463,7 +463,7 @@ TEST_F(GLES2DecoderTest1, DeleteBuffersValidArgs) { DeleteBuffersARB(1, Pointee(kServiceBufferId))) .Times(1); GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_; - SpecializedSetup<DeleteBuffers, 0>(); + SpecializedSetup<DeleteBuffers, 0>(true); DeleteBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -474,7 +474,7 @@ TEST_F(GLES2DecoderTest1, DeleteBuffersValidArgs) { TEST_F(GLES2DecoderTest1, DeleteBuffersInvalidArgs) { GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; - SpecializedSetup<DeleteBuffers, 0>(); + SpecializedSetup<DeleteBuffers, 0>(false); DeleteBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -486,7 +486,7 @@ TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateValidArgs) { DeleteBuffersARB(1, Pointee(kServiceBufferId))) .Times(1); DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); - SpecializedSetup<DeleteBuffersImmediate, 0>(); + SpecializedSetup<DeleteBuffersImmediate, 0>(true); cmd.Init(1, &client_buffer_id_); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_buffer_id_))); @@ -497,7 +497,7 @@ TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateValidArgs) { TEST_F(GLES2DecoderTest1, DeleteBuffersImmediateInvalidArgs) { DeleteBuffersImmediate& cmd = *GetImmediateAs<DeleteBuffersImmediate>(); - SpecializedSetup<DeleteBuffersImmediate, 0>(); + SpecializedSetup<DeleteBuffersImmediate, 0>(false); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, @@ -510,7 +510,7 @@ TEST_F(GLES2DecoderTest1, DeleteFramebuffersValidArgs) { DeleteFramebuffersEXT(1, Pointee(kServiceFramebufferId))) .Times(1); GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_; - SpecializedSetup<DeleteFramebuffers, 0>(); + SpecializedSetup<DeleteFramebuffers, 0>(true); DeleteFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -521,7 +521,7 @@ TEST_F(GLES2DecoderTest1, DeleteFramebuffersValidArgs) { TEST_F(GLES2DecoderTest1, DeleteFramebuffersInvalidArgs) { GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; - SpecializedSetup<DeleteFramebuffers, 0>(); + SpecializedSetup<DeleteFramebuffers, 0>(false); DeleteFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -534,7 +534,7 @@ TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateValidArgs) { .Times(1); DeleteFramebuffersImmediate& cmd = *GetImmediateAs<DeleteFramebuffersImmediate>(); - SpecializedSetup<DeleteFramebuffersImmediate, 0>(); + SpecializedSetup<DeleteFramebuffersImmediate, 0>(true); cmd.Init(1, &client_framebuffer_id_); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_framebuffer_id_))); @@ -546,7 +546,7 @@ TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateValidArgs) { TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateInvalidArgs) { DeleteFramebuffersImmediate& cmd = *GetImmediateAs<DeleteFramebuffersImmediate>(); - SpecializedSetup<DeleteFramebuffersImmediate, 0>(); + SpecializedSetup<DeleteFramebuffersImmediate, 0>(false); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, @@ -555,7 +555,7 @@ TEST_F(GLES2DecoderTest1, DeleteFramebuffersImmediateInvalidArgs) { TEST_F(GLES2DecoderTest1, DeleteProgramValidArgs) { EXPECT_CALL(*gl_, DeleteProgram(kServiceProgramId)); - SpecializedSetup<DeleteProgram, 0>(); + SpecializedSetup<DeleteProgram, 0>(true); DeleteProgram cmd; cmd.Init(client_program_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -568,7 +568,7 @@ TEST_F(GLES2DecoderTest1, DeleteRenderbuffersValidArgs) { DeleteRenderbuffersEXT(1, Pointee(kServiceRenderbufferId))) .Times(1); GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_; - SpecializedSetup<DeleteRenderbuffers, 0>(); + SpecializedSetup<DeleteRenderbuffers, 0>(true); DeleteRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -579,7 +579,7 @@ TEST_F(GLES2DecoderTest1, DeleteRenderbuffersValidArgs) { TEST_F(GLES2DecoderTest1, DeleteRenderbuffersInvalidArgs) { GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; - SpecializedSetup<DeleteRenderbuffers, 0>(); + SpecializedSetup<DeleteRenderbuffers, 0>(false); DeleteRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -592,7 +592,7 @@ TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateValidArgs) { .Times(1); DeleteRenderbuffersImmediate& cmd = *GetImmediateAs<DeleteRenderbuffersImmediate>(); - SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); + SpecializedSetup<DeleteRenderbuffersImmediate, 0>(true); cmd.Init(1, &client_renderbuffer_id_); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_renderbuffer_id_))); @@ -604,7 +604,7 @@ TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateValidArgs) { TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateInvalidArgs) { DeleteRenderbuffersImmediate& cmd = *GetImmediateAs<DeleteRenderbuffersImmediate>(); - SpecializedSetup<DeleteRenderbuffersImmediate, 0>(); + SpecializedSetup<DeleteRenderbuffersImmediate, 0>(false); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, @@ -613,7 +613,7 @@ TEST_F(GLES2DecoderTest1, DeleteRenderbuffersImmediateInvalidArgs) { TEST_F(GLES2DecoderTest1, DeleteShaderValidArgs) { EXPECT_CALL(*gl_, DeleteShader(kServiceShaderId)); - SpecializedSetup<DeleteShader, 0>(); + SpecializedSetup<DeleteShader, 0>(true); DeleteShader cmd; cmd.Init(client_shader_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -626,7 +626,7 @@ TEST_F(GLES2DecoderTest1, DeleteTexturesValidArgs) { DeleteTextures(1, Pointee(kServiceTextureId))) .Times(1); GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_; - SpecializedSetup<DeleteTextures, 0>(); + SpecializedSetup<DeleteTextures, 0>(true); DeleteTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -637,7 +637,7 @@ TEST_F(GLES2DecoderTest1, DeleteTexturesValidArgs) { TEST_F(GLES2DecoderTest1, DeleteTexturesInvalidArgs) { GetSharedMemoryAs<GLuint*>()[0] = kInvalidClientId; - SpecializedSetup<DeleteTextures, 0>(); + SpecializedSetup<DeleteTextures, 0>(false); DeleteTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -649,7 +649,7 @@ TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateValidArgs) { DeleteTextures(1, Pointee(kServiceTextureId))) .Times(1); DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); - SpecializedSetup<DeleteTexturesImmediate, 0>(); + SpecializedSetup<DeleteTexturesImmediate, 0>(true); cmd.Init(1, &client_texture_id_); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(client_texture_id_))); @@ -660,7 +660,7 @@ TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateValidArgs) { TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateInvalidArgs) { DeleteTexturesImmediate& cmd = *GetImmediateAs<DeleteTexturesImmediate>(); - SpecializedSetup<DeleteTexturesImmediate, 0>(); + SpecializedSetup<DeleteTexturesImmediate, 0>(false); GLuint temp = kInvalidClientId; cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, @@ -669,7 +669,7 @@ TEST_F(GLES2DecoderTest1, DeleteTexturesImmediateInvalidArgs) { TEST_F(GLES2DecoderTest1, DepthFuncValidArgs) { EXPECT_CALL(*gl_, DepthFunc(GL_NEVER)); - SpecializedSetup<DepthFunc, 0>(); + SpecializedSetup<DepthFunc, 0>(true); DepthFunc cmd; cmd.Init(GL_NEVER); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -678,7 +678,7 @@ TEST_F(GLES2DecoderTest1, DepthFuncValidArgs) { TEST_F(GLES2DecoderTest1, DepthMaskValidArgs) { EXPECT_CALL(*gl_, DepthMask(1)); - SpecializedSetup<DepthMask, 0>(); + SpecializedSetup<DepthMask, 0>(true); DepthMask cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -687,7 +687,7 @@ TEST_F(GLES2DecoderTest1, DepthMaskValidArgs) { TEST_F(GLES2DecoderTest1, DepthRangefValidArgs) { EXPECT_CALL(*gl_, DepthRange(1, 2)); - SpecializedSetup<DepthRangef, 0>(); + SpecializedSetup<DepthRangef, 0>(true); DepthRangef cmd; cmd.Init(1, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -696,7 +696,7 @@ TEST_F(GLES2DecoderTest1, DepthRangefValidArgs) { TEST_F(GLES2DecoderTest1, DetachShaderValidArgs) { EXPECT_CALL(*gl_, DetachShader(kServiceProgramId, kServiceShaderId)); - SpecializedSetup<DetachShader, 0>(); + SpecializedSetup<DetachShader, 0>(true); DetachShader cmd; cmd.Init(client_program_id_, client_shader_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -705,7 +705,7 @@ TEST_F(GLES2DecoderTest1, DetachShaderValidArgs) { TEST_F(GLES2DecoderTest1, DisableValidArgs) { EXPECT_CALL(*gl_, Disable(GL_BLEND)); - SpecializedSetup<Disable, 0>(); + SpecializedSetup<Disable, 0>(true); Disable cmd; cmd.Init(GL_BLEND); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -714,7 +714,7 @@ TEST_F(GLES2DecoderTest1, DisableValidArgs) { TEST_F(GLES2DecoderTest1, DisableInvalidArgs0_0) { EXPECT_CALL(*gl_, Disable(_)).Times(0); - SpecializedSetup<Disable, 0>(); + SpecializedSetup<Disable, 0>(false); Disable cmd; cmd.Init(GL_CLIP_PLANE0); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -723,7 +723,7 @@ TEST_F(GLES2DecoderTest1, DisableInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, DisableInvalidArgs0_1) { EXPECT_CALL(*gl_, Disable(_)).Times(0); - SpecializedSetup<Disable, 0>(); + SpecializedSetup<Disable, 0>(false); Disable cmd; cmd.Init(GL_POINT_SPRITE); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -732,7 +732,7 @@ TEST_F(GLES2DecoderTest1, DisableInvalidArgs0_1) { TEST_F(GLES2DecoderTest1, DisableVertexAttribArrayValidArgs) { EXPECT_CALL(*gl_, DisableVertexAttribArray(1)); - SpecializedSetup<DisableVertexAttribArray, 0>(); + SpecializedSetup<DisableVertexAttribArray, 0>(true); DisableVertexAttribArray cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -744,7 +744,7 @@ TEST_F(GLES2DecoderTest1, DisableVertexAttribArrayValidArgs) { TEST_F(GLES2DecoderTest1, EnableValidArgs) { EXPECT_CALL(*gl_, Enable(GL_BLEND)); - SpecializedSetup<Enable, 0>(); + SpecializedSetup<Enable, 0>(true); Enable cmd; cmd.Init(GL_BLEND); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -753,7 +753,7 @@ TEST_F(GLES2DecoderTest1, EnableValidArgs) { TEST_F(GLES2DecoderTest1, EnableInvalidArgs0_0) { EXPECT_CALL(*gl_, Enable(_)).Times(0); - SpecializedSetup<Enable, 0>(); + SpecializedSetup<Enable, 0>(false); Enable cmd; cmd.Init(GL_CLIP_PLANE0); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -762,7 +762,7 @@ TEST_F(GLES2DecoderTest1, EnableInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, EnableInvalidArgs0_1) { EXPECT_CALL(*gl_, Enable(_)).Times(0); - SpecializedSetup<Enable, 0>(); + SpecializedSetup<Enable, 0>(false); Enable cmd; cmd.Init(GL_POINT_SPRITE); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -771,7 +771,7 @@ TEST_F(GLES2DecoderTest1, EnableInvalidArgs0_1) { TEST_F(GLES2DecoderTest1, EnableVertexAttribArrayValidArgs) { EXPECT_CALL(*gl_, EnableVertexAttribArray(1)); - SpecializedSetup<EnableVertexAttribArray, 0>(); + SpecializedSetup<EnableVertexAttribArray, 0>(true); EnableVertexAttribArray cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -780,7 +780,7 @@ TEST_F(GLES2DecoderTest1, EnableVertexAttribArrayValidArgs) { TEST_F(GLES2DecoderTest1, FinishValidArgs) { EXPECT_CALL(*gl_, Flush()); - SpecializedSetup<Finish, 0>(); + SpecializedSetup<Finish, 0>(true); Finish cmd; cmd.Init(); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -789,7 +789,7 @@ TEST_F(GLES2DecoderTest1, FinishValidArgs) { TEST_F(GLES2DecoderTest1, FlushValidArgs) { EXPECT_CALL(*gl_, Flush()); - SpecializedSetup<Flush, 0>(); + SpecializedSetup<Flush, 0>(true); Flush cmd; cmd.Init(); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -801,7 +801,7 @@ TEST_F(GLES2DecoderTest1, FramebufferRenderbufferValidArgs) { *gl_, FramebufferRenderbufferEXT( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, kServiceRenderbufferId)); - SpecializedSetup<FramebufferRenderbuffer, 0>(); + SpecializedSetup<FramebufferRenderbuffer, 0>(true); FramebufferRenderbuffer cmd; cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, @@ -812,7 +812,7 @@ TEST_F(GLES2DecoderTest1, FramebufferRenderbufferValidArgs) { TEST_F(GLES2DecoderTest1, FramebufferRenderbufferInvalidArgs0_0) { EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(_, _, _, _)).Times(0); - SpecializedSetup<FramebufferRenderbuffer, 0>(); + SpecializedSetup<FramebufferRenderbuffer, 0>(false); FramebufferRenderbuffer cmd; cmd.Init( GL_RENDERBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, @@ -823,7 +823,7 @@ TEST_F(GLES2DecoderTest1, FramebufferRenderbufferInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, FramebufferRenderbufferInvalidArgs2_0) { EXPECT_CALL(*gl_, FramebufferRenderbufferEXT(_, _, _, _)).Times(0); - SpecializedSetup<FramebufferRenderbuffer, 0>(); + SpecializedSetup<FramebufferRenderbuffer, 0>(false); FramebufferRenderbuffer cmd; cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER, @@ -837,7 +837,7 @@ TEST_F(GLES2DecoderTest1, FramebufferTexture2DValidArgs) { *gl_, FramebufferTexture2DEXT( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, kServiceTextureId, 5)); - SpecializedSetup<FramebufferTexture2D, 0>(); + SpecializedSetup<FramebufferTexture2D, 0>(true); FramebufferTexture2D cmd; cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, @@ -848,7 +848,7 @@ TEST_F(GLES2DecoderTest1, FramebufferTexture2DValidArgs) { TEST_F(GLES2DecoderTest1, FramebufferTexture2DInvalidArgs0_0) { EXPECT_CALL(*gl_, FramebufferTexture2DEXT(_, _, _, _, _)).Times(0); - SpecializedSetup<FramebufferTexture2D, 0>(); + SpecializedSetup<FramebufferTexture2D, 0>(false); FramebufferTexture2D cmd; cmd.Init( GL_RENDERBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, client_texture_id_, @@ -859,7 +859,7 @@ TEST_F(GLES2DecoderTest1, FramebufferTexture2DInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, FramebufferTexture2DInvalidArgs2_0) { EXPECT_CALL(*gl_, FramebufferTexture2DEXT(_, _, _, _, _)).Times(0); - SpecializedSetup<FramebufferTexture2D, 0>(); + SpecializedSetup<FramebufferTexture2D, 0>(false); FramebufferTexture2D cmd; cmd.Init( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_PROXY_TEXTURE_CUBE_MAP, @@ -870,7 +870,7 @@ TEST_F(GLES2DecoderTest1, FramebufferTexture2DInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, FrontFaceValidArgs) { EXPECT_CALL(*gl_, FrontFace(GL_CW)); - SpecializedSetup<FrontFace, 0>(); + SpecializedSetup<FrontFace, 0>(true); FrontFace cmd; cmd.Init(GL_CW); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -881,7 +881,7 @@ TEST_F(GLES2DecoderTest1, GenBuffersValidArgs) { EXPECT_CALL(*gl_, GenBuffersARB(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; - SpecializedSetup<GenBuffers, 0>(); + SpecializedSetup<GenBuffers, 0>(true); GenBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -892,7 +892,7 @@ TEST_F(GLES2DecoderTest1, GenBuffersValidArgs) { TEST_F(GLES2DecoderTest1, GenBuffersInvalidArgs) { EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0); GetSharedMemoryAs<GLuint*>()[0] = client_buffer_id_; - SpecializedSetup<GenBuffers, 0>(); + SpecializedSetup<GenBuffers, 0>(false); GenBuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); @@ -903,7 +903,7 @@ TEST_F(GLES2DecoderTest1, GenBuffersImmediateValidArgs) { .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); GLuint temp = kNewClientId; - SpecializedSetup<GenBuffersImmediate, 0>(); + SpecializedSetup<GenBuffersImmediate, 0>(true); cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); @@ -914,7 +914,7 @@ TEST_F(GLES2DecoderTest1, GenBuffersImmediateValidArgs) { TEST_F(GLES2DecoderTest1, GenBuffersImmediateInvalidArgs) { EXPECT_CALL(*gl_, GenBuffersARB(_, _)).Times(0); GenBuffersImmediate& cmd = *GetImmediateAs<GenBuffersImmediate>(); - SpecializedSetup<GenBuffersImmediate, 0>(); + SpecializedSetup<GenBuffersImmediate, 0>(false); cmd.Init(1, &client_buffer_id_); EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_buffer_id_))); @@ -922,7 +922,7 @@ TEST_F(GLES2DecoderTest1, GenBuffersImmediateInvalidArgs) { TEST_F(GLES2DecoderTest1, GenerateMipmapValidArgs) { EXPECT_CALL(*gl_, GenerateMipmapEXT(GL_TEXTURE_2D)); - SpecializedSetup<GenerateMipmap, 0>(); + SpecializedSetup<GenerateMipmap, 0>(true); GenerateMipmap cmd; cmd.Init(GL_TEXTURE_2D); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -931,7 +931,7 @@ TEST_F(GLES2DecoderTest1, GenerateMipmapValidArgs) { TEST_F(GLES2DecoderTest1, GenerateMipmapInvalidArgs0_0) { EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); - SpecializedSetup<GenerateMipmap, 0>(); + SpecializedSetup<GenerateMipmap, 0>(false); GenerateMipmap cmd; cmd.Init(GL_TEXTURE_1D); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -940,7 +940,7 @@ TEST_F(GLES2DecoderTest1, GenerateMipmapInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GenerateMipmapInvalidArgs0_1) { EXPECT_CALL(*gl_, GenerateMipmapEXT(_)).Times(0); - SpecializedSetup<GenerateMipmap, 0>(); + SpecializedSetup<GenerateMipmap, 0>(false); GenerateMipmap cmd; cmd.Init(GL_TEXTURE_3D); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -951,7 +951,7 @@ TEST_F(GLES2DecoderTest1, GenFramebuffersValidArgs) { EXPECT_CALL(*gl_, GenFramebuffersEXT(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; - SpecializedSetup<GenFramebuffers, 0>(); + SpecializedSetup<GenFramebuffers, 0>(true); GenFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -962,7 +962,7 @@ TEST_F(GLES2DecoderTest1, GenFramebuffersValidArgs) { TEST_F(GLES2DecoderTest1, GenFramebuffersInvalidArgs) { EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0); GetSharedMemoryAs<GLuint*>()[0] = client_framebuffer_id_; - SpecializedSetup<GenFramebuffers, 0>(); + SpecializedSetup<GenFramebuffers, 0>(false); GenFramebuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); @@ -973,7 +973,7 @@ TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateValidArgs) { .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); GLuint temp = kNewClientId; - SpecializedSetup<GenFramebuffersImmediate, 0>(); + SpecializedSetup<GenFramebuffersImmediate, 0>(true); cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); @@ -984,7 +984,7 @@ TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateValidArgs) { TEST_F(GLES2DecoderTest1, GenFramebuffersImmediateInvalidArgs) { EXPECT_CALL(*gl_, GenFramebuffersEXT(_, _)).Times(0); GenFramebuffersImmediate& cmd = *GetImmediateAs<GenFramebuffersImmediate>(); - SpecializedSetup<GenFramebuffersImmediate, 0>(); + SpecializedSetup<GenFramebuffersImmediate, 0>(false); cmd.Init(1, &client_framebuffer_id_); EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_framebuffer_id_))); @@ -994,7 +994,7 @@ TEST_F(GLES2DecoderTest1, GenRenderbuffersValidArgs) { EXPECT_CALL(*gl_, GenRenderbuffersEXT(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; - SpecializedSetup<GenRenderbuffers, 0>(); + SpecializedSetup<GenRenderbuffers, 0>(true); GenRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1005,7 +1005,7 @@ TEST_F(GLES2DecoderTest1, GenRenderbuffersValidArgs) { TEST_F(GLES2DecoderTest1, GenRenderbuffersInvalidArgs) { EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0); GetSharedMemoryAs<GLuint*>()[0] = client_renderbuffer_id_; - SpecializedSetup<GenRenderbuffers, 0>(); + SpecializedSetup<GenRenderbuffers, 0>(false); GenRenderbuffers cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); @@ -1017,7 +1017,7 @@ TEST_F(GLES2DecoderTest1, GenRenderbuffersImmediateValidArgs) { GenRenderbuffersImmediate& cmd = *GetImmediateAs<GenRenderbuffersImmediate>(); GLuint temp = kNewClientId; - SpecializedSetup<GenRenderbuffersImmediate, 0>(); + SpecializedSetup<GenRenderbuffersImmediate, 0>(true); cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); @@ -1029,7 +1029,7 @@ TEST_F(GLES2DecoderTest1, GenRenderbuffersImmediateInvalidArgs) { EXPECT_CALL(*gl_, GenRenderbuffersEXT(_, _)).Times(0); GenRenderbuffersImmediate& cmd = *GetImmediateAs<GenRenderbuffersImmediate>(); - SpecializedSetup<GenRenderbuffersImmediate, 0>(); + SpecializedSetup<GenRenderbuffersImmediate, 0>(false); cmd.Init(1, &client_renderbuffer_id_); EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_renderbuffer_id_))); @@ -1039,7 +1039,7 @@ TEST_F(GLES2DecoderTest1, GenTexturesValidArgs) { EXPECT_CALL(*gl_, GenTextures(1, _)) .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GetSharedMemoryAs<GLuint*>()[0] = kNewClientId; - SpecializedSetup<GenTextures, 0>(); + SpecializedSetup<GenTextures, 0>(true); GenTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1050,7 +1050,7 @@ TEST_F(GLES2DecoderTest1, GenTexturesValidArgs) { TEST_F(GLES2DecoderTest1, GenTexturesInvalidArgs) { EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0); GetSharedMemoryAs<GLuint*>()[0] = client_texture_id_; - SpecializedSetup<GenTextures, 0>(); + SpecializedSetup<GenTextures, 0>(false); GenTextures cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kInvalidArguments, ExecuteCmd(cmd)); @@ -1061,7 +1061,7 @@ TEST_F(GLES2DecoderTest1, GenTexturesImmediateValidArgs) { .WillOnce(SetArgumentPointee<1>(kNewServiceId)); GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); GLuint temp = kNewClientId; - SpecializedSetup<GenTexturesImmediate, 0>(); + SpecializedSetup<GenTexturesImmediate, 0>(true); cmd.Init(1, &temp); EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp))); @@ -1072,7 +1072,7 @@ TEST_F(GLES2DecoderTest1, GenTexturesImmediateValidArgs) { TEST_F(GLES2DecoderTest1, GenTexturesImmediateInvalidArgs) { EXPECT_CALL(*gl_, GenTextures(_, _)).Times(0); GenTexturesImmediate& cmd = *GetImmediateAs<GenTexturesImmediate>(); - SpecializedSetup<GenTexturesImmediate, 0>(); + SpecializedSetup<GenTexturesImmediate, 0>(false); cmd.Init(1, &client_texture_id_); EXPECT_EQ(error::kInvalidArguments, ExecuteImmediateCmd(cmd, sizeof(&client_texture_id_))); @@ -1095,7 +1095,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetBooleanv, 0>(); + SpecializedSetup<GetBooleanv, 0>(true); typedef GetBooleanv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL(*gl_, GetIntegerv(GL_ACTIVE_TEXTURE, _)); @@ -1111,7 +1111,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvValidArgs) { TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs0_0) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetBooleanv, 0>(); + SpecializedSetup<GetBooleanv, 0>(false); GetBooleanv::Result* result = static_cast<GetBooleanv::Result*>(shared_memory_address_); result->size = 0; @@ -1124,7 +1124,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs1_0) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetBooleanv, 0>(); + SpecializedSetup<GetBooleanv, 0>(false); GetBooleanv::Result* result = static_cast<GetBooleanv::Result*>(shared_memory_address_); result->size = 0; @@ -1136,7 +1136,7 @@ TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, GetBooleanvInvalidArgs1_1) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetBooleanv, 0>(); + SpecializedSetup<GetBooleanv, 0>(false); GetBooleanv::Result* result = static_cast<GetBooleanv::Result*>(shared_memory_address_); result->size = 0; @@ -1151,7 +1151,7 @@ TEST_F(GLES2DecoderTest1, GetBufferParameterivValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetBufferParameteriv, 0>(); + SpecializedSetup<GetBufferParameteriv, 0>(true); typedef GetBufferParameteriv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1171,7 +1171,7 @@ TEST_F(GLES2DecoderTest1, GetBufferParameterivValidArgs) { TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs0_0) { EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetBufferParameteriv, 0>(); + SpecializedSetup<GetBufferParameteriv, 0>(false); GetBufferParameteriv::Result* result = static_cast<GetBufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1186,7 +1186,7 @@ TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs1_0) { EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetBufferParameteriv, 0>(); + SpecializedSetup<GetBufferParameteriv, 0>(false); GetBufferParameteriv::Result* result = static_cast<GetBufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1201,7 +1201,7 @@ TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs2_0) { EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetBufferParameteriv, 0>(); + SpecializedSetup<GetBufferParameteriv, 0>(false); GetBufferParameteriv::Result* result = static_cast<GetBufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1213,7 +1213,7 @@ TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs2_1) { EXPECT_CALL(*gl_, GetBufferParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetBufferParameteriv, 0>(); + SpecializedSetup<GetBufferParameteriv, 0>(false); GetBufferParameteriv::Result* result = static_cast<GetBufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1227,7 +1227,7 @@ TEST_F(GLES2DecoderTest1, GetBufferParameterivInvalidArgs2_1) { TEST_F(GLES2DecoderTest1, GetErrorValidArgs) { EXPECT_CALL(*gl_, GetError()); - SpecializedSetup<GetError, 0>(); + SpecializedSetup<GetError, 0>(true); GetError cmd; cmd.Init(shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1236,7 +1236,7 @@ TEST_F(GLES2DecoderTest1, GetErrorValidArgs) { TEST_F(GLES2DecoderTest1, GetErrorInvalidArgsBadSharedMemoryId) { EXPECT_CALL(*gl_, GetError()).Times(0); - SpecializedSetup<GetError, 0>(); + SpecializedSetup<GetError, 0>(false); GetError cmd; cmd.Init(kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1249,7 +1249,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetFloatv, 0>(); + SpecializedSetup<GetFloatv, 0>(true); typedef GetFloatv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL(*gl_, GetIntegerv(GL_ACTIVE_TEXTURE, _)); @@ -1265,7 +1265,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvValidArgs) { TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs0_0) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetFloatv, 0>(); + SpecializedSetup<GetFloatv, 0>(false); GetFloatv::Result* result = static_cast<GetFloatv::Result*>(shared_memory_address_); result->size = 0; @@ -1278,7 +1278,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs1_0) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetFloatv, 0>(); + SpecializedSetup<GetFloatv, 0>(false); GetFloatv::Result* result = static_cast<GetFloatv::Result*>(shared_memory_address_); result->size = 0; @@ -1290,7 +1290,7 @@ TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, GetFloatvInvalidArgs1_1) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetFloatv, 0>(); + SpecializedSetup<GetFloatv, 0>(false); GetFloatv::Result* result = static_cast<GetFloatv::Result*>(shared_memory_address_); result->size = 0; @@ -1305,7 +1305,7 @@ TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); + SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(true); typedef GetFramebufferAttachmentParameteriv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1328,7 +1328,7 @@ TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivValidArgs) { TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs0_0) { EXPECT_CALL( *gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)).Times(0); - SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); + SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(false); GetFramebufferAttachmentParameteriv::Result* result = static_cast<GetFramebufferAttachmentParameteriv::Result*>( shared_memory_address_); @@ -1346,7 +1346,7 @@ TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs3_0) { EXPECT_CALL( *gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)).Times(0); - SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); + SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(false); GetFramebufferAttachmentParameteriv::Result* result = static_cast<GetFramebufferAttachmentParameteriv::Result*>( shared_memory_address_); @@ -1362,7 +1362,7 @@ TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs3_0) { TEST_F(GLES2DecoderTest1, GetFramebufferAttachmentParameterivInvalidArgs3_1) { EXPECT_CALL( *gl_, GetFramebufferAttachmentParameterivEXT(_, _, _, _)).Times(0); - SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(); + SpecializedSetup<GetFramebufferAttachmentParameteriv, 0>(false); GetFramebufferAttachmentParameteriv::Result* result = static_cast<GetFramebufferAttachmentParameteriv::Result*>( shared_memory_address_); @@ -1381,7 +1381,7 @@ TEST_F(GLES2DecoderTest1, GetIntegervValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetIntegerv, 0>(); + SpecializedSetup<GetIntegerv, 0>(true); typedef GetIntegerv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL(*gl_, GetIntegerv(GL_ACTIVE_TEXTURE, result->GetData())); @@ -1397,7 +1397,7 @@ TEST_F(GLES2DecoderTest1, GetIntegervValidArgs) { TEST_F(GLES2DecoderTest1, GetIntegervInvalidArgs0_0) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetIntegerv, 0>(); + SpecializedSetup<GetIntegerv, 0>(false); GetIntegerv::Result* result = static_cast<GetIntegerv::Result*>(shared_memory_address_); result->size = 0; @@ -1410,7 +1410,7 @@ TEST_F(GLES2DecoderTest1, GetIntegervInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetIntegervInvalidArgs1_0) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetIntegerv, 0>(); + SpecializedSetup<GetIntegerv, 0>(false); GetIntegerv::Result* result = static_cast<GetIntegerv::Result*>(shared_memory_address_); result->size = 0; @@ -1422,7 +1422,7 @@ TEST_F(GLES2DecoderTest1, GetIntegervInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, GetIntegervInvalidArgs1_1) { EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(0); - SpecializedSetup<GetIntegerv, 0>(); + SpecializedSetup<GetIntegerv, 0>(false); GetIntegerv::Result* result = static_cast<GetIntegerv::Result*>(shared_memory_address_); result->size = 0; @@ -1437,7 +1437,7 @@ TEST_F(GLES2DecoderTest1, GetProgramivValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetProgramiv, 0>(); + SpecializedSetup<GetProgramiv, 0>(true); typedef GetProgramiv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1457,7 +1457,7 @@ TEST_F(GLES2DecoderTest1, GetProgramivValidArgs) { TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_0) { EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0); - SpecializedSetup<GetProgramiv, 0>(); + SpecializedSetup<GetProgramiv, 0>(false); GetProgramiv::Result* result = static_cast<GetProgramiv::Result*>(shared_memory_address_); result->size = 0; @@ -1469,7 +1469,7 @@ TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) { EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0); - SpecializedSetup<GetProgramiv, 0>(); + SpecializedSetup<GetProgramiv, 0>(false); GetProgramiv::Result* result = static_cast<GetProgramiv::Result*>(shared_memory_address_); result->size = 0; @@ -1484,7 +1484,7 @@ TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) { TEST_F(GLES2DecoderTest1, GetProgramInfoLogValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; - SpecializedSetup<GetProgramInfoLog, 0>(); + SpecializedSetup<GetProgramInfoLog, 0>(true); EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_INFO_LOG_LENGTH, _)) .WillOnce(SetArgumentPointee<2>(strlen(kInfo))); EXPECT_CALL( @@ -1517,7 +1517,7 @@ TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetRenderbufferParameteriv, 0>(); + SpecializedSetup<GetRenderbufferParameteriv, 0>(true); typedef GetRenderbufferParameteriv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1537,7 +1537,7 @@ TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivValidArgs) { TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivInvalidArgs0_0) { EXPECT_CALL(*gl_, GetRenderbufferParameterivEXT(_, _, _)).Times(0); - SpecializedSetup<GetRenderbufferParameteriv, 0>(); + SpecializedSetup<GetRenderbufferParameteriv, 0>(false); GetRenderbufferParameteriv::Result* result = static_cast<GetRenderbufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1552,7 +1552,7 @@ TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivInvalidArgs2_0) { EXPECT_CALL(*gl_, GetRenderbufferParameterivEXT(_, _, _)).Times(0); - SpecializedSetup<GetRenderbufferParameteriv, 0>(); + SpecializedSetup<GetRenderbufferParameteriv, 0>(false); GetRenderbufferParameteriv::Result* result = static_cast<GetRenderbufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1564,7 +1564,7 @@ TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivInvalidArgs2_1) { EXPECT_CALL(*gl_, GetRenderbufferParameterivEXT(_, _, _)).Times(0); - SpecializedSetup<GetRenderbufferParameteriv, 0>(); + SpecializedSetup<GetRenderbufferParameteriv, 0>(false); GetRenderbufferParameteriv::Result* result = static_cast<GetRenderbufferParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1581,7 +1581,7 @@ TEST_F(GLES2DecoderTest1, GetShaderivValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetShaderiv, 0>(); + SpecializedSetup<GetShaderiv, 0>(true); typedef GetShaderiv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1600,7 +1600,7 @@ TEST_F(GLES2DecoderTest1, GetShaderivValidArgs) { TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_0) { EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0); - SpecializedSetup<GetShaderiv, 0>(); + SpecializedSetup<GetShaderiv, 0>(false); GetShaderiv::Result* result = static_cast<GetShaderiv::Result*>(shared_memory_address_); result->size = 0; @@ -1612,7 +1612,7 @@ TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) { EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0); - SpecializedSetup<GetShaderiv, 0>(); + SpecializedSetup<GetShaderiv, 0>(false); GetShaderiv::Result* result = static_cast<GetShaderiv::Result*>(shared_memory_address_); result->size = 0; @@ -1627,7 +1627,7 @@ TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) { TEST_F(GLES2DecoderTest1, GetShaderInfoLogValidArgs) { const char* kInfo = "hello"; const uint32 kBucketId = 123; - SpecializedSetup<GetShaderInfoLog, 0>(); + SpecializedSetup<GetShaderInfoLog, 0>(true); EXPECT_CALL(*gl_, GetShaderiv(kServiceShaderId, GL_INFO_LOG_LENGTH, _)) .WillOnce(SetArgumentPointee<2>(strlen(kInfo))); EXPECT_CALL( @@ -1665,7 +1665,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterfvValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetTexParameterfv, 0>(); + SpecializedSetup<GetTexParameterfv, 0>(true); typedef GetTexParameterfv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1685,7 +1685,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterfvValidArgs) { TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs0_0) { EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameterfv, 0>(); + SpecializedSetup<GetTexParameterfv, 0>(false); GetTexParameterfv::Result* result = static_cast<GetTexParameterfv::Result*>(shared_memory_address_); result->size = 0; @@ -1700,7 +1700,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs1_0) { EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameterfv, 0>(); + SpecializedSetup<GetTexParameterfv, 0>(false); GetTexParameterfv::Result* result = static_cast<GetTexParameterfv::Result*>(shared_memory_address_); result->size = 0; @@ -1715,7 +1715,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs2_0) { EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameterfv, 0>(); + SpecializedSetup<GetTexParameterfv, 0>(false); GetTexParameterfv::Result* result = static_cast<GetTexParameterfv::Result*>(shared_memory_address_); result->size = 0; @@ -1727,7 +1727,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, GetTexParameterfvInvalidArgs2_1) { EXPECT_CALL(*gl_, GetTexParameterfv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameterfv, 0>(); + SpecializedSetup<GetTexParameterfv, 0>(false); GetTexParameterfv::Result* result = static_cast<GetTexParameterfv::Result*>(shared_memory_address_); result->size = 0; @@ -1744,7 +1744,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterivValidArgs) { .WillOnce(Return(GL_NO_ERROR)) .WillOnce(Return(GL_NO_ERROR)) .RetiresOnSaturation(); - SpecializedSetup<GetTexParameteriv, 0>(); + SpecializedSetup<GetTexParameteriv, 0>(true); typedef GetTexParameteriv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); EXPECT_CALL( @@ -1764,7 +1764,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterivValidArgs) { TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs0_0) { EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameteriv, 0>(); + SpecializedSetup<GetTexParameteriv, 0>(false); GetTexParameteriv::Result* result = static_cast<GetTexParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1779,7 +1779,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs0_0) { TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs1_0) { EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameteriv, 0>(); + SpecializedSetup<GetTexParameteriv, 0>(false); GetTexParameteriv::Result* result = static_cast<GetTexParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1794,7 +1794,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs1_0) { TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs2_0) { EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameteriv, 0>(); + SpecializedSetup<GetTexParameteriv, 0>(false); GetTexParameteriv::Result* result = static_cast<GetTexParameteriv::Result*>(shared_memory_address_); result->size = 0; @@ -1806,7 +1806,7 @@ TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs2_0) { TEST_F(GLES2DecoderTest1, GetTexParameterivInvalidArgs2_1) { EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); - SpecializedSetup<GetTexParameteriv, 0>(); + SpecializedSetup<GetTexParameteriv, 0>(false); GetTexParameteriv::Result* result = static_cast<GetTexParameteriv::Result*>(shared_memory_address_); result->size = 0; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc index 5d7540c..bf89ac7 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2.cc @@ -33,7 +33,7 @@ class GLES2DecoderTest2 : public GLES2DecoderTestBase { }; template <> -void GLES2DecoderTestBase::SpecializedSetup<LinkProgram, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<LinkProgram, 0>(bool /* valid */) { InSequence dummy; EXPECT_CALL(*gl_, GetProgramiv(kServiceProgramId, GL_LINK_STATUS, _)) .WillOnce(SetArgumentPointee<2>(1)); @@ -52,101 +52,136 @@ void GLES2DecoderTestBase::SpecializedSetup<LinkProgram, 0>() { }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform1f, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform1f, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform1fv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform1fv, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform1fvImmediate, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform1fvImmediate, 0>( + bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform2f, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform2f, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform2fv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform2fv, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform2fvImmediate, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform2fvImmediate, 0>( + bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform3f, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform3f, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform3fv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform3fv, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform3fvImmediate, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform3fvImmediate, 0>( + bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform4f, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform4f, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform4fv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform4fv, 0>(bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<Uniform4fvImmediate, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<Uniform4fvImmediate, 0>( + bool /* valid */) { SetupShaderForUniform(); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<RenderbufferStorage, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<RenderbufferStorage, 0>( + bool /* valid */) { DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, kServiceRenderbufferId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<TexParameterf, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<TexParameterf, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<TexParameteri, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<TexParameteri, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<TexParameterfv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<TexParameterfv, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<TexParameterfvImmediate, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<TexParameterfvImmediate, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<TexParameteriv, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<TexParameteriv, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); }; template <> -void GLES2DecoderTestBase::SpecializedSetup<TexParameterivImmediate, 0>() { +void GLES2DecoderTestBase::SpecializedSetup<TexParameterivImmediate, 0>( + bool /* valid */) { DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); }; +template <> +void GLES2DecoderTestBase::SpecializedSetup<GetVertexAttribfv, 0>(bool valid) { + DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); + DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0); + if (valid) { + EXPECT_CALL(*gl_, GetError()) + .WillOnce(Return(GL_NO_ERROR)) + .WillOnce(Return(GL_NO_ERROR)) + .RetiresOnSaturation(); + } +}; + +template <> +void GLES2DecoderTestBase::SpecializedSetup<GetVertexAttribiv, 0>(bool valid) { + DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); + DoVertexAttribPointer(1, 1, GL_FLOAT, 0, 0); + if (valid) { + EXPECT_CALL(*gl_, GetError()) + .WillOnce(Return(GL_NO_ERROR)) + .WillOnce(Return(GL_NO_ERROR)) + .RetiresOnSaturation(); + } +}; + #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h" } // namespace gles2 diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h index 75f237c..6bf4b6d 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h @@ -14,100 +14,84 @@ TEST_F(GLES2DecoderTest2, GetVertexAttribfvValidArgs) { - EXPECT_CALL(*gl_, GetError()) - .WillOnce(Return(GL_NO_ERROR)) - .WillOnce(Return(GL_NO_ERROR)) - .RetiresOnSaturation(); - SpecializedSetup<GetVertexAttribfv, 0>(); + SpecializedSetup<GetVertexAttribfv, 0>(true); typedef GetVertexAttribfv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); - EXPECT_CALL( - *gl_, GetVertexAttribfv( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, result->GetData())); result->size = 0; GetVertexAttribfv cmd; cmd.Init( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, + 1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING), + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED), result->GetNumResults()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } TEST_F(GLES2DecoderTest2, GetVertexAttribfvInvalidArgs2_0) { EXPECT_CALL(*gl_, GetVertexAttribfv(_, _, _)).Times(0); - SpecializedSetup<GetVertexAttribfv, 0>(); + SpecializedSetup<GetVertexAttribfv, 0>(false); GetVertexAttribfv::Result* result = static_cast<GetVertexAttribfv::Result*>(shared_memory_address_); result->size = 0; GetVertexAttribfv cmd; - cmd.Init( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, kInvalidSharedMemoryId, 0); + cmd.Init(1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); EXPECT_EQ(0u, result->size); } TEST_F(GLES2DecoderTest2, GetVertexAttribfvInvalidArgs2_1) { EXPECT_CALL(*gl_, GetVertexAttribfv(_, _, _)).Times(0); - SpecializedSetup<GetVertexAttribfv, 0>(); + SpecializedSetup<GetVertexAttribfv, 0>(false); GetVertexAttribfv::Result* result = static_cast<GetVertexAttribfv::Result*>(shared_memory_address_); result->size = 0; GetVertexAttribfv cmd; cmd.Init( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, + 1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); EXPECT_EQ(0u, result->size); } TEST_F(GLES2DecoderTest2, GetVertexAttribivValidArgs) { - EXPECT_CALL(*gl_, GetError()) - .WillOnce(Return(GL_NO_ERROR)) - .WillOnce(Return(GL_NO_ERROR)) - .RetiresOnSaturation(); - SpecializedSetup<GetVertexAttribiv, 0>(); + SpecializedSetup<GetVertexAttribiv, 0>(true); typedef GetVertexAttribiv::Result Result; Result* result = static_cast<Result*>(shared_memory_address_); - EXPECT_CALL( - *gl_, GetVertexAttribiv( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, result->GetData())); result->size = 0; GetVertexAttribiv cmd; cmd.Init( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, + 1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(decoder_->GetGLES2Util()->GLGetNumValuesReturned( - GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING), + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED), result->GetNumResults()); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } TEST_F(GLES2DecoderTest2, GetVertexAttribivInvalidArgs2_0) { EXPECT_CALL(*gl_, GetVertexAttribiv(_, _, _)).Times(0); - SpecializedSetup<GetVertexAttribiv, 0>(); + SpecializedSetup<GetVertexAttribiv, 0>(false); GetVertexAttribiv::Result* result = static_cast<GetVertexAttribiv::Result*>(shared_memory_address_); result->size = 0; GetVertexAttribiv cmd; - cmd.Init( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, kInvalidSharedMemoryId, 0); + cmd.Init(1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); EXPECT_EQ(0u, result->size); } TEST_F(GLES2DecoderTest2, GetVertexAttribivInvalidArgs2_1) { EXPECT_CALL(*gl_, GetVertexAttribiv(_, _, _)).Times(0); - SpecializedSetup<GetVertexAttribiv, 0>(); + SpecializedSetup<GetVertexAttribiv, 0>(false); GetVertexAttribiv::Result* result = static_cast<GetVertexAttribiv::Result*>(shared_memory_address_); result->size = 0; GetVertexAttribiv cmd; cmd.Init( - 1, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, shared_memory_id_, + 1, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); EXPECT_EQ(0u, result->size); @@ -117,7 +101,7 @@ TEST_F(GLES2DecoderTest2, GetVertexAttribivInvalidArgs2_1) { TEST_F(GLES2DecoderTest2, HintValidArgs) { EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST)); - SpecializedSetup<Hint, 0>(); + SpecializedSetup<Hint, 0>(true); Hint cmd; cmd.Init(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -126,7 +110,7 @@ TEST_F(GLES2DecoderTest2, HintValidArgs) { TEST_F(GLES2DecoderTest2, HintInvalidArgs0_0) { EXPECT_CALL(*gl_, Hint(_, _)).Times(0); - SpecializedSetup<Hint, 0>(); + SpecializedSetup<Hint, 0>(false); Hint cmd; cmd.Init(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -134,7 +118,7 @@ TEST_F(GLES2DecoderTest2, HintInvalidArgs0_0) { } TEST_F(GLES2DecoderTest2, IsBufferValidArgs) { - SpecializedSetup<IsBuffer, 0>(); + SpecializedSetup<IsBuffer, 0>(true); IsBuffer cmd; cmd.Init(client_buffer_id_, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -142,7 +126,7 @@ TEST_F(GLES2DecoderTest2, IsBufferValidArgs) { } TEST_F(GLES2DecoderTest2, IsBufferInvalidArgsBadSharedMemoryId) { - SpecializedSetup<IsBuffer, 0>(); + SpecializedSetup<IsBuffer, 0>(false); IsBuffer cmd; cmd.Init(client_buffer_id_, kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -152,7 +136,7 @@ TEST_F(GLES2DecoderTest2, IsBufferInvalidArgsBadSharedMemoryId) { TEST_F(GLES2DecoderTest2, IsEnabledValidArgs) { EXPECT_CALL(*gl_, IsEnabled(GL_BLEND)); - SpecializedSetup<IsEnabled, 0>(); + SpecializedSetup<IsEnabled, 0>(true); IsEnabled cmd; cmd.Init(GL_BLEND, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -161,7 +145,7 @@ TEST_F(GLES2DecoderTest2, IsEnabledValidArgs) { TEST_F(GLES2DecoderTest2, IsEnabledInvalidArgs0_0) { EXPECT_CALL(*gl_, IsEnabled(_)).Times(0); - SpecializedSetup<IsEnabled, 0>(); + SpecializedSetup<IsEnabled, 0>(false); IsEnabled cmd; cmd.Init(GL_CLIP_PLANE0, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -170,7 +154,7 @@ TEST_F(GLES2DecoderTest2, IsEnabledInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, IsEnabledInvalidArgs0_1) { EXPECT_CALL(*gl_, IsEnabled(_)).Times(0); - SpecializedSetup<IsEnabled, 0>(); + SpecializedSetup<IsEnabled, 0>(false); IsEnabled cmd; cmd.Init(GL_POINT_SPRITE, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -179,7 +163,7 @@ TEST_F(GLES2DecoderTest2, IsEnabledInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, IsEnabledInvalidArgsBadSharedMemoryId) { EXPECT_CALL(*gl_, IsEnabled(GL_BLEND)).Times(0); - SpecializedSetup<IsEnabled, 0>(); + SpecializedSetup<IsEnabled, 0>(false); IsEnabled cmd; cmd.Init(GL_BLEND, kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -188,7 +172,7 @@ TEST_F(GLES2DecoderTest2, IsEnabledInvalidArgsBadSharedMemoryId) { } TEST_F(GLES2DecoderTest2, IsFramebufferValidArgs) { - SpecializedSetup<IsFramebuffer, 0>(); + SpecializedSetup<IsFramebuffer, 0>(true); IsFramebuffer cmd; cmd.Init(client_framebuffer_id_, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -196,7 +180,7 @@ TEST_F(GLES2DecoderTest2, IsFramebufferValidArgs) { } TEST_F(GLES2DecoderTest2, IsFramebufferInvalidArgsBadSharedMemoryId) { - SpecializedSetup<IsFramebuffer, 0>(); + SpecializedSetup<IsFramebuffer, 0>(false); IsFramebuffer cmd; cmd.Init( client_framebuffer_id_, kInvalidSharedMemoryId, shared_memory_offset_); @@ -207,7 +191,7 @@ TEST_F(GLES2DecoderTest2, IsFramebufferInvalidArgsBadSharedMemoryId) { } TEST_F(GLES2DecoderTest2, IsProgramValidArgs) { - SpecializedSetup<IsProgram, 0>(); + SpecializedSetup<IsProgram, 0>(true); IsProgram cmd; cmd.Init(client_program_id_, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -215,7 +199,7 @@ TEST_F(GLES2DecoderTest2, IsProgramValidArgs) { } TEST_F(GLES2DecoderTest2, IsProgramInvalidArgsBadSharedMemoryId) { - SpecializedSetup<IsProgram, 0>(); + SpecializedSetup<IsProgram, 0>(false); IsProgram cmd; cmd.Init(client_program_id_, kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -224,7 +208,7 @@ TEST_F(GLES2DecoderTest2, IsProgramInvalidArgsBadSharedMemoryId) { } TEST_F(GLES2DecoderTest2, IsRenderbufferValidArgs) { - SpecializedSetup<IsRenderbuffer, 0>(); + SpecializedSetup<IsRenderbuffer, 0>(true); IsRenderbuffer cmd; cmd.Init(client_renderbuffer_id_, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -232,7 +216,7 @@ TEST_F(GLES2DecoderTest2, IsRenderbufferValidArgs) { } TEST_F(GLES2DecoderTest2, IsRenderbufferInvalidArgsBadSharedMemoryId) { - SpecializedSetup<IsRenderbuffer, 0>(); + SpecializedSetup<IsRenderbuffer, 0>(false); IsRenderbuffer cmd; cmd.Init( client_renderbuffer_id_, kInvalidSharedMemoryId, shared_memory_offset_); @@ -243,7 +227,7 @@ TEST_F(GLES2DecoderTest2, IsRenderbufferInvalidArgsBadSharedMemoryId) { } TEST_F(GLES2DecoderTest2, IsShaderValidArgs) { - SpecializedSetup<IsShader, 0>(); + SpecializedSetup<IsShader, 0>(true); IsShader cmd; cmd.Init(client_shader_id_, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -251,7 +235,7 @@ TEST_F(GLES2DecoderTest2, IsShaderValidArgs) { } TEST_F(GLES2DecoderTest2, IsShaderInvalidArgsBadSharedMemoryId) { - SpecializedSetup<IsShader, 0>(); + SpecializedSetup<IsShader, 0>(false); IsShader cmd; cmd.Init(client_shader_id_, kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -260,7 +244,7 @@ TEST_F(GLES2DecoderTest2, IsShaderInvalidArgsBadSharedMemoryId) { } TEST_F(GLES2DecoderTest2, IsTextureValidArgs) { - SpecializedSetup<IsTexture, 0>(); + SpecializedSetup<IsTexture, 0>(true); IsTexture cmd; cmd.Init(client_texture_id_, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -268,7 +252,7 @@ TEST_F(GLES2DecoderTest2, IsTextureValidArgs) { } TEST_F(GLES2DecoderTest2, IsTextureInvalidArgsBadSharedMemoryId) { - SpecializedSetup<IsTexture, 0>(); + SpecializedSetup<IsTexture, 0>(false); IsTexture cmd; cmd.Init(client_texture_id_, kInvalidSharedMemoryId, shared_memory_offset_); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -278,7 +262,7 @@ TEST_F(GLES2DecoderTest2, IsTextureInvalidArgsBadSharedMemoryId) { TEST_F(GLES2DecoderTest2, LineWidthValidArgs) { EXPECT_CALL(*gl_, LineWidth(1)); - SpecializedSetup<LineWidth, 0>(); + SpecializedSetup<LineWidth, 0>(true); LineWidth cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -287,7 +271,7 @@ TEST_F(GLES2DecoderTest2, LineWidthValidArgs) { TEST_F(GLES2DecoderTest2, LinkProgramValidArgs) { EXPECT_CALL(*gl_, LinkProgram(kServiceProgramId)); - SpecializedSetup<LinkProgram, 0>(); + SpecializedSetup<LinkProgram, 0>(true); LinkProgram cmd; cmd.Init(client_program_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -298,7 +282,7 @@ TEST_F(GLES2DecoderTest2, LinkProgramValidArgs) { TEST_F(GLES2DecoderTest2, PolygonOffsetValidArgs) { EXPECT_CALL(*gl_, PolygonOffset(1, 2)); - SpecializedSetup<PolygonOffset, 0>(); + SpecializedSetup<PolygonOffset, 0>(true); PolygonOffset cmd; cmd.Init(1, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -310,7 +294,7 @@ TEST_F(GLES2DecoderTest2, PolygonOffsetValidArgs) { TEST_F(GLES2DecoderTest2, RenderbufferStorageValidArgs) { EXPECT_CALL(*gl_, RenderbufferStorageEXT(GL_RENDERBUFFER, GL_RGBA4, 3, 4)); - SpecializedSetup<RenderbufferStorage, 0>(); + SpecializedSetup<RenderbufferStorage, 0>(true); RenderbufferStorage cmd; cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -319,7 +303,7 @@ TEST_F(GLES2DecoderTest2, RenderbufferStorageValidArgs) { TEST_F(GLES2DecoderTest2, RenderbufferStorageInvalidArgs0_0) { EXPECT_CALL(*gl_, RenderbufferStorageEXT(_, _, _, _)).Times(0); - SpecializedSetup<RenderbufferStorage, 0>(); + SpecializedSetup<RenderbufferStorage, 0>(false); RenderbufferStorage cmd; cmd.Init(GL_FRAMEBUFFER, GL_RGBA4, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -328,7 +312,7 @@ TEST_F(GLES2DecoderTest2, RenderbufferStorageInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, RenderbufferStorageInvalidArgs2_0) { EXPECT_CALL(*gl_, RenderbufferStorageEXT(_, _, _, _)).Times(0); - SpecializedSetup<RenderbufferStorage, 0>(); + SpecializedSetup<RenderbufferStorage, 0>(false); RenderbufferStorage cmd; cmd.Init(GL_RENDERBUFFER, GL_RGBA4, -1, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -337,7 +321,7 @@ TEST_F(GLES2DecoderTest2, RenderbufferStorageInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, RenderbufferStorageInvalidArgs3_0) { EXPECT_CALL(*gl_, RenderbufferStorageEXT(_, _, _, _)).Times(0); - SpecializedSetup<RenderbufferStorage, 0>(); + SpecializedSetup<RenderbufferStorage, 0>(false); RenderbufferStorage cmd; cmd.Init(GL_RENDERBUFFER, GL_RGBA4, 3, -1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -346,7 +330,7 @@ TEST_F(GLES2DecoderTest2, RenderbufferStorageInvalidArgs3_0) { TEST_F(GLES2DecoderTest2, SampleCoverageValidArgs) { EXPECT_CALL(*gl_, SampleCoverage(1, 2)); - SpecializedSetup<SampleCoverage, 0>(); + SpecializedSetup<SampleCoverage, 0>(true); SampleCoverage cmd; cmd.Init(1, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -355,7 +339,7 @@ TEST_F(GLES2DecoderTest2, SampleCoverageValidArgs) { TEST_F(GLES2DecoderTest2, ScissorValidArgs) { EXPECT_CALL(*gl_, Scissor(1, 2, 3, 4)); - SpecializedSetup<Scissor, 0>(); + SpecializedSetup<Scissor, 0>(true); Scissor cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -364,7 +348,7 @@ TEST_F(GLES2DecoderTest2, ScissorValidArgs) { TEST_F(GLES2DecoderTest2, ScissorInvalidArgs2_0) { EXPECT_CALL(*gl_, Scissor(_, _, _, _)).Times(0); - SpecializedSetup<Scissor, 0>(); + SpecializedSetup<Scissor, 0>(false); Scissor cmd; cmd.Init(1, 2, -1, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -373,7 +357,7 @@ TEST_F(GLES2DecoderTest2, ScissorInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, ScissorInvalidArgs3_0) { EXPECT_CALL(*gl_, Scissor(_, _, _, _)).Times(0); - SpecializedSetup<Scissor, 0>(); + SpecializedSetup<Scissor, 0>(false); Scissor cmd; cmd.Init(1, 2, 3, -1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -389,7 +373,7 @@ TEST_F(GLES2DecoderTest2, ScissorInvalidArgs3_0) { TEST_F(GLES2DecoderTest2, StencilFuncValidArgs) { EXPECT_CALL(*gl_, StencilFunc(GL_NEVER, 2, 3)); - SpecializedSetup<StencilFunc, 0>(); + SpecializedSetup<StencilFunc, 0>(true); StencilFunc cmd; cmd.Init(GL_NEVER, 2, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -398,7 +382,7 @@ TEST_F(GLES2DecoderTest2, StencilFuncValidArgs) { TEST_F(GLES2DecoderTest2, StencilFuncSeparateValidArgs) { EXPECT_CALL(*gl_, StencilFuncSeparate(GL_FRONT, GL_NEVER, 3, 4)); - SpecializedSetup<StencilFuncSeparate, 0>(); + SpecializedSetup<StencilFuncSeparate, 0>(true); StencilFuncSeparate cmd; cmd.Init(GL_FRONT, GL_NEVER, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -407,7 +391,7 @@ TEST_F(GLES2DecoderTest2, StencilFuncSeparateValidArgs) { TEST_F(GLES2DecoderTest2, StencilMaskValidArgs) { EXPECT_CALL(*gl_, StencilMask(1)); - SpecializedSetup<StencilMask, 0>(); + SpecializedSetup<StencilMask, 0>(true); StencilMask cmd; cmd.Init(1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -416,7 +400,7 @@ TEST_F(GLES2DecoderTest2, StencilMaskValidArgs) { TEST_F(GLES2DecoderTest2, StencilMaskSeparateValidArgs) { EXPECT_CALL(*gl_, StencilMaskSeparate(GL_FRONT, 2)); - SpecializedSetup<StencilMaskSeparate, 0>(); + SpecializedSetup<StencilMaskSeparate, 0>(true); StencilMaskSeparate cmd; cmd.Init(GL_FRONT, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -425,7 +409,7 @@ TEST_F(GLES2DecoderTest2, StencilMaskSeparateValidArgs) { TEST_F(GLES2DecoderTest2, StencilOpValidArgs) { EXPECT_CALL(*gl_, StencilOp(GL_KEEP, GL_KEEP, GL_KEEP)); - SpecializedSetup<StencilOp, 0>(); + SpecializedSetup<StencilOp, 0>(true); StencilOp cmd; cmd.Init(GL_KEEP, GL_KEEP, GL_KEEP); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -434,7 +418,7 @@ TEST_F(GLES2DecoderTest2, StencilOpValidArgs) { TEST_F(GLES2DecoderTest2, StencilOpSeparateValidArgs) { EXPECT_CALL(*gl_, StencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP)); - SpecializedSetup<StencilOpSeparate, 0>(); + SpecializedSetup<StencilOpSeparate, 0>(true); StencilOpSeparate cmd; cmd.Init(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -447,7 +431,7 @@ TEST_F(GLES2DecoderTest2, StencilOpSeparateValidArgs) { TEST_F(GLES2DecoderTest2, TexParameterfValidArgs) { EXPECT_CALL(*gl_, TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3)); - SpecializedSetup<TexParameterf, 0>(); + SpecializedSetup<TexParameterf, 0>(true); TexParameterf cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -456,7 +440,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfValidArgs) { TEST_F(GLES2DecoderTest2, TexParameterfInvalidArgs0_0) { EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0); - SpecializedSetup<TexParameterf, 0>(); + SpecializedSetup<TexParameterf, 0>(false); TexParameterf cmd; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -465,7 +449,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, TexParameterfInvalidArgs0_1) { EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0); - SpecializedSetup<TexParameterf, 0>(); + SpecializedSetup<TexParameterf, 0>(false); TexParameterf cmd; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -474,7 +458,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, TexParameterfInvalidArgs1_0) { EXPECT_CALL(*gl_, TexParameterf(_, _, _)).Times(0); - SpecializedSetup<TexParameterf, 0>(); + SpecializedSetup<TexParameterf, 0>(false); TexParameterf cmd; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -486,7 +470,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvValidArgs) { *gl_, TexParameterfv( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<TexParameterfv, 0>(); + SpecializedSetup<TexParameterfv, 0>(true); TexParameterfv cmd; cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -497,7 +481,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvValidArgs) { TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs0_0) { EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfv, 0>(); + SpecializedSetup<TexParameterfv, 0>(false); TexParameterfv cmd; cmd.Init( GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -508,7 +492,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs0_1) { EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfv, 0>(); + SpecializedSetup<TexParameterfv, 0>(false); TexParameterfv cmd; cmd.Init( GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -519,7 +503,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs1_0) { EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfv, 0>(); + SpecializedSetup<TexParameterfv, 0>(false); TexParameterfv cmd; cmd.Init( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, @@ -530,7 +514,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs2_0) { EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfv, 0>(); + SpecializedSetup<TexParameterfv, 0>(false); TexParameterfv cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -538,7 +522,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, TexParameterfvInvalidArgs2_1) { EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfv, 0>(); + SpecializedSetup<TexParameterfv, 0>(false); TexParameterfv cmd; cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -552,7 +536,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvImmediateValidArgs) { *gl_, TexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<TexParameterfvImmediate, 0>(); + SpecializedSetup<TexParameterfvImmediate, 0>(true); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]); EXPECT_EQ(error::kNoError, @@ -563,7 +547,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs0_0) { TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfvImmediate, 0>(); + SpecializedSetup<TexParameterfvImmediate, 0>(false); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]); EXPECT_EQ(error::kNoError, @@ -574,7 +558,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs0_1) { TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfvImmediate, 0>(); + SpecializedSetup<TexParameterfvImmediate, 0>(false); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]); EXPECT_EQ(error::kNoError, @@ -585,7 +569,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs1_0) { TexParameterfvImmediate& cmd = *GetImmediateAs<TexParameterfvImmediate>(); EXPECT_CALL(*gl_, TexParameterfv(_, _, _)).Times(0); - SpecializedSetup<TexParameterfvImmediate, 0>(); + SpecializedSetup<TexParameterfvImmediate, 0>(false); GLfloat temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]); EXPECT_EQ(error::kNoError, @@ -595,7 +579,7 @@ TEST_F(GLES2DecoderTest2, TexParameterfvImmediateInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, TexParameteriValidArgs) { EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3)); - SpecializedSetup<TexParameteri, 0>(); + SpecializedSetup<TexParameteri, 0>(true); TexParameteri cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -604,7 +588,7 @@ TEST_F(GLES2DecoderTest2, TexParameteriValidArgs) { TEST_F(GLES2DecoderTest2, TexParameteriInvalidArgs0_0) { EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0); - SpecializedSetup<TexParameteri, 0>(); + SpecializedSetup<TexParameteri, 0>(false); TexParameteri cmd; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -613,7 +597,7 @@ TEST_F(GLES2DecoderTest2, TexParameteriInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, TexParameteriInvalidArgs0_1) { EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0); - SpecializedSetup<TexParameteri, 0>(); + SpecializedSetup<TexParameteri, 0>(false); TexParameteri cmd; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -622,7 +606,7 @@ TEST_F(GLES2DecoderTest2, TexParameteriInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, TexParameteriInvalidArgs1_0) { EXPECT_CALL(*gl_, TexParameteri(_, _, _)).Times(0); - SpecializedSetup<TexParameteri, 0>(); + SpecializedSetup<TexParameteri, 0>(false); TexParameteri cmd; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -634,7 +618,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivValidArgs) { *gl_, TexParameteriv( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<const GLint*>( shared_memory_address_))); - SpecializedSetup<TexParameteriv, 0>(); + SpecializedSetup<TexParameteriv, 0>(true); TexParameteriv cmd; cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -645,7 +629,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivValidArgs) { TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs0_0) { EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameteriv, 0>(); + SpecializedSetup<TexParameteriv, 0>(false); TexParameteriv cmd; cmd.Init( GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -656,7 +640,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs0_1) { EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameteriv, 0>(); + SpecializedSetup<TexParameteriv, 0>(false); TexParameteriv cmd; cmd.Init( GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -667,7 +651,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs1_0) { EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameteriv, 0>(); + SpecializedSetup<TexParameteriv, 0>(false); TexParameteriv cmd; cmd.Init( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, shared_memory_id_, @@ -678,7 +662,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs2_0) { EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameteriv, 0>(); + SpecializedSetup<TexParameteriv, 0>(false); TexParameteriv cmd; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -686,7 +670,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, TexParameterivInvalidArgs2_1) { EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameteriv, 0>(); + SpecializedSetup<TexParameteriv, 0>(false); TexParameteriv cmd; cmd.Init( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, @@ -700,7 +684,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivImmediateValidArgs) { *gl_, TexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<TexParameterivImmediate, 0>(); + SpecializedSetup<TexParameterivImmediate, 0>(true); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &temp[0]); EXPECT_EQ(error::kNoError, @@ -711,7 +695,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivImmediateValidArgs) { TEST_F(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs0_0) { TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameterivImmediate, 0>(); + SpecializedSetup<TexParameterivImmediate, 0>(false); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, &temp[0]); EXPECT_EQ(error::kNoError, @@ -722,7 +706,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs0_0) { TEST_F(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs0_1) { TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameterivImmediate, 0>(); + SpecializedSetup<TexParameterivImmediate, 0>(false); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, &temp[0]); EXPECT_EQ(error::kNoError, @@ -733,7 +717,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs0_1) { TEST_F(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs1_0) { TexParameterivImmediate& cmd = *GetImmediateAs<TexParameterivImmediate>(); EXPECT_CALL(*gl_, TexParameteriv(_, _, _)).Times(0); - SpecializedSetup<TexParameterivImmediate, 0>(); + SpecializedSetup<TexParameterivImmediate, 0>(false); GLint temp[1] = { 0, }; cmd.Init(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, &temp[0]); EXPECT_EQ(error::kNoError, @@ -747,7 +731,7 @@ TEST_F(GLES2DecoderTest2, TexParameterivImmediateInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform1fValidArgs) { EXPECT_CALL(*gl_, Uniform1fv(1, 1, _)); - SpecializedSetup<Uniform1f, 0>(); + SpecializedSetup<Uniform1f, 0>(true); Uniform1f cmd; cmd.Init(1, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -758,7 +742,7 @@ TEST_F(GLES2DecoderTest2, Uniform1fvValidArgs) { EXPECT_CALL( *gl_, Uniform1fv( 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<Uniform1fv, 0>(); + SpecializedSetup<Uniform1fv, 0>(true); Uniform1fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -767,7 +751,7 @@ TEST_F(GLES2DecoderTest2, Uniform1fvValidArgs) { TEST_F(GLES2DecoderTest2, Uniform1fvInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform1fv(_, _, _)).Times(0); - SpecializedSetup<Uniform1fv, 0>(); + SpecializedSetup<Uniform1fv, 0>(false); Uniform1fv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -776,7 +760,7 @@ TEST_F(GLES2DecoderTest2, Uniform1fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform1fvInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform1fv(_, _, _)).Times(0); - SpecializedSetup<Uniform1fv, 0>(); + SpecializedSetup<Uniform1fv, 0>(false); Uniform1fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -784,7 +768,7 @@ TEST_F(GLES2DecoderTest2, Uniform1fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform1fvInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform1fv(_, _, _)).Times(0); - SpecializedSetup<Uniform1fv, 0>(); + SpecializedSetup<Uniform1fv, 0>(false); Uniform1fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -796,7 +780,7 @@ TEST_F(GLES2DecoderTest2, Uniform1fvImmediateValidArgs) { *gl_, Uniform1fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform1fvImmediate, 0>(); + SpecializedSetup<Uniform1fvImmediate, 0>(true); GLfloat temp[1 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -809,7 +793,7 @@ TEST_F(GLES2DecoderTest2, Uniform1fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, Uniform2fValidArgs) { EXPECT_CALL(*gl_, Uniform2fv(1, 1, _)); - SpecializedSetup<Uniform2f, 0>(); + SpecializedSetup<Uniform2f, 0>(true); Uniform2f cmd; cmd.Init(1, 2, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -820,7 +804,7 @@ TEST_F(GLES2DecoderTest2, Uniform2fvValidArgs) { EXPECT_CALL( *gl_, Uniform2fv( 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<Uniform2fv, 0>(); + SpecializedSetup<Uniform2fv, 0>(true); Uniform2fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -829,7 +813,7 @@ TEST_F(GLES2DecoderTest2, Uniform2fvValidArgs) { TEST_F(GLES2DecoderTest2, Uniform2fvInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform2fv(_, _, _)).Times(0); - SpecializedSetup<Uniform2fv, 0>(); + SpecializedSetup<Uniform2fv, 0>(false); Uniform2fv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -838,7 +822,7 @@ TEST_F(GLES2DecoderTest2, Uniform2fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform2fvInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform2fv(_, _, _)).Times(0); - SpecializedSetup<Uniform2fv, 0>(); + SpecializedSetup<Uniform2fv, 0>(false); Uniform2fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -846,7 +830,7 @@ TEST_F(GLES2DecoderTest2, Uniform2fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform2fvInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform2fv(_, _, _)).Times(0); - SpecializedSetup<Uniform2fv, 0>(); + SpecializedSetup<Uniform2fv, 0>(false); Uniform2fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -858,7 +842,7 @@ TEST_F(GLES2DecoderTest2, Uniform2fvImmediateValidArgs) { *gl_, Uniform2fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform2fvImmediate, 0>(); + SpecializedSetup<Uniform2fvImmediate, 0>(true); GLfloat temp[2 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -868,7 +852,7 @@ TEST_F(GLES2DecoderTest2, Uniform2fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, Uniform2iValidArgs) { EXPECT_CALL(*gl_, Uniform2i(1, 2, 3)); - SpecializedSetup<Uniform2i, 0>(); + SpecializedSetup<Uniform2i, 0>(true); Uniform2i cmd; cmd.Init(1, 2, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -879,7 +863,7 @@ TEST_F(GLES2DecoderTest2, Uniform2ivValidArgs) { EXPECT_CALL( *gl_, Uniform2iv( 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); - SpecializedSetup<Uniform2iv, 0>(); + SpecializedSetup<Uniform2iv, 0>(true); Uniform2iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -888,7 +872,7 @@ TEST_F(GLES2DecoderTest2, Uniform2ivValidArgs) { TEST_F(GLES2DecoderTest2, Uniform2ivInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform2iv(_, _, _)).Times(0); - SpecializedSetup<Uniform2iv, 0>(); + SpecializedSetup<Uniform2iv, 0>(false); Uniform2iv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -897,7 +881,7 @@ TEST_F(GLES2DecoderTest2, Uniform2ivInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform2ivInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform2iv(_, _, _)).Times(0); - SpecializedSetup<Uniform2iv, 0>(); + SpecializedSetup<Uniform2iv, 0>(false); Uniform2iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -905,7 +889,7 @@ TEST_F(GLES2DecoderTest2, Uniform2ivInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform2ivInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform2iv(_, _, _)).Times(0); - SpecializedSetup<Uniform2iv, 0>(); + SpecializedSetup<Uniform2iv, 0>(false); Uniform2iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -917,7 +901,7 @@ TEST_F(GLES2DecoderTest2, Uniform2ivImmediateValidArgs) { *gl_, Uniform2iv(1, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform2ivImmediate, 0>(); + SpecializedSetup<Uniform2ivImmediate, 0>(true); GLint temp[2 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -927,7 +911,7 @@ TEST_F(GLES2DecoderTest2, Uniform2ivImmediateValidArgs) { TEST_F(GLES2DecoderTest2, Uniform3fValidArgs) { EXPECT_CALL(*gl_, Uniform3fv(1, 1, _)); - SpecializedSetup<Uniform3f, 0>(); + SpecializedSetup<Uniform3f, 0>(true); Uniform3f cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -938,7 +922,7 @@ TEST_F(GLES2DecoderTest2, Uniform3fvValidArgs) { EXPECT_CALL( *gl_, Uniform3fv( 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<Uniform3fv, 0>(); + SpecializedSetup<Uniform3fv, 0>(true); Uniform3fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -947,7 +931,7 @@ TEST_F(GLES2DecoderTest2, Uniform3fvValidArgs) { TEST_F(GLES2DecoderTest2, Uniform3fvInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform3fv(_, _, _)).Times(0); - SpecializedSetup<Uniform3fv, 0>(); + SpecializedSetup<Uniform3fv, 0>(false); Uniform3fv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -956,7 +940,7 @@ TEST_F(GLES2DecoderTest2, Uniform3fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform3fvInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform3fv(_, _, _)).Times(0); - SpecializedSetup<Uniform3fv, 0>(); + SpecializedSetup<Uniform3fv, 0>(false); Uniform3fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -964,7 +948,7 @@ TEST_F(GLES2DecoderTest2, Uniform3fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform3fvInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform3fv(_, _, _)).Times(0); - SpecializedSetup<Uniform3fv, 0>(); + SpecializedSetup<Uniform3fv, 0>(false); Uniform3fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -976,7 +960,7 @@ TEST_F(GLES2DecoderTest2, Uniform3fvImmediateValidArgs) { *gl_, Uniform3fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform3fvImmediate, 0>(); + SpecializedSetup<Uniform3fvImmediate, 0>(true); GLfloat temp[3 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -986,7 +970,7 @@ TEST_F(GLES2DecoderTest2, Uniform3fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, Uniform3iValidArgs) { EXPECT_CALL(*gl_, Uniform3i(1, 2, 3, 4)); - SpecializedSetup<Uniform3i, 0>(); + SpecializedSetup<Uniform3i, 0>(true); Uniform3i cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -997,7 +981,7 @@ TEST_F(GLES2DecoderTest2, Uniform3ivValidArgs) { EXPECT_CALL( *gl_, Uniform3iv( 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); - SpecializedSetup<Uniform3iv, 0>(); + SpecializedSetup<Uniform3iv, 0>(true); Uniform3iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1006,7 +990,7 @@ TEST_F(GLES2DecoderTest2, Uniform3ivValidArgs) { TEST_F(GLES2DecoderTest2, Uniform3ivInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform3iv(_, _, _)).Times(0); - SpecializedSetup<Uniform3iv, 0>(); + SpecializedSetup<Uniform3iv, 0>(false); Uniform3iv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1015,7 +999,7 @@ TEST_F(GLES2DecoderTest2, Uniform3ivInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform3ivInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform3iv(_, _, _)).Times(0); - SpecializedSetup<Uniform3iv, 0>(); + SpecializedSetup<Uniform3iv, 0>(false); Uniform3iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1023,7 +1007,7 @@ TEST_F(GLES2DecoderTest2, Uniform3ivInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform3ivInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform3iv(_, _, _)).Times(0); - SpecializedSetup<Uniform3iv, 0>(); + SpecializedSetup<Uniform3iv, 0>(false); Uniform3iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1035,7 +1019,7 @@ TEST_F(GLES2DecoderTest2, Uniform3ivImmediateValidArgs) { *gl_, Uniform3iv(1, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform3ivImmediate, 0>(); + SpecializedSetup<Uniform3ivImmediate, 0>(true); GLint temp[3 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1045,7 +1029,7 @@ TEST_F(GLES2DecoderTest2, Uniform3ivImmediateValidArgs) { TEST_F(GLES2DecoderTest2, Uniform4fValidArgs) { EXPECT_CALL(*gl_, Uniform4fv(1, 1, _)); - SpecializedSetup<Uniform4f, 0>(); + SpecializedSetup<Uniform4f, 0>(true); Uniform4f cmd; cmd.Init(1, 2, 3, 4, 5); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1056,7 +1040,7 @@ TEST_F(GLES2DecoderTest2, Uniform4fvValidArgs) { EXPECT_CALL( *gl_, Uniform4fv( 1, 2, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<Uniform4fv, 0>(); + SpecializedSetup<Uniform4fv, 0>(true); Uniform4fv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1065,7 +1049,7 @@ TEST_F(GLES2DecoderTest2, Uniform4fvValidArgs) { TEST_F(GLES2DecoderTest2, Uniform4fvInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform4fv(_, _, _)).Times(0); - SpecializedSetup<Uniform4fv, 0>(); + SpecializedSetup<Uniform4fv, 0>(false); Uniform4fv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1074,7 +1058,7 @@ TEST_F(GLES2DecoderTest2, Uniform4fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform4fvInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform4fv(_, _, _)).Times(0); - SpecializedSetup<Uniform4fv, 0>(); + SpecializedSetup<Uniform4fv, 0>(false); Uniform4fv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1082,7 +1066,7 @@ TEST_F(GLES2DecoderTest2, Uniform4fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform4fvInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform4fv(_, _, _)).Times(0); - SpecializedSetup<Uniform4fv, 0>(); + SpecializedSetup<Uniform4fv, 0>(false); Uniform4fv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1094,7 +1078,7 @@ TEST_F(GLES2DecoderTest2, Uniform4fvImmediateValidArgs) { *gl_, Uniform4fv(1, 2, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform4fvImmediate, 0>(); + SpecializedSetup<Uniform4fvImmediate, 0>(true); GLfloat temp[4 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1104,7 +1088,7 @@ TEST_F(GLES2DecoderTest2, Uniform4fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, Uniform4iValidArgs) { EXPECT_CALL(*gl_, Uniform4i(1, 2, 3, 4, 5)); - SpecializedSetup<Uniform4i, 0>(); + SpecializedSetup<Uniform4i, 0>(true); Uniform4i cmd; cmd.Init(1, 2, 3, 4, 5); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1115,7 +1099,7 @@ TEST_F(GLES2DecoderTest2, Uniform4ivValidArgs) { EXPECT_CALL( *gl_, Uniform4iv( 1, 2, reinterpret_cast<const GLint*>(shared_memory_address_))); - SpecializedSetup<Uniform4iv, 0>(); + SpecializedSetup<Uniform4iv, 0>(true); Uniform4iv cmd; cmd.Init(1, 2, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1124,7 +1108,7 @@ TEST_F(GLES2DecoderTest2, Uniform4ivValidArgs) { TEST_F(GLES2DecoderTest2, Uniform4ivInvalidArgs1_0) { EXPECT_CALL(*gl_, Uniform4iv(_, _, _)).Times(0); - SpecializedSetup<Uniform4iv, 0>(); + SpecializedSetup<Uniform4iv, 0>(false); Uniform4iv cmd; cmd.Init(1, -1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1133,7 +1117,7 @@ TEST_F(GLES2DecoderTest2, Uniform4ivInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, Uniform4ivInvalidArgs2_0) { EXPECT_CALL(*gl_, Uniform4iv(_, _, _)).Times(0); - SpecializedSetup<Uniform4iv, 0>(); + SpecializedSetup<Uniform4iv, 0>(false); Uniform4iv cmd; cmd.Init(1, 2, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1141,7 +1125,7 @@ TEST_F(GLES2DecoderTest2, Uniform4ivInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, Uniform4ivInvalidArgs2_1) { EXPECT_CALL(*gl_, Uniform4iv(_, _, _)).Times(0); - SpecializedSetup<Uniform4iv, 0>(); + SpecializedSetup<Uniform4iv, 0>(false); Uniform4iv cmd; cmd.Init(1, 2, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1153,7 +1137,7 @@ TEST_F(GLES2DecoderTest2, Uniform4ivImmediateValidArgs) { *gl_, Uniform4iv(1, 2, reinterpret_cast<GLint*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<Uniform4ivImmediate, 0>(); + SpecializedSetup<Uniform4ivImmediate, 0>(true); GLint temp[4 * 2] = { 0, }; cmd.Init(1, 2, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1166,7 +1150,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvValidArgs) { *gl_, UniformMatrix2fv( 1, 2, false, reinterpret_cast<const GLfloat*>( shared_memory_address_))); - SpecializedSetup<UniformMatrix2fv, 0>(); + SpecializedSetup<UniformMatrix2fv, 0>(true); UniformMatrix2fv cmd; cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1175,7 +1159,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvValidArgs) { TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs1_0) { EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix2fv, 0>(); + SpecializedSetup<UniformMatrix2fv, 0>(false); UniformMatrix2fv cmd; cmd.Init(1, -1, false, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1184,7 +1168,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs2_0) { EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix2fv, 0>(); + SpecializedSetup<UniformMatrix2fv, 0>(false); UniformMatrix2fv cmd; cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1193,7 +1177,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs3_0) { EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix2fv, 0>(); + SpecializedSetup<UniformMatrix2fv, 0>(false); UniformMatrix2fv cmd; cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1201,7 +1185,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs3_0) { TEST_F(GLES2DecoderTest2, UniformMatrix2fvInvalidArgs3_1) { EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix2fv, 0>(); + SpecializedSetup<UniformMatrix2fv, 0>(false); UniformMatrix2fv cmd; cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1214,7 +1198,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvImmediateValidArgs) { *gl_, UniformMatrix2fv(1, 2, false, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<UniformMatrix2fvImmediate, 0>(); + SpecializedSetup<UniformMatrix2fvImmediate, 0>(true); GLfloat temp[4 * 2] = { 0, }; cmd.Init(1, 2, false, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1226,7 +1210,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix2fvImmediateInvalidArgs2_0) { UniformMatrix2fvImmediate& cmd = *GetImmediateAs<UniformMatrix2fvImmediate>(); EXPECT_CALL(*gl_, UniformMatrix2fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix2fvImmediate, 0>(); + SpecializedSetup<UniformMatrix2fvImmediate, 0>(false); GLfloat temp[4 * 2] = { 0, }; cmd.Init(1, 2, true, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1239,7 +1223,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvValidArgs) { *gl_, UniformMatrix3fv( 1, 2, false, reinterpret_cast<const GLfloat*>( shared_memory_address_))); - SpecializedSetup<UniformMatrix3fv, 0>(); + SpecializedSetup<UniformMatrix3fv, 0>(true); UniformMatrix3fv cmd; cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1248,7 +1232,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvValidArgs) { TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs1_0) { EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix3fv, 0>(); + SpecializedSetup<UniformMatrix3fv, 0>(false); UniformMatrix3fv cmd; cmd.Init(1, -1, false, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1257,7 +1241,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs2_0) { EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix3fv, 0>(); + SpecializedSetup<UniformMatrix3fv, 0>(false); UniformMatrix3fv cmd; cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1266,7 +1250,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs3_0) { EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix3fv, 0>(); + SpecializedSetup<UniformMatrix3fv, 0>(false); UniformMatrix3fv cmd; cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1274,7 +1258,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs3_0) { TEST_F(GLES2DecoderTest2, UniformMatrix3fvInvalidArgs3_1) { EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix3fv, 0>(); + SpecializedSetup<UniformMatrix3fv, 0>(false); UniformMatrix3fv cmd; cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1287,7 +1271,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvImmediateValidArgs) { *gl_, UniformMatrix3fv(1, 2, false, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<UniformMatrix3fvImmediate, 0>(); + SpecializedSetup<UniformMatrix3fvImmediate, 0>(true); GLfloat temp[9 * 2] = { 0, }; cmd.Init(1, 2, false, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1299,7 +1283,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix3fvImmediateInvalidArgs2_0) { UniformMatrix3fvImmediate& cmd = *GetImmediateAs<UniformMatrix3fvImmediate>(); EXPECT_CALL(*gl_, UniformMatrix3fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix3fvImmediate, 0>(); + SpecializedSetup<UniformMatrix3fvImmediate, 0>(false); GLfloat temp[9 * 2] = { 0, }; cmd.Init(1, 2, true, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1312,7 +1296,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvValidArgs) { *gl_, UniformMatrix4fv( 1, 2, false, reinterpret_cast<const GLfloat*>( shared_memory_address_))); - SpecializedSetup<UniformMatrix4fv, 0>(); + SpecializedSetup<UniformMatrix4fv, 0>(true); UniformMatrix4fv cmd; cmd.Init(1, 2, false, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1321,7 +1305,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvValidArgs) { TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs1_0) { EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix4fv, 0>(); + SpecializedSetup<UniformMatrix4fv, 0>(false); UniformMatrix4fv cmd; cmd.Init(1, -1, false, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1330,7 +1314,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs2_0) { EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix4fv, 0>(); + SpecializedSetup<UniformMatrix4fv, 0>(false); UniformMatrix4fv cmd; cmd.Init(1, 2, true, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1339,7 +1323,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs3_0) { EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix4fv, 0>(); + SpecializedSetup<UniformMatrix4fv, 0>(false); UniformMatrix4fv cmd; cmd.Init(1, 2, false, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1347,7 +1331,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs3_0) { TEST_F(GLES2DecoderTest2, UniformMatrix4fvInvalidArgs3_1) { EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix4fv, 0>(); + SpecializedSetup<UniformMatrix4fv, 0>(false); UniformMatrix4fv cmd; cmd.Init(1, 2, false, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1360,7 +1344,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvImmediateValidArgs) { *gl_, UniformMatrix4fv(1, 2, false, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<UniformMatrix4fvImmediate, 0>(); + SpecializedSetup<UniformMatrix4fvImmediate, 0>(true); GLfloat temp[16 * 2] = { 0, }; cmd.Init(1, 2, false, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1372,7 +1356,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvImmediateInvalidArgs2_0) { UniformMatrix4fvImmediate& cmd = *GetImmediateAs<UniformMatrix4fvImmediate>(); EXPECT_CALL(*gl_, UniformMatrix4fv(_, _, _, _)).Times(0); - SpecializedSetup<UniformMatrix4fvImmediate, 0>(); + SpecializedSetup<UniformMatrix4fvImmediate, 0>(false); GLfloat temp[16 * 2] = { 0, }; cmd.Init(1, 2, true, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1383,7 +1367,7 @@ TEST_F(GLES2DecoderTest2, UniformMatrix4fvImmediateInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, ValidateProgramValidArgs) { EXPECT_CALL(*gl_, ValidateProgram(kServiceProgramId)); - SpecializedSetup<ValidateProgram, 0>(); + SpecializedSetup<ValidateProgram, 0>(true); ValidateProgram cmd; cmd.Init(client_program_id_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1392,7 +1376,7 @@ TEST_F(GLES2DecoderTest2, ValidateProgramValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib1fValidArgs) { EXPECT_CALL(*gl_, VertexAttrib1f(1, 2)); - SpecializedSetup<VertexAttrib1f, 0>(); + SpecializedSetup<VertexAttrib1f, 0>(true); VertexAttrib1f cmd; cmd.Init(1, 2); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1403,7 +1387,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib1fvValidArgs) { EXPECT_CALL( *gl_, VertexAttrib1fv( 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<VertexAttrib1fv, 0>(); + SpecializedSetup<VertexAttrib1fv, 0>(true); VertexAttrib1fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1412,7 +1396,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib1fvValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib1fvInvalidArgs1_0) { EXPECT_CALL(*gl_, VertexAttrib1fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib1fv, 0>(); + SpecializedSetup<VertexAttrib1fv, 0>(false); VertexAttrib1fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1420,7 +1404,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib1fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, VertexAttrib1fvInvalidArgs1_1) { EXPECT_CALL(*gl_, VertexAttrib1fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib1fv, 0>(); + SpecializedSetup<VertexAttrib1fv, 0>(false); VertexAttrib1fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1432,7 +1416,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib1fvImmediateValidArgs) { *gl_, VertexAttrib1fv(1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<VertexAttrib1fvImmediate, 0>(); + SpecializedSetup<VertexAttrib1fvImmediate, 0>(true); GLfloat temp[1] = { 0, }; cmd.Init(1, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1442,7 +1426,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib1fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib2fValidArgs) { EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3)); - SpecializedSetup<VertexAttrib2f, 0>(); + SpecializedSetup<VertexAttrib2f, 0>(true); VertexAttrib2f cmd; cmd.Init(1, 2, 3); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1453,7 +1437,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib2fvValidArgs) { EXPECT_CALL( *gl_, VertexAttrib2fv( 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<VertexAttrib2fv, 0>(); + SpecializedSetup<VertexAttrib2fv, 0>(true); VertexAttrib2fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1462,7 +1446,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib2fvValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib2fvInvalidArgs1_0) { EXPECT_CALL(*gl_, VertexAttrib2fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib2fv, 0>(); + SpecializedSetup<VertexAttrib2fv, 0>(false); VertexAttrib2fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1470,7 +1454,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib2fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, VertexAttrib2fvInvalidArgs1_1) { EXPECT_CALL(*gl_, VertexAttrib2fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib2fv, 0>(); + SpecializedSetup<VertexAttrib2fv, 0>(false); VertexAttrib2fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1482,7 +1466,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib2fvImmediateValidArgs) { *gl_, VertexAttrib2fv(1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<VertexAttrib2fvImmediate, 0>(); + SpecializedSetup<VertexAttrib2fvImmediate, 0>(true); GLfloat temp[2] = { 0, }; cmd.Init(1, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1492,7 +1476,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib2fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib3fValidArgs) { EXPECT_CALL(*gl_, VertexAttrib3f(1, 2, 3, 4)); - SpecializedSetup<VertexAttrib3f, 0>(); + SpecializedSetup<VertexAttrib3f, 0>(true); VertexAttrib3f cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1503,7 +1487,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib3fvValidArgs) { EXPECT_CALL( *gl_, VertexAttrib3fv( 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<VertexAttrib3fv, 0>(); + SpecializedSetup<VertexAttrib3fv, 0>(true); VertexAttrib3fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1512,7 +1496,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib3fvValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib3fvInvalidArgs1_0) { EXPECT_CALL(*gl_, VertexAttrib3fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib3fv, 0>(); + SpecializedSetup<VertexAttrib3fv, 0>(false); VertexAttrib3fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1520,7 +1504,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib3fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, VertexAttrib3fvInvalidArgs1_1) { EXPECT_CALL(*gl_, VertexAttrib3fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib3fv, 0>(); + SpecializedSetup<VertexAttrib3fv, 0>(false); VertexAttrib3fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1532,7 +1516,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib3fvImmediateValidArgs) { *gl_, VertexAttrib3fv(1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<VertexAttrib3fvImmediate, 0>(); + SpecializedSetup<VertexAttrib3fvImmediate, 0>(true); GLfloat temp[3] = { 0, }; cmd.Init(1, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1542,7 +1526,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib3fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib4fValidArgs) { EXPECT_CALL(*gl_, VertexAttrib4f(1, 2, 3, 4, 5)); - SpecializedSetup<VertexAttrib4f, 0>(); + SpecializedSetup<VertexAttrib4f, 0>(true); VertexAttrib4f cmd; cmd.Init(1, 2, 3, 4, 5); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1553,7 +1537,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib4fvValidArgs) { EXPECT_CALL( *gl_, VertexAttrib4fv( 1, reinterpret_cast<const GLfloat*>(shared_memory_address_))); - SpecializedSetup<VertexAttrib4fv, 0>(); + SpecializedSetup<VertexAttrib4fv, 0>(true); VertexAttrib4fv cmd; cmd.Init(1, shared_memory_id_, shared_memory_offset_); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1562,7 +1546,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib4fvValidArgs) { TEST_F(GLES2DecoderTest2, VertexAttrib4fvInvalidArgs1_0) { EXPECT_CALL(*gl_, VertexAttrib4fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib4fv, 0>(); + SpecializedSetup<VertexAttrib4fv, 0>(false); VertexAttrib4fv cmd; cmd.Init(1, kInvalidSharedMemoryId, 0); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1570,7 +1554,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib4fvInvalidArgs1_0) { TEST_F(GLES2DecoderTest2, VertexAttrib4fvInvalidArgs1_1) { EXPECT_CALL(*gl_, VertexAttrib4fv(_, _)).Times(0); - SpecializedSetup<VertexAttrib4fv, 0>(); + SpecializedSetup<VertexAttrib4fv, 0>(false); VertexAttrib4fv cmd; cmd.Init(1, shared_memory_id_, kInvalidSharedMemoryOffset); EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); @@ -1582,7 +1566,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib4fvImmediateValidArgs) { *gl_, VertexAttrib4fv(1, reinterpret_cast<GLfloat*>(ImmediateDataAddress(&cmd)))); - SpecializedSetup<VertexAttrib4fvImmediate, 0>(); + SpecializedSetup<VertexAttrib4fvImmediate, 0>(true); GLfloat temp[4] = { 0, }; cmd.Init(1, &temp[0]); EXPECT_EQ(error::kNoError, @@ -1594,7 +1578,7 @@ TEST_F(GLES2DecoderTest2, VertexAttrib4fvImmediateValidArgs) { TEST_F(GLES2DecoderTest2, ViewportValidArgs) { EXPECT_CALL(*gl_, Viewport(1, 2, 3, 4)); - SpecializedSetup<Viewport, 0>(); + SpecializedSetup<Viewport, 0>(true); Viewport cmd; cmd.Init(1, 2, 3, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1603,7 +1587,7 @@ TEST_F(GLES2DecoderTest2, ViewportValidArgs) { TEST_F(GLES2DecoderTest2, ViewportInvalidArgs2_0) { EXPECT_CALL(*gl_, Viewport(_, _, _, _)).Times(0); - SpecializedSetup<Viewport, 0>(); + SpecializedSetup<Viewport, 0>(false); Viewport cmd; cmd.Init(1, 2, -1, 4); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); @@ -1612,7 +1596,7 @@ TEST_F(GLES2DecoderTest2, ViewportInvalidArgs2_0) { TEST_F(GLES2DecoderTest2, ViewportInvalidArgs3_0) { EXPECT_CALL(*gl_, Viewport(_, _, _, _)).Times(0); - SpecializedSetup<Viewport, 0>(); + SpecializedSetup<Viewport, 0>(false); Viewport cmd; cmd.Init(1, 2, 3, -1); EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index e8a91e8..33fbf54 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -45,12 +45,34 @@ void GLES2DecoderTestBase::SetUp() { EXPECT_CALL(*gl_, GetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, _)) .WillOnce(SetArgumentPointee<1>(kMaxCubeMapTextureSize)) .RetiresOnSaturation(); + + EXPECT_CALL(*gl_, EnableVertexAttribArray(0)) + .Times(1) + .RetiresOnSaturation(); + static GLuint attrib_ids[] = { + kServiceAttrib0BufferId, + }; + EXPECT_CALL(*gl_, GenBuffersARB(arraysize(attrib_ids), _)) + .WillOnce(SetArrayArgument<1>(attrib_ids, + attrib_ids + arraysize(attrib_ids))) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, kServiceAttrib0BufferId)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, VertexAttribPointer(0, 1, GL_FLOAT, GL_FALSE, 0, NULL)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0)) + .Times(1) + .RetiresOnSaturation(); + static GLuint black_ids[] = { kServiceBlackTexture2dId, kServiceBlackTextureCubemapId, }; - EXPECT_CALL(*gl_, GenTextures(2, _)) - .WillOnce(SetArrayArgument<1>(black_ids, black_ids + 2)) + EXPECT_CALL(*gl_, GenTextures(arraysize(black_ids), _)) + .WillOnce(SetArrayArgument<1>(black_ids, + black_ids + arraysize(black_ids))) .RetiresOnSaturation(); EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceBlackTexture2dId)) .Times(1) @@ -147,6 +169,12 @@ void GLES2DecoderTestBase::SetUp() { void GLES2DecoderTestBase::TearDown() { // All Tests should have read all their GLErrors before getting here. EXPECT_EQ(GL_NO_ERROR, GetGLError()); + EXPECT_CALL(*gl_, DeleteTextures(1, _)) + .Times(2) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)) + .Times(1) + .RetiresOnSaturation(); decoder_->Destroy(); decoder_.reset(); engine_.reset(); @@ -197,6 +225,27 @@ void GLES2DecoderTestBase::SetupShaderForUniform() { EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } +void GLES2DecoderTestBase::DoBindBuffer( + GLenum target, GLuint client_id, GLuint service_id) { + EXPECT_CALL(*gl_, BindBuffer(target, service_id)) + .Times(1) + .RetiresOnSaturation(); + BindBuffer cmd; + cmd.Init(target, client_id); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); +} + +void GLES2DecoderTestBase::DoDeleteBuffer( + GLuint client_id, GLuint service_id) { + EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(service_id))) + .Times(1) + .RetiresOnSaturation(); + DeleteBuffers cmd; + cmd.Init(1, shared_memory_id_, shared_memory_offset_); + memcpy(shared_memory_address_, &client_id, sizeof(client_id)); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); +} + void GLES2DecoderTestBase::DoBindFramebuffer( GLenum target, GLuint client_id, GLuint service_id) { EXPECT_CALL(*gl_, BindFramebufferEXT(target, service_id)) @@ -242,6 +291,18 @@ void GLES2DecoderTestBase::DoTexImage2D( EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } +void GLES2DecoderTestBase::DoVertexAttribPointer( + GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset) { + EXPECT_CALL(*gl_, + VertexAttribPointer(index, size, type, GL_FALSE, stride, + BufferOffset(offset))) + .Times(1) + .RetiresOnSaturation(); + VertexAttribPointer cmd; + cmd.Init(index, size, GL_FLOAT, GL_FALSE, stride, offset); + EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); +} + // GCC requires these declarations, but MSVC requires they not be present #ifndef COMPILER_MSVC const GLint GLES2DecoderTestBase::kMaxTextureSize; @@ -252,6 +313,8 @@ const GLint GLES2DecoderTestBase::kNumTextureUnits; const GLuint GLES2DecoderTestBase::kServiceBlackTexture2dId; const GLuint GLES2DecoderTestBase::kServiceBlackTextureCubemapId; +const GLuint GLES2DecoderTestBase::kServiceAttrib0BufferId; + const GLuint GLES2DecoderTestBase::kServiceBufferId; const GLuint GLES2DecoderTestBase::kServiceFramebufferId; const GLuint GLES2DecoderTestBase::kServiceRenderbufferId; @@ -406,16 +469,6 @@ void GLES2DecoderWithShaderTestBase::DoEnableVertexAttribArray(GLint index) { EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } -void GLES2DecoderWithShaderTestBase::DoBindBuffer( - GLenum target, GLuint client_id, GLuint service_id) { - EXPECT_CALL(*gl_, BindBuffer(target, service_id)) - .Times(1) - .RetiresOnSaturation(); - BindBuffer cmd; - cmd.Init(target, client_id); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); -} - void GLES2DecoderWithShaderTestBase::DoBufferData(GLenum target, GLsizei size) { EXPECT_CALL(*gl_, GetError()) .WillOnce(Return(GL_NO_ERROR)) @@ -443,17 +496,6 @@ void GLES2DecoderWithShaderTestBase::DoBufferSubData( EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } -void GLES2DecoderWithShaderTestBase::DoDeleteBuffer( - GLuint client_id, GLuint service_id) { - EXPECT_CALL(*gl_, DeleteBuffersARB(1, Pointee(service_id))) - .Times(1) - .RetiresOnSaturation(); - DeleteBuffers cmd; - cmd.Init(1, shared_memory_id_, shared_memory_offset_); - memcpy(shared_memory_address_, &client_id, sizeof(client_id)); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); -} - void GLES2DecoderWithShaderTestBase::DoDeleteProgram( GLuint client_id, GLuint service_id) { EXPECT_CALL(*gl_, DeleteProgram(service_id)) @@ -464,18 +506,6 @@ void GLES2DecoderWithShaderTestBase::DoDeleteProgram( EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); } -void GLES2DecoderWithShaderTestBase::DoVertexAttribPointer( - GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset) { - EXPECT_CALL(*gl_, - VertexAttribPointer(index, size, type, GL_FALSE, stride, - BufferOffset(offset))) - .Times(1) - .RetiresOnSaturation(); - VertexAttribPointer cmd; - cmd.Init(index, size, GL_FLOAT, GL_FALSE, stride, offset); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); -} - void GLES2DecoderWithShaderTestBase::SetupVertexBuffer() { DoEnableVertexAttribArray(1); DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_, kServiceBufferId); @@ -516,6 +546,7 @@ const int GLES2DecoderWithShaderTestBase::kValidIndexRangeCount; const int GLES2DecoderWithShaderTestBase::kInvalidIndexRangeStart; const int GLES2DecoderWithShaderTestBase::kInvalidIndexRangeCount; const int GLES2DecoderWithShaderTestBase::kOutOfRangeIndexRangeEnd; +const GLuint GLES2DecoderWithShaderTestBase::kMaxValidIndex; const GLint GLES2DecoderWithShaderTestBase::kMaxAttribLength; const GLint GLES2DecoderWithShaderTestBase::kAttrib1Size; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index e1279fc..f18b598 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h @@ -46,6 +46,8 @@ class GLES2DecoderTestBase : public testing::Test { static const GLuint kServiceBlackTexture2dId = 701; static const GLuint kServiceBlackTextureCubemapId = 702; + static const GLuint kServiceAttrib0BufferId = 801; + static const GLuint kServiceBufferId = 301; static const GLuint kServiceFramebufferId = 302; static const GLuint kServiceRenderbufferId = 303; @@ -79,7 +81,7 @@ class GLES2DecoderTestBase : public testing::Test { // This template exists solely so we can specialize it for // certain commands. template <typename T, int id> - void SpecializedSetup() { + void SpecializedSetup(bool valid) { } template <typename T> @@ -186,13 +188,21 @@ class GLES2DecoderTestBase : public testing::Test { // EXPECT_EQ that expect both types to be the same. GLint GetGLError(); + void DoBindBuffer(GLenum target, GLuint client_id, GLuint service_id); void DoBindFramebuffer(GLenum target, GLuint client_id, GLuint service_id); void DoBindRenderbuffer(GLenum target, GLuint client_id, GLuint service_id); void DoBindTexture(GLenum target, GLuint client_id, GLuint service_id); + void DoDeleteBuffer(GLuint client_id, GLuint service_id); void DoTexImage2D(GLenum target, GLint level, GLenum internal_format, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, uint32 shared_memory_id, uint32 shared_memory_offset); + void DoVertexAttribPointer( + GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset); + + GLvoid* BufferOffset(unsigned i) { + return static_cast<int8 *>(NULL)+(i); + } // Use StrictMock to make 100% sure we know how GL will be called. scoped_ptr< ::testing::StrictMock< ::gles2::MockGLInterface> > gl_; @@ -273,6 +283,7 @@ class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { static const int kInvalidIndexRangeStart = 0; static const int kInvalidIndexRangeCount = 7; static const int kOutOfRangeIndexRangeEnd = 10; + static const GLuint kMaxValidIndex = 7; static const GLint kMaxAttribLength = 10; static const char* kAttrib1Name; @@ -313,26 +324,15 @@ class GLES2DecoderWithShaderTestBase : public GLES2DecoderTestBase { void SetupTexture(); - GLvoid* BufferOffset(unsigned i) { - return static_cast<int8 *>(NULL)+(i); - } - void DoEnableVertexAttribArray(GLint index); - void DoBindBuffer(GLenum target, GLuint client_id, GLuint service_id); - void DoBufferData(GLenum target, GLsizei size); void DoBufferSubData( GLenum target, GLint offset, GLsizei size, const void* data); - void DoDeleteBuffer(GLuint client_id, GLuint service_id); - void DoDeleteProgram(GLuint client_id, GLuint service_id); - void DoVertexAttribPointer( - GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset); - void SetupVertexBuffer(); void SetupIndexBuffer(); 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 d28f7f1..4d3ab19 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h @@ -600,12 +600,12 @@ bool ValidateGLenumVertexAttribType(GLenum value) { bool ValidateGLenumVertexAttribute(GLenum value) { switch (value) { + case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED: 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: |