| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 base::TimeDelta collect_context_time = | 218 base::TimeDelta collect_context_time = |
| 219 base::TimeTicks::Now() - before_collect_context_graphics_info; | 219 base::TimeTicks::Now() - before_collect_context_graphics_info; |
| 220 UMA_HISTOGRAM_TIMES("GPU.CollectContextGraphicsInfo", collect_context_time); | 220 UMA_HISTOGRAM_TIMES("GPU.CollectContextGraphicsInfo", collect_context_time); |
| 221 | 221 |
| 222 base::TimeDelta initialize_one_off_time = | 222 base::TimeDelta initialize_one_off_time = |
| 223 base::TimeTicks::Now() - before_initialize_one_off; | 223 base::TimeTicks::Now() - before_initialize_one_off; |
| 224 UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime", | 224 UMA_HISTOGRAM_MEDIUM_TIMES("GPU.InitializeOneOffMediumTime", |
| 225 initialize_one_off_time); | 225 initialize_one_off_time); |
| 226 | 226 |
| 227 // OSMesa is expected to run very slowly, so disable the watchdog in that | 227 // Software GL is expected to run slowly, so disable the watchdog |
| 228 // case. | 228 // in that case. |
| 229 if (gl::GetGLImplementation() == gl::kGLImplementationOSMesaGL) { | 229 if (gl::GetGLImplementation() == gl::GetSoftwareGLImplementation()) { |
| 230 if (watchdog_thread_) | 230 if (watchdog_thread_) |
| 231 watchdog_thread_->Stop(); | 231 watchdog_thread_->Stop(); |
| 232 watchdog_thread_ = nullptr; | 232 watchdog_thread_ = nullptr; |
| 233 } else if (enable_watchdog && delayed_watchdog_enable) { | 233 } else if (enable_watchdog && delayed_watchdog_enable) { |
| 234 watchdog_thread_ = gpu::GpuWatchdogThread::Create(); | 234 watchdog_thread_ = gpu::GpuWatchdogThread::Create(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 if (!gpu_info_.sandboxed) | 237 if (!gpu_info_.sandboxed) |
| 238 gpu_info_.sandboxed = | 238 gpu_info_.sandboxed = |
| 239 sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get()); | 239 sandbox_helper_->EnsureSandboxInitialized(watchdog_thread_.get()); |
| 240 return true; | 240 return true; |
| 241 } | 241 } |
| 242 | 242 |
| 243 } // namespace gpu | 243 } // namespace gpu |
| OLD | NEW |