| 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 #include "gpu/command_buffer/service/error_state_mock.h" | 5 #include "gpu/command_buffer/service/error_state_mock.h" |
| 6 #include "gpu/command_buffer/service/framebuffer_manager.h" | 6 #include "gpu/command_buffer/service/framebuffer_manager.h" |
| 7 #include "gpu/command_buffer/service/feature_info.h" | 7 #include "gpu/command_buffer/service/feature_info.h" |
| 8 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 8 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 9 #include "gpu/command_buffer/service/test_helper.h" | 9 #include "gpu/command_buffer/service/test_helper.h" |
| 10 #include "gpu/command_buffer/service/texture_manager.h" | 10 #include "gpu/command_buffer/service/texture_manager.h" |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 | 831 |
| 832 // Check a second call for the same type does not call anything. | 832 // Check a second call for the same type does not call anything. |
| 833 if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) { | 833 if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) { |
| 834 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) | 834 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) |
| 835 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 835 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 836 .RetiresOnSaturation(); | 836 .RetiresOnSaturation(); |
| 837 } | 837 } |
| 838 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 838 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 839 | 839 |
| 840 // Check changing the format calls CheckFramebuffferStatus. | 840 // Check changing the format calls CheckFramebuffferStatus. |
| 841 TestHelper::SetTexParameterWithExpectations(gl_.get(), | 841 TestHelper::SetTexParameteriWithExpectations(gl_.get(), |
| 842 error_state_.get(), | 842 error_state_.get(), |
| 843 texture_manager_.get(), | 843 texture_manager_.get(), |
| 844 texture2.get(), | 844 texture2.get(), |
| 845 GL_TEXTURE_WRAP_S, | 845 GL_TEXTURE_WRAP_S, |
| 846 GL_CLAMP_TO_EDGE, | 846 GL_CLAMP_TO_EDGE, |
| 847 GL_NO_ERROR); | 847 GL_NO_ERROR); |
| 848 | 848 |
| 849 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) | 849 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) |
| 850 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) | 850 .WillOnce(Return(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)) |
| 851 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 851 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 852 .RetiresOnSaturation(); | 852 .RetiresOnSaturation(); |
| 853 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 853 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 854 | 854 |
| 855 // Check since it did not return FRAMEBUFFER_COMPLETE that it calls | 855 // Check since it did not return FRAMEBUFFER_COMPLETE that it calls |
| 856 // CheckFramebufferStatus | 856 // CheckFramebufferStatus |
| 857 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 857 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 858 | 858 |
| 859 // Check putting it back does not call CheckFramebufferStatus. | 859 // Check putting it back does not call CheckFramebufferStatus. |
| 860 if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) { | 860 if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) { |
| 861 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) | 861 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) |
| 862 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 862 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 863 .RetiresOnSaturation(); | 863 .RetiresOnSaturation(); |
| 864 } | 864 } |
| 865 TestHelper::SetTexParameterWithExpectations(gl_.get(), | 865 TestHelper::SetTexParameteriWithExpectations(gl_.get(), |
| 866 error_state_.get(), | 866 error_state_.get(), |
| 867 texture_manager_.get(), | 867 texture_manager_.get(), |
| 868 texture2.get(), | 868 texture2.get(), |
| 869 GL_TEXTURE_WRAP_S, | 869 GL_TEXTURE_WRAP_S, |
| 870 GL_REPEAT, | 870 GL_REPEAT, |
| 871 GL_NO_ERROR); | 871 GL_NO_ERROR); |
| 872 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 872 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 873 | 873 |
| 874 // Check Unbinding does not call CheckFramebufferStatus | 874 // Check Unbinding does not call CheckFramebufferStatus |
| 875 framebuffer_->UnbindRenderbuffer(GL_RENDERBUFFER, renderbuffer1); | 875 framebuffer_->UnbindRenderbuffer(GL_RENDERBUFFER, renderbuffer1); |
| 876 if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) { | 876 if (!framebuffer_->AllowFramebufferComboCompleteMapForTesting()) { |
| 877 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) | 877 EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_READ_FRAMEBUFFER)) |
| 878 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) | 878 .WillOnce(Return(GL_FRAMEBUFFER_COMPLETE)) |
| 879 .RetiresOnSaturation(); | 879 .RetiresOnSaturation(); |
| 880 } | 880 } |
| 881 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); | 881 framebuffer_->GetStatus(texture_manager_.get(), GL_READ_FRAMEBUFFER); |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace gles2 | 884 } // namespace gles2 |
| 885 } // namespace gpu | 885 } // namespace gpu |
| 886 | 886 |
| 887 | 887 |
| OLD | NEW |