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

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2473933002: Enable WebGL 2 by default! (on desktop) (Closed)
Patch Set: fix 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/gpu/gpu_data_manager_impl_private.h" 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", 172 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas",
173 "GPU.BlacklistFeatureTestResults.GpuCompositing", 173 "GPU.BlacklistFeatureTestResults.GpuCompositing",
174 "GPU.BlacklistFeatureTestResults.GpuRasterization", 174 "GPU.BlacklistFeatureTestResults.GpuRasterization",
175 "GPU.BlacklistFeatureTestResults.Webgl", 175 "GPU.BlacklistFeatureTestResults.Webgl",
176 "GPU.BlacklistFeatureTestResults.Webgl2"}; 176 "GPU.BlacklistFeatureTestResults.Webgl2"};
177 const bool kGpuFeatureUserFlags[] = { 177 const bool kGpuFeatureUserFlags[] = {
178 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), 178 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas),
179 command_line.HasSwitch(switches::kDisableGpu), 179 command_line.HasSwitch(switches::kDisableGpu),
180 command_line.HasSwitch(switches::kDisableGpuRasterization), 180 command_line.HasSwitch(switches::kDisableGpuRasterization),
181 command_line.HasSwitch(switches::kDisableExperimentalWebGL), 181 command_line.HasSwitch(switches::kDisableExperimentalWebGL),
182 (!command_line.HasSwitch(switches::kEnableUnsafeES3APIs) || 182 (!command_line.HasSwitch(switches::kEnableES3APIs) ||
183 command_line.HasSwitch(switches::kDisableES3APIs))}; 183 command_line.HasSwitch(switches::kDisableES3APIs))};
184 #if defined(OS_WIN) 184 #if defined(OS_WIN)
185 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { 185 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = {
186 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", 186 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas",
187 "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing", 187 "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing",
188 "GPU.BlacklistFeatureTestResultsWindows.GpuRasterization", 188 "GPU.BlacklistFeatureTestResultsWindows.GpuRasterization",
189 "GPU.BlacklistFeatureTestResultsWindows.Webgl", 189 "GPU.BlacklistFeatureTestResultsWindows.Webgl",
190 "GPU.BlacklistFeatureTestResultsWindows.Webgl2"}; 190 "GPU.BlacklistFeatureTestResultsWindows.Webgl2"};
191 #endif 191 #endif
192 const size_t kNumFeatures = 192 const size_t kNumFeatures =
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && 758 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) &&
759 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { 759 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) {
760 if (gpu_preferences) { 760 if (gpu_preferences) {
761 gpu_preferences->disable_web_rtc_hw_encoding = true; 761 gpu_preferences->disable_web_rtc_hw_encoding = true;
762 } else { 762 } else {
763 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); 763 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding);
764 } 764 }
765 } 765 }
766 #endif 766 #endif
767 767
768 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2) && gpu_preferences) { 768 if (gpu_preferences) { // enable_es3_apis
769 gpu_preferences->enable_unsafe_es3_apis = false; 769 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2);
770 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
771 switches::kEnableES3APIs);
772 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
773 switches::kDisableES3APIs);
774 gpu_preferences->enable_es3_apis = (enabled || !blacklisted) && !disabled;
770 } 775 }
771 776
772 // Pass GPU and driver information to GPU process. We try to avoid full GPU 777 // Pass GPU and driver information to GPU process. We try to avoid full GPU
773 // info collection at GPU process startup, but we need gpu vendor_id, 778 // info collection at GPU process startup, but we need gpu vendor_id,
774 // device_id, driver_vendor, driver_version for deciding whether we need to 779 // device_id, driver_vendor, driver_version for deciding whether we need to
775 // collect full info (on Linux) and for crash reporting purpose. 780 // collect full info (on Linux) and for crash reporting purpose.
776 command_line->AppendSwitchASCII(switches::kGpuVendorID, 781 command_line->AppendSwitchASCII(switches::kGpuVendorID,
777 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); 782 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id));
778 command_line->AppendSwitchASCII(switches::kGpuDeviceID, 783 command_line->AppendSwitchASCII(switches::kGpuDeviceID,
779 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); 784 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id));
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1303 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1299 #if defined(OS_WIN) 1304 #if defined(OS_WIN)
1300 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1305 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1301 #endif 1306 #endif
1302 complete_gpu_info_already_requested_ = true; 1307 complete_gpu_info_already_requested_ = true;
1303 // Some observers might be waiting. 1308 // Some observers might be waiting.
1304 NotifyGpuInfoUpdate(); 1309 NotifyGpuInfoUpdate();
1305 } 1310 }
1306 1311
1307 } // namespace content 1312 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698