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 <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 const GLsizei kDepth = 2; | 2640 const GLsizei kDepth = 2; |
2641 | 2641 |
2642 uint32 size = 0; | 2642 uint32 size = 0; |
2643 uint32 unpadded_row_size = 0; | 2643 uint32 unpadded_row_size = 0; |
2644 uint32 padded_row_size = 0; | 2644 uint32 padded_row_size = 0; |
2645 ASSERT_TRUE(GLES2Util::ComputeImageDataSizes( | 2645 ASSERT_TRUE(GLES2Util::ComputeImageDataSizes( |
2646 kWidth, 2, kDepth, kFormat, kType, kPixelStoreUnpackAlignment, | 2646 kWidth, 2, kDepth, kFormat, kType, kPixelStoreUnpackAlignment, |
2647 &size, &unpadded_row_size, &padded_row_size)); | 2647 &size, &unpadded_row_size, &padded_row_size)); |
2648 // Makes sure we can just send over the data in one command. | 2648 // Makes sure we can just send over the data in one command. |
2649 const GLsizei kHeight = MaxTransferBufferSize() / padded_row_size / kDepth; | 2649 const GLsizei kHeight = MaxTransferBufferSize() / padded_row_size / kDepth; |
| 2650 ASSERT_TRUE(GLES2Util::ComputeImageDataSizes( |
| 2651 kWidth, kHeight, kDepth, kFormat, kType, kPixelStoreUnpackAlignment, |
| 2652 &size, NULL, NULL)); |
2650 | 2653 |
2651 scoped_ptr<uint8[]> pixels(new uint8[size]); | 2654 scoped_ptr<uint8[]> pixels(new uint8[size]); |
2652 for (uint32 ii = 0; ii < size; ++ii) { | 2655 for (uint32 ii = 0; ii < size; ++ii) { |
2653 pixels[ii] = static_cast<uint8>(ii); | 2656 pixels[ii] = static_cast<uint8>(ii); |
2654 } | 2657 } |
2655 | 2658 |
2656 ExpectedMemoryInfo mem = GetExpectedMemory(size); | 2659 ExpectedMemoryInfo mem = GetExpectedMemory(size); |
2657 | 2660 |
2658 Cmds expected; | 2661 Cmds expected; |
2659 expected.tex_image_3d.Init( | 2662 expected.tex_image_3d.Init( |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3563 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { | 3566 TEST_F(GLES2ImplementationManualInitTest, FailInitOnTransferBufferFail) { |
3564 ContextInitOptions init_options; | 3567 ContextInitOptions init_options; |
3565 init_options.transfer_buffer_initialize_fail = true; | 3568 init_options.transfer_buffer_initialize_fail = true; |
3566 EXPECT_FALSE(Initialize(init_options)); | 3569 EXPECT_FALSE(Initialize(init_options)); |
3567 } | 3570 } |
3568 | 3571 |
3569 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" | 3572 #include "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h" |
3570 | 3573 |
3571 } // namespace gles2 | 3574 } // namespace gles2 |
3572 } // namespace gpu | 3575 } // namespace gpu |
OLD | NEW |