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 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) |
jam
2011/05/26 22:03:55
can you please add a comment about why you're doin
| |
120 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | |
120 | 121 |
121 // Load the GL implementation and locate the bindings before starting the GPU | 122 // 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 | 123 // watchdog because this can take a lot of time and the GPU watchdog might |
123 // terminate the GPU process. | 124 // terminate the GPU process. |
124 if (!gfx::GLSurface::InitializeOneOff()) { | 125 if (!gfx::GLSurface::InitializeOneOff()) { |
125 LOG(INFO) << "GLContext::InitializeOneOff failed"; | 126 LOG(INFO) << "GLContext::InitializeOneOff failed"; |
126 MessageLoop::current()->Quit(); | 127 MessageLoop::current()->Quit(); |
127 return; | 128 return; |
128 } | 129 } |
129 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); | 130 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. | 273 // Runs on the main thread. |
273 void GpuChildThread::SetDxDiagnostics(GpuChildThread* thread, | 274 void GpuChildThread::SetDxDiagnostics(GpuChildThread* thread, |
274 const DxDiagNode& node) { | 275 const DxDiagNode& node) { |
275 thread->gpu_info_.dx_diagnostics = node; | 276 thread->gpu_info_.dx_diagnostics = node; |
276 thread->gpu_info_.finalized = true; | 277 thread->gpu_info_.finalized = true; |
277 thread->collecting_dx_diagnostics_ = false; | 278 thread->collecting_dx_diagnostics_ = false; |
278 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_)); | 279 thread->Send(new GpuHostMsg_GraphicsInfoCollected(thread->gpu_info_)); |
279 } | 280 } |
280 | 281 |
281 #endif | 282 #endif |
OLD | NEW |