OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
(...skipping 2004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 .WillOnce(Return(GL_NO_ERROR)) | 2015 .WillOnce(Return(GL_NO_ERROR)) |
2016 .RetiresOnSaturation(); | 2016 .RetiresOnSaturation(); |
2017 EXPECT_CALL(*gl_, CopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 1, 1, 0)) | 2017 EXPECT_CALL(*gl_, CopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 1, 1, 0)) |
2018 .Times(1) | 2018 .Times(1) |
2019 .RetiresOnSaturation(); | 2019 .RetiresOnSaturation(); |
2020 EXPECT_CALL(*gl_, GetError()) | 2020 EXPECT_CALL(*gl_, GetError()) |
2021 .WillOnce(Return(GL_NO_ERROR)) | 2021 .WillOnce(Return(GL_NO_ERROR)) |
2022 .RetiresOnSaturation(); | 2022 .RetiresOnSaturation(); |
2023 CopyTexImage2D cmd; | 2023 CopyTexImage2D cmd; |
2024 cmd.Init(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 1, 1); | 2024 cmd.Init(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, 1, 1); |
| 2025 // Unbind fbo and bind again after CopyTexImage2D tp avoid feedback loops. |
| 2026 if (bound_fbo) { |
| 2027 DoBindFramebuffer(GL_FRAMEBUFFER, 0, 0); |
| 2028 } |
2025 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); | 2029 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2030 if (bound_fbo) { |
| 2031 DoBindFramebuffer( |
| 2032 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId); |
| 2033 } |
2026 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); | 2034 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); |
2027 | 2035 |
2028 // Test deleting texture marks fbo as not complete. | 2036 // Test deleting texture marks fbo as not complete. |
2029 framebuffer_manager->MarkAsComplete(framebuffer); | 2037 framebuffer_manager->MarkAsComplete(framebuffer); |
2030 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); | 2038 EXPECT_TRUE(framebuffer_manager->IsComplete(framebuffer)); |
2031 DoDeleteTexture(kFBOClientTextureId, kFBOServiceTextureId); | 2039 DoDeleteTexture(kFBOClientTextureId, kFBOServiceTextureId); |
2032 | 2040 |
2033 if (bound_fbo) { | 2041 if (bound_fbo) { |
2034 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); | 2042 EXPECT_FALSE(framebuffer_manager->IsComplete(framebuffer)); |
2035 } else { | 2043 } else { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2386 EXPECT_EQ(1, result->GetNumResults()); | 2394 EXPECT_EQ(1, result->GetNumResults()); |
2387 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2395 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
2388 } | 2396 } |
2389 | 2397 |
2390 // TODO(gman): PixelStorei | 2398 // TODO(gman): PixelStorei |
2391 | 2399 |
2392 // TODO(gman): SwapBuffers | 2400 // TODO(gman): SwapBuffers |
2393 | 2401 |
2394 } // namespace gles2 | 2402 } // namespace gles2 |
2395 } // namespace gpu | 2403 } // namespace gpu |
OLD | NEW |