OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ipc/service/gpu_init.h" | 5 #include "gpu/ipc/service/gpu_init.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 206 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
207 // TODO: this can not affect disabled extensions, since they're already | 207 // TODO: this can not affect disabled extensions, since they're already |
208 // initialized in the bindings. This should be moved before bindings | 208 // initialized in the bindings. This should be moved before bindings |
209 // initialization. However, populating GPUInfo fully works only on Android. | 209 // initialization. However, populating GPUInfo fully works only on Android. |
210 // Other platforms would need the bindings to query GL strings. | 210 // Other platforms would need the bindings to query GL strings. |
211 gpu::ApplyGpuDriverBugWorkarounds( | 211 gpu::ApplyGpuDriverBugWorkarounds( |
212 gpu_info_, const_cast<base::CommandLine*>(&command_line)); | 212 gpu_info_, const_cast<base::CommandLine*>(&command_line)); |
213 } | 213 } |
214 #endif // !defined(OS_MACOSX) | 214 #endif // !defined(OS_MACOSX) |
215 | 215 |
| 216 if (!command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) { |
| 217 gpu_feature_status_ = gpu::GetGpuFeatureStatus(gpu_info_, command_line); |
| 218 } |
| 219 |
216 base::TimeDelta collect_context_time = | 220 base::TimeDelta collect_context_time = |
217 base::TimeTicks::Now() - before_collect_context_graphics_info; | 221 base::TimeTicks::Now() - before_collect_context_graphics_info; |
218 UMA_HISTOGRAM_TIMES("GPU.CollectContextGraphicsInfo", collect_context_time); | 222 UMA_HISTOGRAM_TIMES("GPU.CollectContextGraphicsInfo", collect_context_time); |
219 | 223 |
220 base::TimeDelta initialize_one_off_time = | 224 base::TimeDelta initialize_one_off_time = |
221 base::TimeTicks::Now() - before_initialize_one_off; | 225 base::TimeTicks::Now() - before_initialize_one_off; |
222 UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime", | 226 UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime", |
223 initialize_one_off_time); | 227 initialize_one_off_time); |
224 | 228 |
225 // OSMesa is expected to run very slowly, so disable the watchdog in that | 229 // OSMesa is expected to run very slowly, so disable the watchdog in that |
226 // case. | 230 // case. |
227 if (gl::GetGLImplementation() == gl::kGLImplementationOSMesaGL) { | 231 if (gl::GetGLImplementation() == gl::kGLImplementationOSMesaGL) { |
228 if (watchdog_thread_) | 232 if (watchdog_thread_) |
229 watchdog_thread_->Stop(); | 233 watchdog_thread_->Stop(); |
230 watchdog_thread_ = nullptr; | 234 watchdog_thread_ = nullptr; |
231 } else if (enable_watchdog && delayed_watchdog_enable) { | 235 } else if (enable_watchdog && delayed_watchdog_enable) { |
232 watchdog_thread_ = gpu::GpuWatchdogThread::Create(); | 236 watchdog_thread_ = gpu::GpuWatchdogThread::Create(); |
233 } | 237 } |
234 | 238 |
235 if (!gpu_info_.sandboxed) | 239 if (!gpu_info_.sandboxed) |
236 gpu_info_.sandboxed = | 240 gpu_info_.sandboxed = |
237 sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get()); | 241 sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get()); |
238 return true; | 242 return true; |
239 } | 243 } |
240 | 244 |
241 } // namespace gpu | 245 } // namespace gpu |
OLD | NEW |