| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
| 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 8 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 10 #include "gpu/command_buffer/common/gl_mock.h" | 10 #include "gpu/command_buffer/common/gl_mock.h" |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1383 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1384 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), *result); | 1384 EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE), *result); |
| 1385 } | 1385 } |
| 1386 | 1386 |
| 1387 TEST_F(GLES2DecoderWithShaderTest, BindAndDeleteFramebuffer) { | 1387 TEST_F(GLES2DecoderWithShaderTest, BindAndDeleteFramebuffer) { |
| 1388 SetupTexture(); | 1388 SetupTexture(); |
| 1389 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); | 1389 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); |
| 1390 SetupExpectationsForApplyingDefaultDirtyState(); | 1390 SetupExpectationsForApplyingDefaultDirtyState(); |
| 1391 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 1391 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| 1392 kServiceFramebufferId); | 1392 kServiceFramebufferId); |
| 1393 DoDeleteFramebuffer(client_framebuffer_id_, kServiceFramebufferId); | 1393 DoDeleteFramebuffer( |
| 1394 client_framebuffer_id_, kServiceFramebufferId, |
| 1395 true, GL_FRAMEBUFFER, 0, |
| 1396 true, GL_FRAMEBUFFER, 0); |
| 1394 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 1397 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
| 1395 .Times(1) | 1398 .Times(1) |
| 1396 .RetiresOnSaturation(); | 1399 .RetiresOnSaturation(); |
| 1397 DrawArrays cmd; | 1400 DrawArrays cmd; |
| 1398 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 1401 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
| 1399 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 1402 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 1400 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 1403 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 1401 } | 1404 } |
| 1402 | 1405 |
| 1403 TEST_F(GLES2DecoderTest, FramebufferRenderbufferWithNoBoundTarget) { | 1406 TEST_F(GLES2DecoderTest, FramebufferRenderbufferWithNoBoundTarget) { |
| (...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2813 EXPECT_TRUE(DoIsBuffer(client_buffer_id_)); | 2816 EXPECT_TRUE(DoIsBuffer(client_buffer_id_)); |
| 2814 DoDeleteBuffer(client_buffer_id_, kServiceBufferId); | 2817 DoDeleteBuffer(client_buffer_id_, kServiceBufferId); |
| 2815 EXPECT_FALSE(DoIsBuffer(client_buffer_id_)); | 2818 EXPECT_FALSE(DoIsBuffer(client_buffer_id_)); |
| 2816 } | 2819 } |
| 2817 | 2820 |
| 2818 TEST_F(GLES2DecoderTest, IsFramebuffer) { | 2821 TEST_F(GLES2DecoderTest, IsFramebuffer) { |
| 2819 EXPECT_FALSE(DoIsFramebuffer(client_framebuffer_id_)); | 2822 EXPECT_FALSE(DoIsFramebuffer(client_framebuffer_id_)); |
| 2820 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 2823 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| 2821 kServiceFramebufferId); | 2824 kServiceFramebufferId); |
| 2822 EXPECT_TRUE(DoIsFramebuffer(client_framebuffer_id_)); | 2825 EXPECT_TRUE(DoIsFramebuffer(client_framebuffer_id_)); |
| 2823 DoDeleteFramebuffer(client_framebuffer_id_, kServiceFramebufferId); | 2826 DoDeleteFramebuffer( |
| 2827 client_framebuffer_id_, kServiceFramebufferId, |
| 2828 true, GL_FRAMEBUFFER, 0, |
| 2829 true, GL_FRAMEBUFFER, 0); |
| 2824 EXPECT_FALSE(DoIsFramebuffer(client_framebuffer_id_)); | 2830 EXPECT_FALSE(DoIsFramebuffer(client_framebuffer_id_)); |
| 2825 } | 2831 } |
| 2826 | 2832 |
| 2827 TEST_F(GLES2DecoderTest, IsProgram) { | 2833 TEST_F(GLES2DecoderTest, IsProgram) { |
| 2828 // IsProgram is true as soon as the program is created. | 2834 // IsProgram is true as soon as the program is created. |
| 2829 EXPECT_TRUE(DoIsProgram(client_program_id_)); | 2835 EXPECT_TRUE(DoIsProgram(client_program_id_)); |
| 2830 DoDeleteProgram(client_program_id_, kServiceProgramId); | 2836 DoDeleteProgram(client_program_id_, kServiceProgramId); |
| 2831 EXPECT_FALSE(DoIsProgram(client_program_id_)); | 2837 EXPECT_FALSE(DoIsProgram(client_program_id_)); |
| 2832 } | 2838 } |
| 2833 | 2839 |
| (...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5028 // TODO(gman): TexImage2DImmediate | 5034 // TODO(gman): TexImage2DImmediate |
| 5029 | 5035 |
| 5030 // TODO(gman): TexSubImage2DImmediate | 5036 // TODO(gman): TexSubImage2DImmediate |
| 5031 | 5037 |
| 5032 // TODO(gman): UseProgram | 5038 // TODO(gman): UseProgram |
| 5033 | 5039 |
| 5034 // TODO(gman): SwapBuffers | 5040 // TODO(gman): SwapBuffers |
| 5035 | 5041 |
| 5036 } // namespace gles2 | 5042 } // namespace gles2 |
| 5037 } // namespace gpu | 5043 } // namespace gpu |
| OLD | NEW |