OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/gfx/gl/gl_mock.h" | 5 #include "app/gfx/gl/gl_mock.h" |
6 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 6 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
7 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 7 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
9 #include "gpu/command_buffer/common/id_allocator.h" | 9 #include "gpu/command_buffer/common/id_allocator.h" |
10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
12 #include "gpu/command_buffer/service/context_group.h" | 12 #include "gpu/command_buffer/service/context_group.h" |
13 #include "gpu/command_buffer/service/program_manager.h" | 13 #include "gpu/command_buffer/service/program_manager.h" |
| 14 #include "gpu/command_buffer/service/test_helper.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 using ::gfx::MockGLInterface; | 17 using ::gfx::MockGLInterface; |
17 using ::testing::_; | 18 using ::testing::_; |
18 using ::testing::DoAll; | 19 using ::testing::DoAll; |
19 using ::testing::InSequence; | 20 using ::testing::InSequence; |
20 using ::testing::Invoke; | 21 using ::testing::Invoke; |
21 using ::testing::MatcherCast; | 22 using ::testing::MatcherCast; |
22 using ::testing::Pointee; | 23 using ::testing::Pointee; |
23 using ::testing::Return; | 24 using ::testing::Return; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // This is an NPOT texture. As the default filtering requires mips | 90 // This is an NPOT texture. As the default filtering requires mips |
90 // this should trigger replacing with black textures before rendering. | 91 // this should trigger replacing with black textures before rendering. |
91 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 92 DoTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 3, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
92 0, 0); | 93 0, 0); |
93 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); | 94 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); |
94 { | 95 { |
95 InSequence sequence; | 96 InSequence sequence; |
96 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) | 97 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) |
97 .Times(1) | 98 .Times(1) |
98 .RetiresOnSaturation(); | 99 .RetiresOnSaturation(); |
99 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceBlackTexture2dId)) | 100 EXPECT_CALL(*gl_, BindTexture( |
| 101 GL_TEXTURE_2D, TestHelper::kServiceBlackTexture2dId)) |
100 .Times(1) | 102 .Times(1) |
101 .RetiresOnSaturation(); | 103 .RetiresOnSaturation(); |
102 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 104 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
103 .Times(1) | 105 .Times(1) |
104 .RetiresOnSaturation(); | 106 .RetiresOnSaturation(); |
105 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) | 107 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) |
106 .Times(1) | 108 .Times(1) |
107 .RetiresOnSaturation(); | 109 .RetiresOnSaturation(); |
108 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)) | 110 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId)) |
109 .Times(1) | 111 .Times(1) |
(...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2584 // TODO(gman): UseProgram | 2586 // TODO(gman): UseProgram |
2585 | 2587 |
2586 // TODO(gman): SwapBuffers | 2588 // TODO(gman): SwapBuffers |
2587 | 2589 |
2588 // TODO(gman): VertexAttribPointer | 2590 // TODO(gman): VertexAttribPointer |
2589 | 2591 |
2590 } // namespace gles2 | 2592 } // namespace gles2 |
2591 } // namespace gpu | 2593 } // namespace gpu |
2592 | 2594 |
2593 | 2595 |
OLD | NEW |