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

Unified Diff: gpu/command_buffer/service/texture_manager_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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/texture_manager_unittest.cc
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index 322e2dc3ae04132ad6f16be7c17d0a183327947f..e95360c4980a03af37c43f1cc59fb3f4a5193b68 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -71,7 +71,9 @@ class TextureManagerTest : public GpuServiceTest {
// enabled without FeatureInfo::EnableES3Validators().
base::CommandLine command_line(0, nullptr);
command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
- feature_info_ = new FeatureInfo(command_line);
+ GpuDriverBugWorkarounds::Initialize(&command_line,
+ gpu_driver_bug_workarounds_);
+ feature_info_ = new FeatureInfo(command_line, gpu_driver_bug_workarounds_);
}
~TextureManagerTest() override {}
@@ -489,7 +491,8 @@ TEST_F(TextureManagerTest, ValidForTarget) {
TEST_F(TextureManagerTest, ValidForTargetNPOT) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_npot");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -707,8 +710,9 @@ class TextureTestBase : public GpuServiceTest {
static const GLuint kService1Id = 11;
static const bool kUseDefaultTextures = false;
- TextureTestBase()
- : feature_info_(new FeatureInfo()) {
+ TextureTestBase() {
+ GpuDriverBugWorkarounds::Initialize(gpu_driver_bug_workarounds_);
+ feature_info_ = new FeatureInfo(gpu_driver_bug_workarounds_);
}
~TextureTestBase() override { texture_ref_ = NULL; }
@@ -1024,7 +1028,8 @@ TEST_F(TextureTest, NPOT2D) {
TEST_F(TextureTest, NPOT2DNPOTOK) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_npot");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -1325,7 +1330,8 @@ TEST_F(TextureTest, ValidForTexture) {
TEST_F(TextureTest, FloatNotLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_float");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -1357,7 +1363,8 @@ TEST_F(TextureTest, FloatNotLinear) {
TEST_F(TextureTest, FloatLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_float GL_OES_texture_float_linear");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -1381,7 +1388,8 @@ TEST_F(TextureTest, FloatLinear) {
TEST_F(TextureTest, HalfFloatNotLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_half_float");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -1413,8 +1421,10 @@ TEST_F(TextureTest, HalfFloatNotLinear) {
TEST_F(TextureTest, HalfFloatLinear) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_texture_half_float GL_OES_texture_half_float_linear");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
- feature_info->InitializeForTesting();
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
+ feature_info->InitializeForTesting(); // maybe move that to InitFortestng so
+ // allow empty
TextureManager manager(NULL,
feature_info.get(),
kMaxTextureSize,
@@ -1437,7 +1447,8 @@ TEST_F(TextureTest, HalfFloatLinear) {
TEST_F(TextureTest, EGLImageExternal) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_OES_EGL_image_external");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -1459,7 +1470,8 @@ TEST_F(TextureTest, EGLImageExternal) {
TEST_F(TextureTest, DepthTexture) {
TestHelper::SetupFeatureInfoInitExpectations(
gl_.get(), "GL_ANGLE_depth_texture");
- scoped_refptr<FeatureInfo> feature_info(new FeatureInfo());
+ scoped_refptr<FeatureInfo> feature_info(
+ new FeatureInfo(gpu_driver_bug_workarounds_));
feature_info->InitializeForTesting();
TextureManager manager(NULL,
feature_info.get(),
@@ -2151,7 +2163,10 @@ class SharedTextureTest : public GpuServiceTest {
public:
static const bool kUseDefaultTextures = false;
- SharedTextureTest() : feature_info_(new FeatureInfo()) {}
+ SharedTextureTest() {
+ GpuDriverBugWorkarounds::Initialize(gpu_driver_bug_workarounds_);
+ feature_info_ = new FeatureInfo(gpu_driver_bug_workarounds_);
+ }
~SharedTextureTest() override {}

Powered by Google App Engine
This is Rietveld 408576698