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 <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2760 | 2760 |
2761 // EXPECT_EQ can't be used to compare function pointers | 2761 // EXPECT_EQ can't be used to compare function pointers |
2762 EXPECT_TRUE( | 2762 EXPECT_TRUE( |
2763 gfx::MockGLInterface::GetGLProcAddress("glInvalidateFramebuffer") != | 2763 gfx::MockGLInterface::GetGLProcAddress("glInvalidateFramebuffer") != |
2764 gfx::g_driver_gl.fn.glDiscardFramebufferEXTFn); | 2764 gfx::g_driver_gl.fn.glDiscardFramebufferEXTFn); |
2765 EXPECT_TRUE( | 2765 EXPECT_TRUE( |
2766 gfx::MockGLInterface::GetGLProcAddress("glInvalidateFramebuffer") != | 2766 gfx::MockGLInterface::GetGLProcAddress("glInvalidateFramebuffer") != |
2767 gfx::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT")); | 2767 gfx::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT")); |
2768 } | 2768 } |
2769 | 2769 |
| 2770 TEST_P(GLES2DecoderManualInitTest, ClearBackbufferBitsOnFlipSwap) { |
| 2771 InitState init; |
| 2772 init.gl_version = "opengl es 2.0"; |
| 2773 InitDecoder(init); |
| 2774 surface_->set_buffers_flipped(true); |
| 2775 |
| 2776 EXPECT_EQ(0u, GetAndClearBackbufferClearBitsForTest()); |
| 2777 |
| 2778 SwapBuffers& cmd = *GetImmediateAs<SwapBuffers>(); |
| 2779 cmd.Init(); |
| 2780 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2781 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2782 EXPECT_EQ(static_cast<uint32_t>(GL_COLOR_BUFFER_BIT), |
| 2783 GetAndClearBackbufferClearBitsForTest()); |
| 2784 |
| 2785 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2786 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2787 EXPECT_EQ(0u, GetAndClearBackbufferClearBitsForTest()); |
| 2788 |
| 2789 ResizeCHROMIUM& resize_cmd = *GetImmediateAs<ResizeCHROMIUM>(); |
| 2790 resize_cmd.Init(1, 1, 1.0f, GL_TRUE); |
| 2791 EXPECT_EQ(error::kNoError, ExecuteCmd(resize_cmd)); |
| 2792 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2793 EXPECT_EQ(static_cast<uint32_t>(GL_COLOR_BUFFER_BIT), |
| 2794 GetAndClearBackbufferClearBitsForTest()); |
| 2795 |
| 2796 cmd.Init(); |
| 2797 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2798 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2799 EXPECT_EQ(static_cast<uint32_t>(GL_COLOR_BUFFER_BIT), |
| 2800 GetAndClearBackbufferClearBitsForTest()); |
| 2801 |
| 2802 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
| 2803 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2804 EXPECT_EQ(0u, GetAndClearBackbufferClearBitsForTest()); |
| 2805 } |
| 2806 |
2770 TEST_P(GLES2DecoderManualInitTest, DiscardFramebufferEXT) { | 2807 TEST_P(GLES2DecoderManualInitTest, DiscardFramebufferEXT) { |
2771 InitState init; | 2808 InitState init; |
2772 init.extensions = "GL_EXT_discard_framebuffer"; | 2809 init.extensions = "GL_EXT_discard_framebuffer"; |
2773 init.gl_version = "opengl es 2.0"; | 2810 init.gl_version = "opengl es 2.0"; |
2774 InitDecoder(init); | 2811 InitDecoder(init); |
2775 | 2812 |
2776 // EXPECT_EQ can't be used to compare function pointers | 2813 // EXPECT_EQ can't be used to compare function pointers |
2777 EXPECT_TRUE( | 2814 EXPECT_TRUE( |
2778 gfx::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT") == | 2815 gfx::MockGLInterface::GetGLProcAddress("glDiscardFramebufferEXT") == |
2779 gfx::g_driver_gl.fn.glDiscardFramebufferEXTFn); | 2816 gfx::g_driver_gl.fn.glDiscardFramebufferEXTFn); |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3090 EXPECT_EQ(1, result->GetNumResults()); | 3127 EXPECT_EQ(1, result->GetNumResults()); |
3091 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 3128 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
3092 } | 3129 } |
3093 | 3130 |
3094 // TODO(gman): PixelStorei | 3131 // TODO(gman): PixelStorei |
3095 | 3132 |
3096 // TODO(gman): SwapBuffers | 3133 // TODO(gman): SwapBuffers |
3097 | 3134 |
3098 } // namespace gles2 | 3135 } // namespace gles2 |
3099 } // namespace gpu | 3136 } // namespace gpu |
OLD | NEW |