| Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| index 16783b8e6fd08a6c33859cdecca099297e5057fd..6437648ac00ae793b707568c9a32af96b9f5127a 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| @@ -71,14 +71,15 @@
|
| GLES2DecoderTestWithExtensionsOnGLES2() {}
|
|
|
| virtual void SetUp() {
|
| - InitState init;
|
| - init.extensions = GetParam();
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_alpha = true;
|
| - init.has_depth = true;
|
| - init.request_alpha = true;
|
| - init.request_depth = true;
|
| - InitDecoder(init);
|
| + InitDecoder(GetParam(), // extensions
|
| + "opengl es 2.0", // gl version
|
| + true, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| }
|
| };
|
|
|
| @@ -99,15 +100,16 @@
|
| }
|
|
|
| virtual void SetUp() {
|
| - InitState init;
|
| - init.extensions = "GL_ANGLE_instanced_arrays";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_alpha = true;
|
| - init.has_depth = true;
|
| - init.request_alpha = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ANGLE_instanced_arrays", // extensions
|
| + "opengl es 2.0", // gl version
|
| + true, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| SetupDefaultProgram();
|
| }
|
| };
|
| @@ -123,10 +125,17 @@
|
| command_line.AppendSwitchASCII(
|
| switches::kGpuDriverBugWorkarounds,
|
| base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS));
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoderWithCommandLine(init, &command_line);
|
| + InitDecoderWithCommandLine(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true, // bind generates resource
|
| + &command_line);
|
| SetupDefaultProgram();
|
| }
|
| };
|
| @@ -206,7 +215,6 @@
|
| cmd.Init(GL_TRIANGLES, 0, kLargeCount);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
|
| - EXPECT_FALSE(GetDecoder()->WasContextLost());
|
| }
|
|
|
| // Tests when the math overflows (0x7FFFFFFF + 1 = 0x8000000 verts)
|
| @@ -220,7 +228,6 @@
|
| cmd.Init(GL_TRIANGLES, 0, kLargeCount);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
|
| - EXPECT_FALSE(GetDecoder()->WasContextLost());
|
| }
|
|
|
| // Tests when the driver returns an error
|
| @@ -236,37 +243,6 @@
|
| cmd.Init(GL_TRIANGLES, 0, kFakeLargeCount);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
|
| - EXPECT_FALSE(GetDecoder()->WasContextLost());
|
| -}
|
| -
|
| -// Test that we lose context.
|
| -TEST_F(GLES2DecoderManualInitTest, LoseContextWhenOOM) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_alpha = true;
|
| - init.has_depth = true;
|
| - init.request_alpha = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - init.lose_context_when_out_of_memory = true;
|
| - InitDecoder(init);
|
| - SetupDefaultProgram();
|
| -
|
| - const GLsizei kFakeLargeCount = 0x1234;
|
| - SetupTexture();
|
| - AddExpectationsForSimulatedAttrib0WithError(
|
| - kFakeLargeCount, 0, GL_OUT_OF_MEMORY);
|
| - EXPECT_CALL(*gl_, DrawArrays(_, _, _)).Times(0).RetiresOnSaturation();
|
| - // Other contexts in the group should be lost also.
|
| - EXPECT_CALL(*mock_decoder_, LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB))
|
| - .Times(1)
|
| - .RetiresOnSaturation();
|
| - DrawArrays cmd;
|
| - cmd.Init(GL_TRIANGLES, 0, kFakeLargeCount);
|
| - // This context should be lost.
|
| - EXPECT_EQ(error::kLostContext, ExecuteCmd(cmd));
|
| - EXPECT_EQ(GL_OUT_OF_MEMORY, GetGLError());
|
| - EXPECT_TRUE(decoder_->WasContextLost());
|
| }
|
|
|
| TEST_F(GLES2DecoderWithShaderTest, DrawArraysBadTextureUsesBlack) {
|
| @@ -352,14 +328,17 @@
|
| command_line.AppendSwitchASCII(
|
| switches::kGpuDriverBugWorkarounds,
|
| base::IntToString(gpu::INIT_VERTEX_ATTRIBUTES));
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_alpha = true;
|
| - init.has_depth = true;
|
| - init.request_alpha = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoderWithCommandLine(init, &command_line);
|
| + InitDecoderWithCommandLine(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + true, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true, // bind generates resource
|
| + &command_line);
|
| SetupDefaultProgram();
|
| SetupTexture();
|
| SetupVertexBuffer();
|
| @@ -1949,10 +1928,17 @@
|
| command_line.AppendSwitchASCII(
|
| switches::kGpuDriverBugWorkarounds,
|
| base::IntToString(gpu::SET_TEXTURE_FILTER_BEFORE_GENERATING_MIPMAP));
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoderWithCommandLine(init, &command_line);
|
| + InitDecoderWithCommandLine(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true, // bind generates resource
|
| + &command_line);
|
|
|
| EXPECT_CALL(*gl_, GenerateMipmapEXT(_))
|
| .Times(0);
|
| @@ -2618,13 +2604,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ReadPixelsAsyncError) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_sync";
|
| - init.gl_version = "opengl es 3.0";
|
| - init.has_alpha = true;
|
| - init.request_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_sync", // extensions
|
| + "opengl es 3.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| typedef ReadPixels::Result Result;
|
| Result* result = GetSharedMemoryAs<Result*>();
|
| @@ -3903,12 +3892,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_alpha = true;
|
| - init.request_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -3931,11 +3924,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -3958,12 +3956,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_depth = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -3986,11 +3988,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -4013,12 +4020,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_stencil = true;
|
| - init.request_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + true, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -4041,11 +4052,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -4068,12 +4084,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_depth = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| Enable cmd;
|
| cmd.Init(GL_DEPTH_TEST);
|
| @@ -4127,11 +4147,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| Enable cmd;
|
| cmd.Init(GL_DEPTH_TEST);
|
| @@ -4184,12 +4209,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_stencil = true;
|
| - init.request_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + true, // request stencil
|
| + true); // bind generates resource
|
|
|
| Enable cmd;
|
| cmd.Init(GL_STENCIL_TEST);
|
| @@ -4242,11 +4271,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| Enable cmd;
|
| cmd.Init(GL_STENCIL_TEST);
|
| @@ -4299,15 +4333,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_packed_depth_stencil";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_depth = true;
|
| - init.has_stencil = true;
|
| - init.request_depth = true;
|
| - init.request_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_packed_depth_stencil", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + true, // request depth
|
| + true, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -4343,14 +4378,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_packed_depth_stencil";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_depth = true;
|
| - init.has_stencil = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_packed_depth_stencil", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -4386,11 +4423,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_packed_depth_stencil";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_packed_depth_stencil", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
|
| @@ -4453,11 +4495,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_packed_depth_stencil";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_packed_depth_stencil", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
|
| @@ -4852,11 +4899,16 @@
|
|
|
| TEST_F(GLES2DecoderManualInitTest,
|
| RenderbufferStorageMultisampleCHROMIUMGLError) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_framebuffer_multisample";
|
| - init.gl_version = "2.1";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_framebuffer_multisample", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| EXPECT_CALL(*gl_, GetError())
|
| @@ -4875,11 +4927,16 @@
|
|
|
| TEST_F(GLES2DecoderManualInitTest,
|
| RenderbufferStorageMultisampleCHROMIUMBadArgs) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_framebuffer_multisample";
|
| - init.gl_version = "2.1";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_framebuffer_multisample", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT(_, _, _, _, _))
|
| @@ -4901,10 +4958,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleCHROMIUM) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_framebuffer_multisample";
|
| - init.gl_version = "2.1";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_framebuffer_multisample", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| InSequence sequence;
|
| @@ -4932,11 +4995,16 @@
|
|
|
| TEST_F(GLES2DecoderManualInitTest,
|
| RenderbufferStorageMultisampleEXTNotSupported) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_framebuffer_multisample";
|
| - init.gl_version = "2.1";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_framebuffer_multisample", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| InSequence sequence;
|
| @@ -5046,11 +5114,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_texture_compression_s3tc";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_texture_compression_s3tc", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -5099,10 +5172,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -5138,11 +5217,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DBucketBadBucket) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_texture_compression_s3tc";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_texture_compression_s3tc", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| const uint32 kBadBucketId = 123;
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| @@ -5168,11 +5252,16 @@
|
| } // anonymous namespace.
|
|
|
| TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DS3TC) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_texture_compression_s3tc";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_texture_compression_s3tc", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| const uint32 kBucketId = 123;
|
| CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
|
| ASSERT_TRUE(bucket != NULL);
|
| @@ -5318,11 +5407,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, CompressedTexImage2DETC1) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_compressed_ETC1_RGB8_texture";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_compressed_ETC1_RGB8_texture", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| const uint32 kBucketId = 123;
|
| CommonDecoder::Bucket* bucket = decoder_->CreateBucket(kBucketId);
|
| ASSERT_TRUE(bucket != NULL);
|
| @@ -5386,11 +5480,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormatsETC1) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_compressed_ETC1_RGB8_texture";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_compressed_ETC1_RGB8_texture", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -5457,11 +5556,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
|
| EXPECT_CALL(*gl_, GenTextures(1, _))
|
| .WillOnce(SetArgumentPointee<1>(kNewServiceId));
|
| @@ -5475,11 +5579,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| @@ -5504,11 +5613,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
|
|
|
| TextureRef* texture_ref = GetTexture(client_texture_id_);
|
| @@ -5521,11 +5635,17 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| +
|
| DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
|
|
|
| EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES,
|
| @@ -5575,11 +5695,17 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| +
|
| DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
|
|
|
| TexParameteri cmd;
|
| @@ -5611,11 +5737,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| GLenum target = GL_TEXTURE_EXTERNAL_OES;
|
| GLint level = 0;
|
| @@ -5637,9 +5768,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
|
|
| BindTexture cmd1;
|
| cmd1.Init(GL_TEXTURE_2D, kInvalidClientId);
|
| @@ -5663,11 +5801,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleBindTexture) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_RECTANGLE_ARB, kNewServiceId));
|
| EXPECT_CALL(*gl_, GenTextures(1, _))
|
| .WillOnce(SetArgumentPointee<1>(kNewServiceId));
|
| @@ -5681,11 +5824,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleGetBinding) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(
|
| GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
|
|
|
| @@ -5711,11 +5859,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureDefaults) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(
|
| GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
|
|
|
| @@ -5728,11 +5881,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParam) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| DoBindTexture(
|
| GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
|
| @@ -5783,11 +5941,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTextureParamInvalid) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| DoBindTexture(
|
| GL_TEXTURE_RECTANGLE_ARB, client_texture_id_, kServiceTextureId);
|
| @@ -5820,11 +5983,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ARBTextureRectangleTexImage2DError) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| GLenum target = GL_TEXTURE_RECTANGLE_ARB;
|
| GLint level = 0;
|
| @@ -5919,10 +6087,17 @@
|
| command_line.AppendSwitchASCII(
|
| switches::kGpuDriverBugWorkarounds,
|
| base::IntToString(gpu::TEXSUBIMAGE2D_FASTER_THAN_TEXIMAGE2D));
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoderWithCommandLine(init, &command_line);
|
| + InitDecoderWithCommandLine(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true, // bind generates resource
|
| + &command_line);
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE,
|
| 0, 0);
|
| @@ -6204,11 +6379,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, CompressedImage2DMarksTextureAsCleared) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_texture_compression_s3tc";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_texture_compression_s3tc", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| EXPECT_CALL(*gl_, GetError())
|
| @@ -6339,11 +6519,16 @@
|
|
|
| TEST_F(GLES2DecoderManualInitTest,
|
| UnClearedAttachmentsGetClearedOnReadPixelsAndDrawBufferGetsRestored) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_framebuffer_multisample";
|
| - init.gl_version = "2.1";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_framebuffer_multisample", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| const GLuint kFBOClientTextureId = 4100;
|
| const GLuint kFBOServiceTextureId = 4101;
|
|
|
| @@ -6789,13 +6974,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, BeginEndQueryEXT) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_occlusion_query_boolean";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_alpha = true;
|
| - init.request_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_EXT_occlusion_query_boolean", // extensions
|
| + "opengl es 2.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| // Test end fails if no begin.
|
| EndQueryEXT end_cmd;
|
| @@ -6878,13 +7066,16 @@
|
| uint32 shm_offset) {
|
| // We need to reset the decoder on each iteration, because we lose the
|
| // context every time.
|
| - GLES2DecoderTestBase::InitState init;
|
| - init.extensions = "GL_EXT_occlusion_query_boolean";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_alpha = true;
|
| - init.request_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - test->InitDecoder(init);
|
| + test->InitDecoder(
|
| + "GL_EXT_occlusion_query_boolean", // extensions
|
| + "opengl es 2.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| ::testing::StrictMock< ::gfx::MockGLInterface>* gl = test->GetGLMock();
|
|
|
| BeginQueryEXT begin_cmd;
|
| @@ -7150,15 +7341,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, DepthTextureBadArgs) {
|
| - InitState init;
|
| - init.extensions = "GL_ANGLE_depth_texture";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_depth = true;
|
| - init.has_stencil = true;
|
| - init.request_depth = true;
|
| - init.request_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ANGLE_depth_texture", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + true, // request depth
|
| + true, // request stencil
|
| + true); // bind generates resource
|
|
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| // Check trying to upload data fails.
|
| @@ -7202,15 +7394,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, GenerateMipmapDepthTexture) {
|
| - InitState init;
|
| - init.extensions = "GL_ANGLE_depth_texture";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_depth = true;
|
| - init.has_stencil = true;
|
| - init.request_depth = true;
|
| - init.request_stencil = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ANGLE_depth_texture", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + true, // has depth
|
| + true, // has stencil
|
| + false, // request alpha
|
| + true, // request depth
|
| + true, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
|
| 2, 2, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,
|
| @@ -7222,15 +7415,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, DrawClearsDepthTexture) {
|
| - InitState init;
|
| - init.extensions = "GL_ANGLE_depth_texture";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_alpha = true;
|
| - init.has_depth = true;
|
| - init.request_alpha = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ANGLE_depth_texture", // extensions
|
| + "opengl es 2.0", // gl version
|
| + true, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| SetupDefaultProgram();
|
| SetupAllNeededVertexBuffers();
|
| @@ -7353,11 +7547,16 @@
|
| bool vertex_array_deleted_manually_;
|
|
|
| virtual void SetUp() {
|
| - InitState init;
|
| - init.extensions = "GL_OES_vertex_array_object";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_vertex_array_object", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| SetupDefaultProgram();
|
|
|
| AddExpectationsForGenVertexArraysOES();
|
| @@ -7499,10 +7698,16 @@
|
| GLES2DecoderEmulatedVertexArraysOESTest() { }
|
|
|
| virtual void SetUp() {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| SetupDefaultProgram();
|
|
|
| AddExpectationsForGenVertexArraysOES();
|
| @@ -7880,15 +8085,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, DrawWithGLImageExternal) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_EGL_image_external";
|
| - init.gl_version = "opengl es 2.0";
|
| - init.has_alpha = true;
|
| - init.has_depth = true;
|
| - init.request_alpha = true;
|
| - init.request_depth = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_EGL_image_external", // extensions
|
| + "opengl es 2.0", // gl version
|
| + true, // has alpha
|
| + true, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + true, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| TextureRef* texture_ref = GetTexture(client_texture_id_);
|
| scoped_refptr<MockGLImage> image(new MockGLImage);
|
| @@ -7954,11 +8160,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, GpuMemoryManagerCHROMIUM) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_rectangle";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_ARB_texture_rectangle", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| Texture* texture = GetTexture(client_texture_id_)->texture();
|
| EXPECT_TRUE(texture != NULL);
|
| @@ -7990,11 +8201,12 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransfers) {
|
| - InitState init;
|
| - init.extensions = "GL_CHROMIUM_async_pixel_transfers";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_CHROMIUM_async_pixel_transfers", // extensions
|
| + "3.0", // gl version
|
| + false, false, false, // has alpha/depth/stencil
|
| + false, false, false, // request alpha/depth/stencil
|
| + true); // bind generates resource
|
|
|
| // Set up the texture.
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| @@ -8227,11 +8439,12 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, AsyncPixelTransferManager) {
|
| - InitState init;
|
| - init.extensions = "GL_CHROMIUM_async_pixel_transfers";
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_CHROMIUM_async_pixel_transfers", // extensions
|
| + "3.0", // gl version
|
| + false, false, false, // has alpha/depth/stencil
|
| + false, false, false, // request alpha/depth/stencil
|
| + true); // bind generates resource
|
|
|
| // Set up the texture.
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| @@ -8331,10 +8544,16 @@
|
| scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
|
| new SizeOnlyMemoryTracker();
|
| set_memory_tracker(memory_tracker.get());
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| // Expect that initial size - size is 0.
|
| EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kUnmanaged));
|
| EXPECT_EQ(0u, memory_tracker->GetPoolSize(MemoryTracker::kManaged));
|
| @@ -8344,10 +8563,16 @@
|
| scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
|
| new SizeOnlyMemoryTracker();
|
| set_memory_tracker(memory_tracker.get());
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128))
|
| .WillOnce(Return(true)).RetiresOnSaturation();
|
| @@ -8375,10 +8600,16 @@
|
| scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
|
| new SizeOnlyMemoryTracker();
|
| set_memory_tracker(memory_tracker.get());
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| // Check we get out of memory and no call to glTexStorage2DEXT
|
| // if Ensure fails.
|
| @@ -8401,12 +8632,16 @@
|
| scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
|
| new SizeOnlyMemoryTracker();
|
| set_memory_tracker(memory_tracker.get());
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_alpha = true;
|
| - init.request_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| EXPECT_CALL(*memory_tracker.get(), EnsureGPUMemoryAvailable(128))
|
| .WillOnce(Return(true)).RetiresOnSaturation();
|
| @@ -8435,10 +8670,16 @@
|
| scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
|
| new SizeOnlyMemoryTracker();
|
| set_memory_tracker(memory_tracker.get());
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
|
| kServiceRenderbufferId);
|
| EXPECT_CALL(*gl_, GetError())
|
| @@ -8469,10 +8710,16 @@
|
| scoped_refptr<SizeOnlyMemoryTracker> memory_tracker =
|
| new SizeOnlyMemoryTracker();
|
| set_memory_tracker(memory_tracker.get());
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
| DoBindBuffer(GL_ARRAY_BUFFER, client_buffer_id_,
|
| kServiceBufferId);
|
| EXPECT_CALL(*gl_, GetError())
|
| @@ -8554,9 +8801,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, InvalidateFramebufferBinding) {
|
| - InitState init;
|
| - init.gl_version = "opengl es 3.0";
|
| - InitDecoder(init);
|
| + InitDecoder("", // extensions
|
| + "opengl es 3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
|
|
| // EXPECT_EQ can't be used to compare function pointers
|
| EXPECT_TRUE(
|
| @@ -8568,10 +8821,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, DiscardFramebufferEXT) {
|
| - InitState init;
|
| - init.extensions = "GL_EXT_discard_framebuffer";
|
| - init.gl_version = "opengl es 2.0";
|
| - InitDecoder(init);
|
| + InitDecoder("GL_EXT_discard_framebuffer", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
|
|
| // EXPECT_EQ can't be used to compare function pointers
|
| EXPECT_TRUE(
|
| @@ -8625,9 +8883,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderRestoreStateTest, NullPreviousState) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| SetupTexture();
|
|
|
| InSequence sequence;
|
| @@ -8653,14 +8918,21 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderRestoreStateTest, WithPreviousState) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| SetupTexture();
|
|
|
| // Construct a previous ContextState with all texture bindings
|
| // set to default textures.
|
| - ContextState prev_state(NULL, NULL, NULL);
|
| + ContextState prev_state(NULL, NULL);
|
| InitializeContextState(&prev_state, std::numeric_limits<uint32>::max(), 0);
|
|
|
| InSequence sequence;
|
| @@ -8677,9 +8949,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderRestoreStateTest, ActiveUnit1) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
|
|
| // Bind a non-default texture to GL_TEXTURE1 unit.
|
| EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1));
|
| @@ -8691,7 +8970,7 @@
|
|
|
| // Construct a previous ContextState with all texture bindings
|
| // set to default textures.
|
| - ContextState prev_state(NULL, NULL, NULL);
|
| + ContextState prev_state(NULL, NULL);
|
| InitializeContextState(&prev_state, std::numeric_limits<uint32>::max(), 0);
|
|
|
| InSequence sequence;
|
| @@ -8708,9 +8987,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit0) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
|
|
| // Bind a non-default texture to GL_TEXTURE1 unit.
|
| EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1));
|
| @@ -8724,7 +9010,7 @@
|
| // Construct a previous ContextState with GL_TEXTURE_2D target in
|
| // GL_TEXTURE0 unit bound to a non-default texture and the rest
|
| // set to default textures.
|
| - ContextState prev_state(NULL, NULL, NULL);
|
| + ContextState prev_state(NULL, NULL);
|
| InitializeContextState(&prev_state, 0, kServiceTextureId);
|
|
|
| InSequence sequence;
|
| @@ -8746,9 +9032,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderRestoreStateTest, NonDefaultUnit1) {
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
|
|
| // Bind a non-default texture to GL_TEXTURE0 unit.
|
| SetupTexture();
|
| @@ -8756,7 +9049,7 @@
|
| // Construct a previous ContextState with GL_TEXTURE_2D target in
|
| // GL_TEXTURE1 unit bound to a non-default texture and the rest
|
| // set to default textures.
|
| - ContextState prev_state(NULL, NULL, NULL);
|
| + ContextState prev_state(NULL, NULL);
|
| InitializeContextState(&prev_state, 1, kServiceTextureId);
|
|
|
| InSequence sequence;
|
| @@ -8782,12 +9075,17 @@
|
| command_line.AppendSwitchASCII(
|
| switches::kGpuDriverBugWorkarounds,
|
| base::IntToString(gpu::CLEAR_UNIFORMS_BEFORE_FIRST_PROGRAM_USE));
|
| - InitState init;
|
| - init.gl_version = "3.0";
|
| - init.has_alpha = true;
|
| - init.request_alpha = true;
|
| - init.bind_generates_resource = true;
|
| - InitDecoderWithCommandLine(init, &command_line);
|
| + InitDecoderWithCommandLine(
|
| + "", // extensions
|
| + "3.0", // gl version
|
| + true, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + true, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true, // bind generates resource
|
| + &command_line);
|
| {
|
| static AttribInfo attribs[] = {
|
| { kAttrib1Name, kAttrib1Size, kAttrib1Type, kAttrib1Location, },
|
| @@ -8824,10 +9122,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES2) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_texture_float";
|
| - init.gl_version = "opengl es 2.0";
|
| - InitDecoder(init);
|
| + InitDecoder("GL_OES_texture_float", // extensions
|
| + "opengl es 2.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
|
| @@ -8840,10 +9143,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatOnGLES3) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
|
| - init.gl_version = "opengl es 3.0";
|
| - InitDecoder(init);
|
| + InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
|
| + "opengl es 3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 17, 0, GL_RGBA, GL_FLOAT, 0, 0);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 16, 17, 0, GL_RGB, GL_FLOAT, 0, 0);
|
| @@ -8858,10 +9166,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, TexSubImage2DFloatOnGLES3) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
|
| - init.gl_version = "opengl es 3.0";
|
| - InitDecoder(init);
|
| + InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
|
| + "opengl es 3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| const int kWidth = 8;
|
| const int kHeight = 4;
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| @@ -8881,10 +9194,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, TexSubImage2DFloatDoesClearOnGLES3) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_texture_float GL_EXT_color_buffer_float";
|
| - init.gl_version = "opengl es 3.0";
|
| - InitDecoder(init);
|
| + InitDecoder("GL_OES_texture_float GL_EXT_color_buffer_float", // extensions
|
| + "opengl es 3.0", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| const int kWidth = 8;
|
| const int kHeight = 4;
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| @@ -8907,10 +9225,15 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, TexImage2DFloatConvertsFormatDesktop) {
|
| - InitState init;
|
| - init.extensions = "GL_ARB_texture_float";
|
| - init.gl_version = "2.1";
|
| - InitDecoder(init);
|
| + InitDecoder("GL_ARB_texture_float", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + false); // bind generates resource
|
| DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
|
| DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 16, 17, 0, GL_RGBA, GL_FLOAT, 0,
|
| 0);
|
| @@ -8930,11 +9253,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, ReadFormatExtension) {
|
| - InitState init;
|
| - init.extensions = "GL_OES_read_format";
|
| - init.gl_version = "2.1";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "GL_OES_read_format", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
| @@ -8992,10 +9320,16 @@
|
| }
|
|
|
| TEST_F(GLES2DecoderManualInitTest, NoReadFormatExtension) {
|
| - InitState init;
|
| - init.gl_version = "2.1";
|
| - init.bind_generates_resource = true;
|
| - InitDecoder(init);
|
| + InitDecoder(
|
| + "", // extensions
|
| + "2.1", // gl version
|
| + false, // has alpha
|
| + false, // has depth
|
| + false, // has stencil
|
| + false, // request alpha
|
| + false, // request depth
|
| + false, // request stencil
|
| + true); // bind generates resource
|
|
|
| EXPECT_CALL(*gl_, GetError())
|
| .WillOnce(Return(GL_NO_ERROR))
|
|
|