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

Side by Side Diff: gpu/command_buffer/service/feature_info_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: 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 (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/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 NOTREACHED(); 70 NOTREACHED();
71 break; 71 break;
72 } 72 }
73 } 73 }
74 74
75 void SetupInitExpectationsWithGLVersion( 75 void SetupInitExpectationsWithGLVersion(
76 const char* extensions, const char* renderer, const char* version) { 76 const char* extensions, const char* renderer, const char* version) {
77 GpuServiceTest::SetUpWithGLVersion(version, extensions); 77 GpuServiceTest::SetUpWithGLVersion(version, extensions);
78 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 78 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
79 gl_.get(), extensions, renderer, version); 79 gl_.get(), extensions, renderer, version);
80 info_ = new FeatureInfo(); 80 gpu::GpuDriverBugWorkarounds::Initialize(gpu_driver_bug_workarounds_);
81 info_ = new FeatureInfo(gpu_driver_bug_workarounds_);
81 info_->InitializeForTesting(); 82 info_->InitializeForTesting();
82 } 83 }
83 84
84 void SetupInitExpectationsWithGLVersionAndDisallowedFeatures( 85 void SetupInitExpectationsWithGLVersionAndDisallowedFeatures(
85 const char* extensions, 86 const char* extensions,
86 const char* renderer, 87 const char* renderer,
87 const char* version, 88 const char* version,
88 const DisallowedFeatures& disallowed_features) { 89 const DisallowedFeatures& disallowed_features) {
89 GpuServiceTest::SetUpWithGLVersion(version, extensions); 90 GpuServiceTest::SetUpWithGLVersion(version, extensions);
90 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 91 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
91 gl_.get(), extensions, renderer, version); 92 gl_.get(), extensions, renderer, version);
92 info_ = new FeatureInfo(); 93 gpu::GpuDriverBugWorkarounds::Initialize(gpu_driver_bug_workarounds_);
94 info_ = new FeatureInfo(gpu_driver_bug_workarounds_);
93 info_->InitializeForTesting(disallowed_features); 95 info_->InitializeForTesting(disallowed_features);
94 } 96 }
95 97
96 void SetupInitExpectationsWithGLVersionAndCommandLine( 98 void SetupInitExpectationsWithGLVersionAndCommandLine(
97 const char* extensions, 99 const char* extensions,
98 const char* renderer, 100 const char* renderer,
99 const char* version, 101 const char* version,
100 const base::CommandLine& command_line) { 102 const base::CommandLine& command_line) {
101 GpuServiceTest::SetUpWithGLVersion(version, extensions); 103 GpuServiceTest::SetUpWithGLVersion(version, extensions);
102 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 104 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
103 gl_.get(), extensions, renderer, version); 105 gl_.get(), extensions, renderer, version);
104 info_ = new FeatureInfo(command_line); 106 gpu::GpuDriverBugWorkarounds::Initialize(&command_line,
107 gpu_driver_bug_workarounds_);
108 info_ = new FeatureInfo(command_line, gpu_driver_bug_workarounds_);
105 info_->InitializeForTesting(); 109 info_->InitializeForTesting();
106 } 110 }
107 111
108 void SetupWithCommandLine(const base::CommandLine& command_line) { 112 void SetupWithCommandLine(const base::CommandLine& command_line) {
109 GpuServiceTest::SetUp(); 113 GpuServiceTest::SetUp();
110 info_ = new FeatureInfo(command_line); 114 gpu::GpuDriverBugWorkarounds::Initialize(&command_line,
115 gpu_driver_bug_workarounds_);
116 info_ = new FeatureInfo(command_line, gpu_driver_bug_workarounds_);
111 } 117 }
112 118
113 void SetupInitExpectationsWithCommandLine( 119 void SetupInitExpectationsWithCommandLine(
114 const char* extensions, 120 const char* extensions,
115 const base::CommandLine& command_line) { 121 const base::CommandLine& command_line) {
116 GpuServiceTest::SetUpWithGLVersion("2.0", extensions); 122 GpuServiceTest::SetUpWithGLVersion("2.0", extensions);
117 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 123 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
118 gl_.get(), extensions, "", ""); 124 gl_.get(), extensions, "", "");
119 info_ = new FeatureInfo(command_line); 125 gpu::GpuDriverBugWorkarounds::Initialize(&command_line,
126 gpu_driver_bug_workarounds_);
127 info_ = new FeatureInfo(command_line, gpu_driver_bug_workarounds_);
120 info_->InitializeForTesting(); 128 info_->InitializeForTesting();
121 } 129 }
122 130
123 void SetupWithoutInit() { 131 void SetupWithoutInit() {
124 GpuServiceTest::SetUp(); 132 GpuServiceTest::SetUp();
125 info_ = new FeatureInfo(); 133 gpu::GpuDriverBugWorkarounds::Initialize(gpu_driver_bug_workarounds_);
134 info_ = new FeatureInfo(gpu_driver_bug_workarounds_);
126 } 135 }
127 136
128 protected: 137 protected:
129 void SetUp() override { 138 void SetUp() override {
130 // Do nothing here, since we are using the explicit Setup*() functions. 139 // Do nothing here, since we are using the explicit Setup*() functions.
131 } 140 }
132 141
133 void TearDown() override { 142 void TearDown() override {
134 info_ = NULL; 143 info_ = NULL;
135 GpuServiceTest::TearDown(); 144 GpuServiceTest::TearDown();
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); 1414 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
1406 } 1415 }
1407 1416
1408 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { 1417 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
1409 SetupInitExpectations("GL_APPLE_ycbcr_422"); 1418 SetupInitExpectations("GL_APPLE_ycbcr_422");
1410 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); 1419 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
1411 } 1420 }
1412 1421
1413 } // namespace gles2 1422 } // namespace gles2
1414 } // namespace gpu 1423 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698