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 5581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5592 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); | 5592 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); |
5593 SetupExpectationsForApplyingDefaultDirtyState(); | 5593 SetupExpectationsForApplyingDefaultDirtyState(); |
5594 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) | 5594 EXPECT_CALL(*gl_, DrawArrays(GL_TRIANGLES, 0, kNumVertices)) |
5595 .Times(1) | 5595 .Times(1) |
5596 .RetiresOnSaturation(); | 5596 .RetiresOnSaturation(); |
5597 DrawArrays cmd; | 5597 DrawArrays cmd; |
5598 cmd.Init(GL_TRIANGLES, 0, kNumVertices); | 5598 cmd.Init(GL_TRIANGLES, 0, kNumVertices); |
5599 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 5599 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
5600 } | 5600 } |
5601 | 5601 |
| 5602 TEST_F(GLES2DecoderTest, TextureUsageAngleExtNotEnabledByDefault) { |
| 5603 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 5604 |
| 5605 TexParameteri cmd; |
| 5606 cmd.Init(GL_TEXTURE_2D, |
| 5607 GL_TEXTURE_USAGE_ANGLE, |
| 5608 GL_FRAMEBUFFER_ATTACHMENT_ANGLE); |
| 5609 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 5610 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); |
| 5611 } |
| 5612 |
5602 TEST_F(GLES2DecoderWithShaderTest, | 5613 TEST_F(GLES2DecoderWithShaderTest, |
5603 DrawClearsAfterRenderbuffersWithMultipleAttachments) { | 5614 DrawClearsAfterRenderbuffersWithMultipleAttachments) { |
5604 const GLuint kFBOClientTextureId = 4100; | 5615 const GLuint kFBOClientTextureId = 4100; |
5605 const GLuint kFBOServiceTextureId = 4101; | 5616 const GLuint kFBOServiceTextureId = 4101; |
5606 | 5617 |
5607 // Register a texture id. | 5618 // Register a texture id. |
5608 EXPECT_CALL(*gl_, GenTextures(_, _)) | 5619 EXPECT_CALL(*gl_, GenTextures(_, _)) |
5609 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) | 5620 .WillOnce(SetArgumentPointee<1>(kFBOServiceTextureId)) |
5610 .RetiresOnSaturation(); | 5621 .RetiresOnSaturation(); |
5611 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); | 5622 GenHelper<GenTexturesImmediate>(kFBOClientTextureId); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5717 // TODO(gman): TexImage2DImmediate | 5728 // TODO(gman): TexImage2DImmediate |
5718 | 5729 |
5719 // TODO(gman): TexSubImage2DImmediate | 5730 // TODO(gman): TexSubImage2DImmediate |
5720 | 5731 |
5721 // TODO(gman): UseProgram | 5732 // TODO(gman): UseProgram |
5722 | 5733 |
5723 // TODO(gman): SwapBuffers | 5734 // TODO(gman): SwapBuffers |
5724 | 5735 |
5725 } // namespace gles2 | 5736 } // namespace gles2 |
5726 } // namespace gpu | 5737 } // namespace gpu |
OLD | NEW |