OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gpu/gpu_child_thread.h" | 5 #include "content/gpu/gpu_child_thread.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "app/win/scoped_com_initializer.h" | 10 #include "app/win/scoped_com_initializer.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 IPC_END_MESSAGE_MAP_EX() | 109 IPC_END_MESSAGE_MAP_EX() |
110 | 110 |
111 if (handled) | 111 if (handled) |
112 return true; | 112 return true; |
113 | 113 |
114 return gpu_channel_manager_.get() && | 114 return gpu_channel_manager_.get() && |
115 gpu_channel_manager_->OnMessageReceived(msg); | 115 gpu_channel_manager_->OnMessageReceived(msg); |
116 } | 116 } |
117 | 117 |
118 void GpuChildThread::OnInitialize() { | 118 void GpuChildThread::OnInitialize() { |
119 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 119 // We don't need to pipe log messages if we are running the GPU thread in |
| 120 // the browser process. |
| 121 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) && |
| 122 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) |
| 123 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); |
120 | 124 |
121 // 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 |
122 // 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 |
123 // terminate the GPU process. | 127 // terminate the GPU process. |
124 if (!gfx::GLSurface::InitializeOneOff()) { | 128 if (!gfx::GLSurface::InitializeOneOff()) { |
125 LOG(INFO) << "GLContext::InitializeOneOff failed"; | 129 LOG(INFO) << "GLContext::InitializeOneOff failed"; |
126 MessageLoop::current()->Quit(); | 130 MessageLoop::current()->Quit(); |
127 return; | 131 return; |
128 } | 132 } |
129 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); | 133 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // Runs on the main thread. | 276 // Runs on the main thread. |
273 void GpuChildThread::SetDxDiagnostics(GpuChildThread* thread, | 277 void GpuChildThread::SetDxDiagnostics(GpuChildThread* thread, |
274 const DxDiagNode& node) { | 278 const DxDiagNode& node) { |
275 thread->gpu_info_.dx_diagnostics = node; | 279 thread->gpu_info_.dx_diagnostics = node; |
276 thread->gpu_info_.finalized = true; | 280 thread->gpu_info_.finalized = true; |
277 thread->collecting_dx_diagnostics_ = false; | 281 thread->collecting_dx_diagnostics_ = false; |
278 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_)); | 282 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_)); |
279 } | 283 } |
280 | 284 |
281 #endif | 285 #endif |
OLD | NEW |