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 // Tests for GLES2Implementation. | 5 // Tests for GLES2Implementation. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 EXPECT_CALL(*command_buffer(), OnFlush()) | 394 EXPECT_CALL(*command_buffer(), OnFlush()) |
395 .WillOnce(SetMemory(mem1.ptr + sizeof(int_state), int_state)) | 395 .WillOnce(SetMemory(mem1.ptr + sizeof(int_state), int_state)) |
396 .RetiresOnSaturation(); | 396 .RetiresOnSaturation(); |
397 GetNextToken(); // eat the token that starting up will use. | 397 GetNextToken(); // eat the token that starting up will use. |
398 | 398 |
399 gl_.reset(new GLES2Implementation( | 399 gl_.reset(new GLES2Implementation( |
400 helper_.get(), | 400 helper_.get(), |
401 NULL, | 401 NULL, |
402 transfer_buffer_.get(), | 402 transfer_buffer_.get(), |
403 bind_generates_resource, | 403 bind_generates_resource)); |
404 NULL)); | |
405 ASSERT_TRUE(gl_->Initialize( | 404 ASSERT_TRUE(gl_->Initialize( |
406 kTransferBufferSize, | 405 kTransferBufferSize, |
407 kTransferBufferSize, | 406 kTransferBufferSize, |
408 kTransferBufferSize)); | 407 kTransferBufferSize)); |
409 } | 408 } |
410 | 409 |
411 EXPECT_CALL(*command_buffer(), OnFlush()) | 410 EXPECT_CALL(*command_buffer(), OnFlush()) |
412 .Times(1) | 411 .Times(1) |
413 .RetiresOnSaturation(); | 412 .RetiresOnSaturation(); |
414 helper_->CommandBufferHelper::Finish(); | 413 helper_->CommandBufferHelper::Finish(); |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2467 } | 2466 } |
2468 | 2467 |
2469 TEST_F(GLES2ImplementationTest, GetString) { | 2468 TEST_F(GLES2ImplementationTest, GetString) { |
2470 const uint32 kBucketId = GLES2Implementation::kResultBucketId; | 2469 const uint32 kBucketId = GLES2Implementation::kResultBucketId; |
2471 const Str7 kString = {"foobar"}; | 2470 const Str7 kString = {"foobar"}; |
2472 // GL_CHROMIUM_map_sub GL_CHROMIUM_flipy are hard coded into | 2471 // GL_CHROMIUM_map_sub GL_CHROMIUM_flipy are hard coded into |
2473 // GLES2Implementation. | 2472 // GLES2Implementation. |
2474 const char* expected_str = | 2473 const char* expected_str = |
2475 "foobar " | 2474 "foobar " |
2476 "GL_CHROMIUM_flipy " | 2475 "GL_CHROMIUM_flipy " |
| 2476 "GL_CHROMIUM_map_image " |
2477 "GL_CHROMIUM_map_sub " | 2477 "GL_CHROMIUM_map_sub " |
2478 "GL_CHROMIUM_shallow_flush " | 2478 "GL_CHROMIUM_shallow_flush " |
2479 "GL_EXT_unpack_subimage"; | 2479 "GL_EXT_unpack_subimage"; |
2480 const char kBad = 0x12; | 2480 const char kBad = 0x12; |
2481 struct Cmds { | 2481 struct Cmds { |
2482 cmd::SetBucketSize set_bucket_size1; | 2482 cmd::SetBucketSize set_bucket_size1; |
2483 cmds::GetString get_string; | 2483 cmds::GetString get_string; |
2484 cmd::GetBucketStart get_bucket_start; | 2484 cmd::GetBucketStart get_bucket_start; |
2485 cmd::SetToken set_token1; | 2485 cmd::SetToken set_token1; |
2486 cmd::SetBucketSize set_bucket_size2; | 2486 cmd::SetBucketSize set_bucket_size2; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 ClearCommands(); | 2867 ClearCommands(); |
2868 gl_->Enable(GL_BLEND); | 2868 gl_->Enable(GL_BLEND); |
2869 EXPECT_TRUE(NoCommandsWritten()); | 2869 EXPECT_TRUE(NoCommandsWritten()); |
2870 } | 2870 } |
2871 | 2871 |
2872 | 2872 |
2873 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 2873 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
2874 | 2874 |
2875 } // namespace gles2 | 2875 } // namespace gles2 |
2876 } // namespace gpu | 2876 } // namespace gpu |
OLD | NEW |