| 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/gl_mock.h" | 7 #include "gpu/command_buffer/common/gl_mock.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/service/gles2_cmd_decoder_unittest_base.h" | 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool valid) { | 53 bool valid) { |
| 54 if (valid) { | 54 if (valid) { |
| 55 EXPECT_CALL(*gl_, GetError()) | 55 EXPECT_CALL(*gl_, GetError()) |
| 56 .WillOnce(Return(GL_NO_ERROR)) | 56 .WillOnce(Return(GL_NO_ERROR)) |
| 57 .WillOnce(Return(GL_NO_ERROR)) | 57 .WillOnce(Return(GL_NO_ERROR)) |
| 58 .RetiresOnSaturation(); | 58 .RetiresOnSaturation(); |
| 59 } | 59 } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 template <> | 62 template <> |
| 63 void GLES2DecoderTestBase::SpecializedSetup<CopyTexSubImage2D, 0>( | 63 void GLES2DecoderTestBase::SpecializedSetup<CopyTexSubImage2D, 0>(bool valid) { |
| 64 bool valid) { | |
| 65 if (valid) { | 64 if (valid) { |
| 66 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); | 65 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); |
| 67 DoTexImage2D( | 66 DoTexImage2D( |
| 68 GL_TEXTURE_2D, 2, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, | 67 GL_TEXTURE_2D, 2, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
| 69 0, 0); | 68 0, 0); |
| 70 } | 69 } |
| 71 }; | 70 }; |
| 72 | 71 |
| 73 template <> | 72 template <> |
| 73 void GLES2DecoderTestBase::SpecializedSetup<DetachShader, 0>(bool valid) { |
| 74 if (valid) { |
| 75 EXPECT_CALL(*gl_, |
| 76 AttachShader(kServiceProgramId, kServiceShaderId)) |
| 77 .Times(1) |
| 78 .RetiresOnSaturation(); |
| 79 AttachShader attach_cmd; |
| 80 attach_cmd.Init(client_program_id_, client_shader_id_); |
| 81 EXPECT_EQ(error::kNoError, ExecuteCmd(attach_cmd)); |
| 82 } |
| 83 }; |
| 84 |
| 85 template <> |
| 74 void GLES2DecoderTestBase::SpecializedSetup<FramebufferRenderbuffer, 0>( | 86 void GLES2DecoderTestBase::SpecializedSetup<FramebufferRenderbuffer, 0>( |
| 75 bool valid) { | 87 bool valid) { |
| 76 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, | 88 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, |
| 77 kServiceFramebufferId); | 89 kServiceFramebufferId); |
| 78 if (valid) { | 90 if (valid) { |
| 79 // Return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT so the code | 91 // Return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT so the code |
| 80 // doesn't try to clear the buffer. That is tested else where. | 92 // doesn't try to clear the buffer. That is tested else where. |
| 81 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) | 93 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) |
| 82 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) | 94 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 83 .RetiresOnSaturation(); | 95 .RetiresOnSaturation(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 .WillOnce(Return(GL_NO_ERROR)) | 141 .WillOnce(Return(GL_NO_ERROR)) |
| 130 .RetiresOnSaturation(); | 142 .RetiresOnSaturation(); |
| 131 } | 143 } |
| 132 }; | 144 }; |
| 133 | 145 |
| 134 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h" | 146 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h" |
| 135 | 147 |
| 136 } // namespace gles2 | 148 } // namespace gles2 |
| 137 } // namespace gpu | 149 } // namespace gpu |
| 138 | 150 |
| OLD | NEW |