Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/gpu/gpu_thread.h" | 5 #include "chrome/gpu/gpu_thread.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/gfx/gl/gl_context.h" | 10 #include "app/gfx/gl/gl_context.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 | 102 |
| 103 } // namespace | 103 } // namespace |
| 104 | 104 |
| 105 void GpuThread::OnInitialize() { | 105 void GpuThread::OnInitialize() { |
| 106 // Redirect LOG messages to the GpuProcessHost | 106 // Redirect LOG messages to the GpuProcessHost |
| 107 bool single_process = CommandLine::ForCurrentProcess()->HasSwitch( | 107 bool single_process = CommandLine::ForCurrentProcess()->HasSwitch( |
| 108 switches::kSingleProcess); | 108 switches::kSingleProcess); |
| 109 if (!single_process) | 109 if (!single_process) |
| 110 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 110 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
| 111 | 111 |
| 112 // Collect as much GPU info as possible without creating GL/D3D context. | |
| 113 gpu_info_collector::CollectGraphicsInfoSafe(&gpu_info_); | |
| 114 LOG(INFO) << "gpu_info_collector::CollectGraphicsInfoSafe complete"; | |
| 115 | |
| 116 // Go through GPU blacklist with partial GPU info; if GPU is already | |
| 117 // blacklisted, don't create GL/D3D context. | |
| 118 bool blacklisted; | |
| 119 Send(new GpuHostMsg_GraphicsInfoCollectedSafe(gpu_info_, &blacklisted)); | |
| 120 if (blacklisted) { | |
| 121 MessageLoop::current()->Quit(); | |
|
Ken Russell (switch to Gerrit)
2011/02/18 22:21:24
How about a LOG(ERROR) like the other exit paths?
Zhenyao Mo
2011/02/18 22:41:52
Done.
| |
| 122 return; | |
| 123 } | |
| 124 | |
| 112 // Load the GL implementation and locate the bindings before starting the GPU | 125 // Load the GL implementation and locate the bindings before starting the GPU |
| 113 // watchdog because this can take a lot of time and the GPU watchdog might | 126 // watchdog because this can take a lot of time and the GPU watchdog might |
| 114 // terminate the GPU process. | 127 // terminate the GPU process. |
| 115 if (!gfx::GLContext::InitializeOneOff()) { | 128 if (!gfx::GLContext::InitializeOneOff()) { |
| 116 LOG(INFO) << "GLContext::InitializeOneOff failed"; | 129 LOG(INFO) << "GLContext::InitializeOneOff failed"; |
| 117 MessageLoop::current()->Quit(); | 130 MessageLoop::current()->Quit(); |
| 118 return; | 131 return; |
| 119 } | 132 } |
| 120 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); | 133 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); |
| 121 child_process_logging::SetGpuInfo(gpu_info_); | 134 child_process_logging::SetGpuInfo(gpu_info_); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node)); | 322 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node)); |
| 310 } | 323 } |
| 311 | 324 |
| 312 // Runs on the GPU thread. | 325 // Runs on the GPU thread. |
| 313 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { | 326 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { |
| 314 thread->gpu_info_.SetDxDiagnostics(node); | 327 thread->gpu_info_.SetDxDiagnostics(node); |
| 315 thread->gpu_info_.SetLevel(GPUInfo::kComplete); | 328 thread->gpu_info_.SetLevel(GPUInfo::kComplete); |
| 316 } | 329 } |
| 317 | 330 |
| 318 #endif | 331 #endif |
| OLD | NEW |