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

Side by Side Diff: gpu/command_buffer/service/feature_info_unittest.cc

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: fix a bug Created 4 years, 1 month 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 <memory> 9 #include <memory>
10 10
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return CONTEXT_TYPE_OPENGLES2; 90 return CONTEXT_TYPE_OPENGLES2;
91 } 91 }
92 } 92 }
93 93
94 void SetupInitExpectationsWithGLVersion( 94 void SetupInitExpectationsWithGLVersion(
95 const char* extensions, const char* renderer, const char* version) { 95 const char* extensions, const char* renderer, const char* version) {
96 GpuServiceTest::SetUpWithGLVersion(version, extensions); 96 GpuServiceTest::SetUpWithGLVersion(version, extensions);
97 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 97 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
98 gl_.get(), extensions, renderer, version, GetContextType()); 98 gl_.get(), extensions, renderer, version, GetContextType());
99 info_ = new FeatureInfo(); 99 info_ = new FeatureInfo();
100 info_->SetES3APIsSwitch(false);
100 info_->Initialize(GetContextType(), DisallowedFeatures()); 101 info_->Initialize(GetContextType(), DisallowedFeatures());
101 } 102 }
102 103
103 void SetupInitExpectationsWithGLVersionAndDisallowedFeatures( 104 void SetupInitExpectationsWithGLVersionAndDisallowedFeatures(
104 const char* extensions, 105 const char* extensions,
105 const char* renderer, 106 const char* renderer,
106 const char* version, 107 const char* version,
107 const DisallowedFeatures& disallowed_features) { 108 const DisallowedFeatures& disallowed_features) {
108 GpuServiceTest::SetUpWithGLVersion(version, extensions); 109 GpuServiceTest::SetUpWithGLVersion(version, extensions);
109 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 110 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
110 gl_.get(), extensions, renderer, version, GetContextType()); 111 gl_.get(), extensions, renderer, version, GetContextType());
111 info_ = new FeatureInfo(); 112 info_ = new FeatureInfo();
113 info_->SetES3APIsSwitch(false);
112 info_->Initialize(GetContextType(), disallowed_features); 114 info_->Initialize(GetContextType(), disallowed_features);
113 } 115 }
114 116
115 void SetupInitExpectationsWithGLVersionAndCommandLine( 117 void SetupInitExpectationsWithGLVersionAndCommandLine(
116 const char* extensions, 118 const char* extensions,
117 const char* renderer, 119 const char* renderer,
118 const char* version, 120 const char* version,
119 const base::CommandLine& command_line) { 121 const base::CommandLine& command_line) {
120 GpuServiceTest::SetUpWithGLVersion(version, extensions); 122 GpuServiceTest::SetUpWithGLVersion(version, extensions);
121 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 123 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
122 gl_.get(), extensions, renderer, version, GetContextType()); 124 gl_.get(), extensions, renderer, version, GetContextType());
123 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 125 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
124 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); 126 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
127 info_->SetES3APIsSwitch(false);
125 info_->Initialize(GetContextType(), DisallowedFeatures()); 128 info_->Initialize(GetContextType(), DisallowedFeatures());
126 } 129 }
127 130
128 void SetupWithCommandLine(const base::CommandLine& command_line) { 131 void SetupWithCommandLine(const base::CommandLine& command_line) {
129 GpuServiceTest::SetUp(); 132 GpuServiceTest::SetUp();
130 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 133 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
131 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); 134 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
132 } 135 }
133 136
134 void SetupInitExpectationsWithCommandLine( 137 void SetupInitExpectationsWithCommandLine(
135 const char* extensions, 138 const char* extensions,
136 const base::CommandLine& command_line) { 139 const base::CommandLine& command_line) {
137 GpuServiceTest::SetUpWithGLVersion("2.0", extensions); 140 GpuServiceTest::SetUpWithGLVersion("2.0", extensions);
138 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 141 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
139 gl_.get(), extensions, "", "", GetContextType()); 142 gl_.get(), extensions, "", "", GetContextType());
140 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 143 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
141 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); 144 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
145 info_->SetES3APIsSwitch(false);
142 info_->Initialize(GetContextType(), DisallowedFeatures()); 146 info_->Initialize(GetContextType(), DisallowedFeatures());
143 } 147 }
144 148
145 void SetupWithoutInit() { 149 void SetupWithoutInit() {
146 GpuServiceTest::SetUp(); 150 GpuServiceTest::SetUp();
147 info_ = new FeatureInfo(); 151 info_ = new FeatureInfo();
148 } 152 }
149 153
150 protected: 154 protected:
151 void SetUp() override { 155 void SetUp() override {
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); 1663 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
1660 } 1664 }
1661 1665
1662 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { 1666 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
1663 SetupInitExpectations("GL_APPLE_ycbcr_422"); 1667 SetupInitExpectations("GL_APPLE_ycbcr_422");
1664 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); 1668 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
1665 } 1669 }
1666 1670
1667 } // namespace gles2 1671 } // namespace gles2
1668 } // namespace gpu 1672 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698