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 #ifndef GL_GLEXT_PROTOTYPES | 5 #ifndef GL_GLEXT_PROTOTYPES |
6 #define GL_GLEXT_PROTOTYPES | 6 #define GL_GLEXT_PROTOTYPES |
7 #endif | 7 #endif |
8 | 8 |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // A collection of tests that exercise the glClear workaround. | 25 // A collection of tests that exercise the glClear workaround. |
26 class GLClearFramebufferTest : public testing::TestWithParam<bool> { | 26 class GLClearFramebufferTest : public testing::TestWithParam<bool> { |
27 public: | 27 public: |
28 GLClearFramebufferTest() : color_handle_(0u), depth_handle_(0u) {} | 28 GLClearFramebufferTest() : color_handle_(0u), depth_handle_(0u) {} |
29 | 29 |
30 protected: | 30 protected: |
31 void SetUp() override { | 31 void SetUp() override { |
32 if (GetParam()) { | 32 if (GetParam()) { |
33 // Force the glClear() workaround so we can test it here. | 33 // Force the glClear() workaround so we can test it here. |
34 CommandLine command_line(base::CommandLine::NO_PROGRAM); | 34 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
35 command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, | 35 command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, |
36 base::IntToString(gpu::GL_CLEAR_BROKEN)); | 36 base::IntToString(gpu::GL_CLEAR_BROKEN)); |
37 gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); | 37 gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); |
38 DCHECK(gl_.workarounds().gl_clear_broken); | 38 DCHECK(gl_.workarounds().gl_clear_broken); |
39 } else { | 39 } else { |
40 gl_.Initialize(GLManager::Options()); | 40 gl_.Initialize(GLManager::Options()); |
41 DCHECK(!gl_.workarounds().gl_clear_broken); | 41 DCHECK(!gl_.workarounds().gl_clear_broken); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 glClearDepthf(0.9f); | 192 glClearDepthf(0.9f); |
193 glClear(GL_DEPTH_BUFFER_BIT); | 193 glClear(GL_DEPTH_BUFFER_BIT); |
194 DrawQuad(); | 194 DrawQuad(); |
195 // Verify - depth test should have passed, so red. | 195 // Verify - depth test should have passed, so red. |
196 EXPECT_TRUE( | 196 EXPECT_TRUE( |
197 GLTestHelper::CheckPixels(0, 0, 1, 1, 0 /* tolerance */, kRed)); | 197 GLTestHelper::CheckPixels(0, 0, 1, 1, 0 /* tolerance */, kRed)); |
198 } | 198 } |
199 | 199 |
200 } // namespace gpu | 200 } // namespace gpu |
OLD | NEW |