OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_COMMON_GPU_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_GPU_INFO_H_ |
6 #define CONTENT_PUBLIC_COMMON_GPU_INFO_H_ | 6 #define CONTENT_PUBLIC_COMMON_GPU_INFO_H_ |
7 | 7 |
8 // Provides access to the GPU information for the system | 8 // Provides access to the GPU information for the system |
9 // on which chrome is currently running. | 9 // on which chrome is currently running. |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
| 13 #include <map> |
13 | 14 |
14 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/process.h" |
15 #include "base/time.h" | 17 #include "base/time.h" |
16 #include "build/build_config.h" | 18 #include "build/build_config.h" |
17 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
18 #include "content/public/common/dx_diag_node.h" | 20 #include "content/public/common/dx_diag_node.h" |
19 #include "content/public/common/gpu_performance_stats.h" | 21 #include "content/public/common/gpu_performance_stats.h" |
20 | 22 |
21 namespace content { | 23 namespace content { |
22 | 24 |
23 struct CONTENT_EXPORT GPUInfo { | 25 struct CONTENT_EXPORT GPUInfo { |
24 struct CONTENT_EXPORT GPUDevice { | 26 struct CONTENT_EXPORT GPUDevice { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 GpuPerformanceStats performance_stats; | 105 GpuPerformanceStats performance_stats; |
104 | 106 |
105 bool software_rendering; | 107 bool software_rendering; |
106 | 108 |
107 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
108 // The information returned by the DirectX Diagnostics Tool. | 110 // The information returned by the DirectX Diagnostics Tool. |
109 DxDiagNode dx_diagnostics; | 111 DxDiagNode dx_diagnostics; |
110 #endif | 112 #endif |
111 }; | 113 }; |
112 | 114 |
| 115 struct CONTENT_EXPORT GPUVidmem { |
| 116 GPUVidmem(); |
| 117 ~GPUVidmem(); |
| 118 struct CONTENT_EXPORT GPUProcessVidmem { |
| 119 GPUProcessVidmem(); |
| 120 ~GPUProcessVidmem(); |
| 121 |
| 122 // The bytes of GPU resources accessible by this process |
| 123 size_t vidmem; |
| 124 |
| 125 // Set to true if this process' GPU resource count is inflated because |
| 126 // it is counting other processes' resources (e.g, the GPU process has |
| 127 // duplicate set to true because it is the aggregate of all processes) |
| 128 bool has_duplicates; |
| 129 }; |
| 130 typedef std::map<base::ProcessId,GPUProcessVidmem> ProcessMap; |
| 131 |
| 132 // A map of processes to their GPU resource consumption |
| 133 ProcessMap process_map; |
| 134 }; |
| 135 |
113 } // namespace content | 136 } // namespace content |
114 | 137 |
115 #endif // CONTENT_PUBLIC_COMMON_GPU_INFO_H_ | 138 #endif // CONTENT_PUBLIC_COMMON_GPU_INFO_H_ |
OLD | NEW |