Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: gpu/command_buffer/tests/gl_clear_framebuffer_unittest.cc

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
28 public: 28 public:
29 GLClearFramebufferTest() : color_handle_(0u), depth_handle_(0u) {} 29 GLClearFramebufferTest() : color_handle_(0u), depth_handle_(0u) {}
30 30
31 protected: 31 protected:
32 void SetUp() override { 32 void SetUp() override {
33 if (GetParam()) { 33 if (GetParam()) {
34 // Force the glClear() workaround so we can test it here. 34 // Force the glClear() workaround so we can test it here.
35 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 35 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
36 command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, 36 command_line.AppendSwitchASCII(switches::kGpuDriverBugWorkarounds,
37 base::IntToString(gpu::GL_CLEAR_BROKEN)); 37 base::IntToString(gpu::GL_CLEAR_BROKEN));
38 gl_.InitializeWithCommandLine(GLManager::Options(), &command_line); 38 gl_.InitializeWithCommandLine(GLManager::Options(), command_line);
39 DCHECK(gl_.workarounds().gl_clear_broken); 39 DCHECK(gl_.workarounds().gl_clear_broken);
40 } else { 40 } else {
41 gl_.Initialize(GLManager::Options()); 41 gl_.Initialize(GLManager::Options());
42 DCHECK(!gl_.workarounds().gl_clear_broken); 42 DCHECK(!gl_.workarounds().gl_clear_broken);
43 } 43 }
44 } 44 }
45 45
46 void InitDraw(); 46 void InitDraw();
47 void SetDrawColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a); 47 void SetDrawColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
48 void SetDrawDepth(GLfloat depth); 48 void SetDrawDepth(GLfloat depth);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 glClearDepthf(0.9f); 193 glClearDepthf(0.9f);
194 glClear(GL_DEPTH_BUFFER_BIT); 194 glClear(GL_DEPTH_BUFFER_BIT);
195 DrawQuad(); 195 DrawQuad();
196 // Verify - depth test should have passed, so red. 196 // Verify - depth test should have passed, so red.
197 EXPECT_TRUE( 197 EXPECT_TRUE(
198 GLTestHelper::CheckPixels(0, 0, 1, 1, 0 /* tolerance */, kRed)); 198 GLTestHelper::CheckPixels(0, 0, 1, 1, 0 /* tolerance */, kRed));
199 } 199 }
200 200
201 } // namespace gpu 201 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698