| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 base::CommandLine command_line(0, NULL); | 60 base::CommandLine command_line(0, NULL); |
| 61 command_line.AppendSwitchASCII( | 61 command_line.AppendSwitchASCII( |
| 62 switches::kGpuDriverBugWorkarounds, | 62 switches::kGpuDriverBugWorkarounds, |
| 63 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS)); | 63 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS)); |
| 64 InitState init; | 64 InitState init; |
| 65 init.bind_generates_resource = true; | 65 init.bind_generates_resource = true; |
| 66 InitDecoderWithCommandLine(init, &command_line); | 66 InitDecoderWithCommandLine(init, &command_line); |
| 67 SetupDefaultProgram(); | 67 SetupDefaultProgram(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Override default setup so nothing gets setup. | |
| 71 void GLES2DecoderManualInitTest::SetUp() { | |
| 72 } | |
| 73 | |
| 74 void GLES2DecoderManualInitTest::EnableDisableTest(GLenum cap, | 70 void GLES2DecoderManualInitTest::EnableDisableTest(GLenum cap, |
| 75 bool enable, | 71 bool enable, |
| 76 bool expect_set) { | 72 bool expect_set) { |
| 77 if (expect_set) { | 73 if (expect_set) { |
| 78 SetupExpectationsForEnableDisable(cap, enable); | 74 SetupExpectationsForEnableDisable(cap, enable); |
| 79 } | 75 } |
| 80 if (enable) { | 76 if (enable) { |
| 81 Enable cmd; | 77 Enable cmd; |
| 82 cmd.Init(cap); | 78 cmd.Init(cap); |
| 83 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 79 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 84 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 80 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 85 } else { | 81 } else { |
| 86 Disable cmd; | 82 Disable cmd; |
| 87 cmd.Init(cap); | 83 cmd.Init(cap); |
| 88 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 84 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 89 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 85 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 90 } | 86 } |
| 91 } | 87 } |
| 92 | 88 |
| 93 void GLES3DecoderTest::SetUp() { | |
| 94 base::CommandLine command_line(0, NULL); | |
| 95 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | |
| 96 InitState init; | |
| 97 init.gl_version = "OpenGL ES 3.0"; | |
| 98 init.bind_generates_resource = true; | |
| 99 init.context_type = CONTEXT_TYPE_OPENGLES3; | |
| 100 InitDecoderWithCommandLine(init, &command_line); | |
| 101 } | |
| 102 | |
| 103 | 89 |
| 104 TEST_P(GLES3DecoderTest, Basic) { | 90 TEST_P(GLES3DecoderTest, Basic) { |
| 105 // Make sure the setup is correct for ES3. | 91 // Make sure the setup is correct for ES3. |
| 106 EXPECT_TRUE(decoder_->unsafe_es3_apis_enabled()); | 92 EXPECT_TRUE(decoder_->unsafe_es3_apis_enabled()); |
| 107 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid( | 93 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid( |
| 108 GL_TEXTURE_3D)); | 94 GL_TEXTURE_3D)); |
| 109 } | 95 } |
| 110 | 96 |
| 111 TEST_P(GLES2DecoderTest, InvalidCommand) { | 97 TEST_P(GLES2DecoderTest, InvalidCommand) { |
| 112 cmd::Noop cmd; | 98 cmd::Noop cmd; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 .RetiresOnSaturation(); | 285 .RetiresOnSaturation(); |
| 300 EXPECT_CALL(*gl_, GetInternalformativ(GL_RENDERBUFFER, GL_RGBA8, | 286 EXPECT_CALL(*gl_, GetInternalformativ(GL_RENDERBUFFER, GL_RGBA8, |
| 301 GL_SAMPLES, kNumSampleCounts, | 287 GL_SAMPLES, kNumSampleCounts, |
| 302 result->GetData())) | 288 result->GetData())) |
| 303 .Times(1) | 289 .Times(1) |
| 304 .RetiresOnSaturation(); | 290 .RetiresOnSaturation(); |
| 305 result->size = 0; | 291 result->size = 0; |
| 306 GetInternalformativ cmd; | 292 GetInternalformativ cmd; |
| 307 cmd.Init(GL_RENDERBUFFER, GL_RGBA8, GL_SAMPLES, | 293 cmd.Init(GL_RENDERBUFFER, GL_RGBA8, GL_SAMPLES, |
| 308 shared_memory_id_, shared_memory_offset_); | 294 shared_memory_id_, shared_memory_offset_); |
| 309 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 310 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 295 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 311 EXPECT_EQ(kNumSampleCounts, result->GetNumResults()); | 296 EXPECT_EQ(kNumSampleCounts, result->GetNumResults()); |
| 312 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 297 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 313 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 314 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 315 } | 298 } |
| 316 | 299 |
| 317 TEST_P(GLES3DecoderTest, GetInternalformativValidArgsNumSampleCounts) { | 300 TEST_P(GLES3DecoderTest, GetInternalformativValidArgsNumSampleCounts) { |
| 318 const GLint kNumSampleCounts = 8; | 301 const GLint kNumSampleCounts = 8; |
| 319 typedef GetInternalformativ::Result Result; | 302 typedef GetInternalformativ::Result Result; |
| 320 Result* result = static_cast<Result*>(shared_memory_address_); | 303 Result* result = static_cast<Result*>(shared_memory_address_); |
| 321 EXPECT_CALL(*gl_, GetInternalformativ(GL_RENDERBUFFER, GL_RGBA8, | 304 EXPECT_CALL(*gl_, GetInternalformativ(GL_RENDERBUFFER, GL_RGBA8, |
| 322 GL_NUM_SAMPLE_COUNTS, 1, _)) | 305 GL_NUM_SAMPLE_COUNTS, 1, _)) |
| 323 .WillOnce(SetArgPointee<4>(kNumSampleCounts)) | 306 .WillOnce(SetArgPointee<4>(kNumSampleCounts)) |
| 324 .RetiresOnSaturation(); | 307 .RetiresOnSaturation(); |
| 325 result->size = 0; | 308 result->size = 0; |
| 326 GetInternalformativ cmd; | 309 GetInternalformativ cmd; |
| 327 cmd.Init(GL_RENDERBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, | 310 cmd.Init(GL_RENDERBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, |
| 328 shared_memory_id_, shared_memory_offset_); | 311 shared_memory_id_, shared_memory_offset_); |
| 329 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 330 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 312 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 331 EXPECT_EQ(1, result->GetNumResults()); | 313 EXPECT_EQ(1, result->GetNumResults()); |
| 332 EXPECT_EQ(kNumSampleCounts, result->GetData()[0]); | 314 EXPECT_EQ(kNumSampleCounts, result->GetData()[0]); |
| 333 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 315 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 334 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 335 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 336 } | 316 } |
| 337 | 317 |
| 338 TEST_P(GLES3DecoderTest, ClientWaitSyncValid) { | 318 TEST_P(GLES3DecoderTest, ClientWaitSyncValid) { |
| 339 typedef ClientWaitSync::Result Result; | 319 typedef ClientWaitSync::Result Result; |
| 340 Result* result = static_cast<Result*>(shared_memory_address_); | 320 Result* result = static_cast<Result*>(shared_memory_address_); |
| 341 ClientWaitSync cmd; | 321 ClientWaitSync cmd; |
| 342 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, | 322 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, |
| 343 shared_memory_id_, shared_memory_offset_); | 323 shared_memory_id_, shared_memory_offset_); |
| 344 EXPECT_CALL(*gl_, | 324 EXPECT_CALL(*gl_, |
| 345 ClientWaitSync(reinterpret_cast<GLsync>(kServiceSyncId), | 325 ClientWaitSync(reinterpret_cast<GLsync>(kServiceSyncId), |
| 346 GL_SYNC_FLUSH_COMMANDS_BIT, 0)) | 326 GL_SYNC_FLUSH_COMMANDS_BIT, 0)) |
| 347 .WillOnce(Return(GL_CONDITION_SATISFIED)) | 327 .WillOnce(Return(GL_CONDITION_SATISFIED)) |
| 348 .RetiresOnSaturation(); | 328 .RetiresOnSaturation(); |
| 349 *result = GL_WAIT_FAILED; | 329 *result = GL_WAIT_FAILED; |
| 350 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 351 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 330 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 352 EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), *result); | 331 EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), *result); |
| 353 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 332 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 354 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 355 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 356 } | 333 } |
| 357 | 334 |
| 358 TEST_P(GLES2DecoderTest, ClientWaitSyncNonZeroTimeoutValid) { | 335 TEST_P(GLES3DecoderTest, ClientWaitSyncNonZeroTimeoutValid) { |
| 359 typedef ClientWaitSync::Result Result; | 336 typedef ClientWaitSync::Result Result; |
| 360 Result* result = static_cast<Result*>(shared_memory_address_); | 337 Result* result = static_cast<Result*>(shared_memory_address_); |
| 361 ClientWaitSync cmd; | 338 ClientWaitSync cmd; |
| 362 const GLuint64 kTimeout = 0xABCDEF0123456789; | 339 const GLuint64 kTimeout = 0xABCDEF0123456789; |
| 363 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, kTimeout, | 340 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, kTimeout, |
| 364 shared_memory_id_, shared_memory_offset_); | 341 shared_memory_id_, shared_memory_offset_); |
| 365 EXPECT_CALL(*gl_, | 342 EXPECT_CALL(*gl_, |
| 366 ClientWaitSync(reinterpret_cast<GLsync>(kServiceSyncId), | 343 ClientWaitSync(reinterpret_cast<GLsync>(kServiceSyncId), |
| 367 GL_SYNC_FLUSH_COMMANDS_BIT, kTimeout)) | 344 GL_SYNC_FLUSH_COMMANDS_BIT, kTimeout)) |
| 368 .WillOnce(Return(GL_CONDITION_SATISFIED)) | 345 .WillOnce(Return(GL_CONDITION_SATISFIED)) |
| 369 .RetiresOnSaturation(); | 346 .RetiresOnSaturation(); |
| 370 *result = GL_WAIT_FAILED; | 347 *result = GL_WAIT_FAILED; |
| 371 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 372 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 348 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 373 EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), *result); | 349 EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), *result); |
| 374 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 350 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 375 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 376 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 377 } | 351 } |
| 378 | 352 |
| 379 TEST_P(GLES2DecoderTest, ClientWaitSyncInvalidSyncFails) { | 353 TEST_P(GLES3DecoderTest, ClientWaitSyncInvalidSyncFails) { |
| 380 typedef ClientWaitSync::Result Result; | 354 typedef ClientWaitSync::Result Result; |
| 381 Result* result = static_cast<Result*>(shared_memory_address_); | 355 Result* result = static_cast<Result*>(shared_memory_address_); |
| 382 ClientWaitSync cmd; | 356 ClientWaitSync cmd; |
| 383 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 384 cmd.Init(kInvalidClientId, GL_SYNC_FLUSH_COMMANDS_BIT, 0, | 357 cmd.Init(kInvalidClientId, GL_SYNC_FLUSH_COMMANDS_BIT, 0, |
| 385 shared_memory_id_, shared_memory_offset_); | 358 shared_memory_id_, shared_memory_offset_); |
| 386 *result = GL_WAIT_FAILED; | 359 *result = GL_WAIT_FAILED; |
| 387 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 360 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 388 EXPECT_EQ(static_cast<GLenum>(GL_WAIT_FAILED), *result); | 361 EXPECT_EQ(static_cast<GLenum>(GL_WAIT_FAILED), *result); |
| 389 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); | 362 EXPECT_EQ(GL_INVALID_VALUE, GetGLError()); |
| 390 } | 363 } |
| 391 | 364 |
| 392 TEST_P(GLES2DecoderTest, ClientWaitSyncResultNotInitFails) { | 365 TEST_P(GLES3DecoderTest, ClientWaitSyncResultNotInitFails) { |
| 393 typedef ClientWaitSync::Result Result; | 366 typedef ClientWaitSync::Result Result; |
| 394 Result* result = static_cast<Result*>(shared_memory_address_); | 367 Result* result = static_cast<Result*>(shared_memory_address_); |
| 395 ClientWaitSync cmd; | 368 ClientWaitSync cmd; |
| 396 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 397 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, | 369 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, |
| 398 shared_memory_id_, shared_memory_offset_); | 370 shared_memory_id_, shared_memory_offset_); |
| 399 *result = 1; // Any value other than GL_WAIT_FAILED | 371 *result = 1; // Any value other than GL_WAIT_FAILED |
| 400 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 372 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
| 401 } | 373 } |
| 402 | 374 |
| 403 TEST_P(GLES2DecoderTest, ClientWaitSyncBadSharedMemoryFails) { | 375 TEST_P(GLES3DecoderTest, ClientWaitSyncBadSharedMemoryFails) { |
| 404 typedef ClientWaitSync::Result Result; | 376 typedef ClientWaitSync::Result Result; |
| 405 Result* result = static_cast<Result*>(shared_memory_address_); | 377 Result* result = static_cast<Result*>(shared_memory_address_); |
| 406 ClientWaitSync cmd; | 378 ClientWaitSync cmd; |
| 407 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 408 *result = GL_WAIT_FAILED; | 379 *result = GL_WAIT_FAILED; |
| 409 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, | 380 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, |
| 410 kInvalidSharedMemoryId, shared_memory_offset_); | 381 kInvalidSharedMemoryId, shared_memory_offset_); |
| 411 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 382 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
| 412 | 383 |
| 413 *result = GL_WAIT_FAILED; | 384 *result = GL_WAIT_FAILED; |
| 414 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, | 385 cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0, |
| 415 shared_memory_id_, kInvalidSharedMemoryOffset); | 386 shared_memory_id_, kInvalidSharedMemoryOffset); |
| 416 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); | 387 EXPECT_NE(error::kNoError, ExecuteCmd(cmd)); |
| 417 } | 388 } |
| 418 | 389 |
| 419 TEST_P(GLES2DecoderTest, WaitSyncValidArgs) { | 390 TEST_P(GLES3DecoderTest, WaitSyncValidArgs) { |
| 420 const GLuint64 kTimeout = GL_TIMEOUT_IGNORED; | 391 const GLuint64 kTimeout = GL_TIMEOUT_IGNORED; |
| 421 EXPECT_CALL(*gl_, WaitSync(reinterpret_cast<GLsync>(kServiceSyncId), | 392 EXPECT_CALL(*gl_, WaitSync(reinterpret_cast<GLsync>(kServiceSyncId), |
| 422 0, kTimeout)) | 393 0, kTimeout)) |
| 423 .Times(1) | 394 .Times(1) |
| 424 .RetiresOnSaturation(); | 395 .RetiresOnSaturation(); |
| 425 | 396 |
| 426 WaitSync cmd; | 397 WaitSync cmd; |
| 427 cmd.Init(client_sync_id_, 0, kTimeout); | 398 cmd.Init(client_sync_id_, 0, kTimeout); |
| 428 decoder_->set_unsafe_es3_apis_enabled(true); | |
| 429 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 399 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 430 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 400 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 431 decoder_->set_unsafe_es3_apis_enabled(false); | |
| 432 EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd)); | |
| 433 } | 401 } |
| 434 | 402 |
| 435 TEST_P(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) { | 403 TEST_P(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) { |
| 436 InitState init; | 404 InitState init; |
| 437 InitDecoder(init); | 405 InitDecoder(init); |
| 438 | 406 |
| 439 BindTexture cmd1; | 407 BindTexture cmd1; |
| 440 cmd1.Init(GL_TEXTURE_2D, kInvalidClientId); | 408 cmd1.Init(GL_TEXTURE_2D, kInvalidClientId); |
| 441 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); | 409 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1)); |
| 442 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); | 410 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 cmd.Init(); | 1680 cmd.Init(); |
| 1713 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1681 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1714 EXPECT_EQ(0, deschedule_until_finished_callback_count_); | 1682 EXPECT_EQ(0, deschedule_until_finished_callback_count_); |
| 1715 EXPECT_EQ(0, reschedule_after_finished_callback_count_); | 1683 EXPECT_EQ(0, reschedule_after_finished_callback_count_); |
| 1716 | 1684 |
| 1717 EXPECT_EQ(error::kDeferLaterCommands, ExecuteCmd(cmd)); | 1685 EXPECT_EQ(error::kDeferLaterCommands, ExecuteCmd(cmd)); |
| 1718 EXPECT_EQ(1, deschedule_until_finished_callback_count_); | 1686 EXPECT_EQ(1, deschedule_until_finished_callback_count_); |
| 1719 EXPECT_EQ(0, reschedule_after_finished_callback_count_); | 1687 EXPECT_EQ(0, reschedule_after_finished_callback_count_); |
| 1720 } | 1688 } |
| 1721 | 1689 |
| 1722 void GLES3DecoderWithESSL3ShaderTest::SetUp() { | 1690 void GLES3DecoderTest::SetUp() { |
| 1723 base::CommandLine command_line(0, nullptr); | 1691 base::CommandLine command_line(0, nullptr); |
| 1724 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); | 1692 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); |
| 1725 InitState init; | 1693 InitState init; |
| 1726 init.gl_version = "OpenGL ES 3.0"; | 1694 init.gl_version = "OpenGL ES 3.0"; |
| 1727 init.bind_generates_resource = true; | 1695 init.bind_generates_resource = true; |
| 1728 init.context_type = CONTEXT_TYPE_OPENGLES3; | 1696 init.context_type = CONTEXT_TYPE_OPENGLES3; |
| 1729 InitDecoderWithCommandLine(init, &command_line); | 1697 InitDecoderWithCommandLine(init, &command_line); |
| 1698 } |
| 1699 |
| 1700 void GLES3DecoderWithShaderTest::SetUp() { |
| 1701 base::CommandLine command_line(0, nullptr); |
| 1702 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); |
| 1703 InitState init; |
| 1704 init.gl_version = "OpenGL ES 3.0"; |
| 1705 init.bind_generates_resource = true; |
| 1706 init.context_type = CONTEXT_TYPE_OPENGLES3; |
| 1707 InitDecoderWithCommandLine(init, &command_line); |
| 1730 SetupDefaultProgram(); | 1708 SetupDefaultProgram(); |
| 1731 } | 1709 } |
| 1732 | 1710 |
| 1711 void GLES3DecoderRGBBackbufferTest::SetUp() { |
| 1712 base::CommandLine command_line(0, nullptr); |
| 1713 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs); |
| 1714 command_line.AppendSwitchASCII( |
| 1715 switches::kGpuDriverBugWorkarounds, |
| 1716 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS)); |
| 1717 InitState init; |
| 1718 init.gl_version = "OpenGL ES 3.0"; |
| 1719 init.bind_generates_resource = true; |
| 1720 init.context_type = CONTEXT_TYPE_OPENGLES3; |
| 1721 InitDecoderWithCommandLine(init, &command_line); |
| 1722 SetupDefaultProgram(); |
| 1723 } |
| 1724 |
| 1733 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest, ::testing::Bool()); | 1725 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest, ::testing::Bool()); |
| 1734 | 1726 |
| 1735 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderWithShaderTest, ::testing::Bool()); | 1727 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderWithShaderTest, ::testing::Bool()); |
| 1736 | 1728 |
| 1737 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderManualInitTest, ::testing::Bool()); | 1729 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderManualInitTest, ::testing::Bool()); |
| 1738 | 1730 |
| 1739 INSTANTIATE_TEST_CASE_P(Service, | 1731 INSTANTIATE_TEST_CASE_P(Service, |
| 1740 GLES2DecoderRGBBackbufferTest, | 1732 GLES2DecoderRGBBackbufferTest, |
| 1741 ::testing::Bool()); | 1733 ::testing::Bool()); |
| 1742 | 1734 |
| 1743 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool()); | 1735 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderDoCommandsTest, ::testing::Bool()); |
| 1744 | 1736 |
| 1745 INSTANTIATE_TEST_CASE_P(Service, | 1737 INSTANTIATE_TEST_CASE_P(Service, |
| 1746 GLES2DecoderDescheduleUntilFinishedTest, | 1738 GLES2DecoderDescheduleUntilFinishedTest, |
| 1747 ::testing::Bool()); | 1739 ::testing::Bool()); |
| 1748 | 1740 |
| 1749 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); | 1741 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool()); |
| 1750 | 1742 |
| 1743 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool()); |
| 1744 |
| 1745 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool()); |
| 1746 |
| 1751 INSTANTIATE_TEST_CASE_P(Service, | 1747 INSTANTIATE_TEST_CASE_P(Service, |
| 1752 GLES3DecoderWithESSL3ShaderTest, | 1748 GLES3DecoderRGBBackbufferTest, |
| 1753 ::testing::Bool()); | 1749 ::testing::Bool()); |
| 1754 | 1750 |
| 1755 } // namespace gles2 | 1751 } // namespace gles2 |
| 1756 } // namespace gpu | 1752 } // namespace gpu |
| OLD | NEW |