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" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/worker_pool.h" | 12 #include "base/threading/worker_pool.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/common/child_process.h" | 14 #include "chrome/common/child_process.h" |
15 #include "chrome/common/child_process_logging.h" | 15 #include "chrome/common/child_process_logging.h" |
16 #include "chrome/common/gpu_messages.h" | 16 #include "chrome/common/gpu_messages.h" |
17 #include "chrome/gpu/gpu_info_collector.h" | 17 #include "chrome/gpu/gpu_info_collector.h" |
18 #include "ipc/ipc_channel_handle.h" | 18 #include "ipc/ipc_channel_handle.h" |
19 | 19 |
20 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
21 #include "app/win_util.h" | 21 #include "app/win_util.h" |
22 #endif | 22 #endif |
23 | 23 |
24 GpuThread::GpuThread() { | 24 GpuThread::GpuThread() { |
25 } | 25 } |
26 | 26 |
27 GpuThread::~GpuThread() { | 27 GpuThread::~GpuThread() { |
28 } | 28 } |
29 | 29 |
30 void GpuThread::Init(const base::Time& process_start_time) { | 30 void GpuThread::Init(const base::Time& process_start_time) { |
31 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); | 31 gpu_info_collector::CollectGraphicsInfo(&gpu_info_); |
32 child_process_logging::SetGpuInfo(gpu_info_); | 32 child_process_logging::SetGpuInfo(gpu_info_); |
33 | 33 |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 // Asynchronously collect the DirectX diagnostics because this can take a | 35 // Asynchronously collect the DirectX diagnostics because this can take a |
36 // couple of seconds. | 36 // couple of seconds. |
37 if (!WorkerPool::PostTask( | 37 if (!base::WorkerPool::PostTask( |
38 FROM_HERE, | 38 FROM_HERE, |
39 NewRunnableFunction(&GpuThread::CollectDxDiagnostics, this), | 39 NewRunnableFunction(&GpuThread::CollectDxDiagnostics, this), |
40 true)) { | 40 true)) { |
41 // Flag GPU info as complete if the DirectX diagnostics cannot be collected. | 41 // Flag GPU info as complete if the DirectX diagnostics cannot be collected. |
42 gpu_info_.SetProgress(GPUInfo::kComplete); | 42 gpu_info_.SetProgress(GPUInfo::kComplete); |
43 } | 43 } |
44 #endif | 44 #endif |
45 | 45 |
46 // Record initialization only after collecting the GPU info because that can | 46 // Record initialization only after collecting the GPU info because that can |
47 // take a significant amount of time. | 47 // take a significant amount of time. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node)); | 169 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node)); |
170 } | 170 } |
171 | 171 |
172 // Runs on the GPU thread. | 172 // Runs on the GPU thread. |
173 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { | 173 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { |
174 thread->gpu_info_.SetDxDiagnostics(node); | 174 thread->gpu_info_.SetDxDiagnostics(node); |
175 thread->gpu_info_.SetProgress(GPUInfo::kComplete); | 175 thread->gpu_info_.SetProgress(GPUInfo::kComplete); |
176 } | 176 } |
177 | 177 |
178 #endif | 178 #endif |
OLD | NEW |