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 GPU_CONFIG_GPU_INFO_H_ | 5 #ifndef GPU_CONFIG_GPU_INFO_H_ |
6 #define GPU_CONFIG_GPU_INFO_H_ | 6 #define GPU_CONFIG_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 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "base/version.h" | 16 #include "base/version.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "gpu/config/dx_diag_node.h" | 18 #include "gpu/config/dx_diag_node.h" |
19 #include "gpu/config/gpu_performance_stats.h" | 19 #include "gpu/config/gpu_performance_stats.h" |
20 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
| 21 #include "media/video/video_encode_accelerator.h" |
21 | 22 |
22 namespace gpu { | 23 namespace gpu { |
23 | 24 |
24 // Result for the various Collect*Info* functions below. | 25 // Result for the various Collect*Info* functions below. |
25 // Fatal failures are for cases where we can't create a context at all or | 26 // Fatal failures are for cases where we can't create a context at all or |
26 // something, making the use of the GPU impossible. | 27 // something, making the use of the GPU impossible. |
27 // Non-fatal failures are for cases where we could gather most info, but maybe | 28 // Non-fatal failures are for cases where we could gather most info, but maybe |
28 // some is missing (e.g. unable to parse a version string or to detect the exact | 29 // some is missing (e.g. unable to parse a version string or to detect the exact |
29 // model). | 30 // model). |
30 enum CollectInfoResult { | 31 enum CollectInfoResult { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // The state of whether the basic/context/DxDiagnostics info is collected and | 170 // The state of whether the basic/context/DxDiagnostics info is collected and |
170 // if the collection fails or not. | 171 // if the collection fails or not. |
171 CollectInfoResult basic_info_state; | 172 CollectInfoResult basic_info_state; |
172 CollectInfoResult context_info_state; | 173 CollectInfoResult context_info_state; |
173 #if defined(OS_WIN) | 174 #if defined(OS_WIN) |
174 CollectInfoResult dx_diagnostics_info_state; | 175 CollectInfoResult dx_diagnostics_info_state; |
175 | 176 |
176 // The information returned by the DirectX Diagnostics Tool. | 177 // The information returned by the DirectX Diagnostics Tool. |
177 DxDiagNode dx_diagnostics; | 178 DxDiagNode dx_diagnostics; |
178 #endif | 179 #endif |
| 180 |
| 181 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
| 182 video_encode_accelerator_supported_profiles; |
179 // Note: when adding new members, please remember to update EnumerateFields | 183 // Note: when adding new members, please remember to update EnumerateFields |
180 // in gpu_info.cc. | 184 // in gpu_info.cc. |
181 | 185 |
182 // In conjunction with EnumerateFields, this allows the embedder to | 186 // In conjunction with EnumerateFields, this allows the embedder to |
183 // enumerate the values in this structure without having to embed | 187 // enumerate the values in this structure without having to embed |
184 // references to its specific member variables. This simplifies the | 188 // references to its specific member variables. This simplifies the |
185 // addition of new fields to this type. | 189 // addition of new fields to this type. |
186 class Enumerator { | 190 class Enumerator { |
187 public: | 191 public: |
188 // The following methods apply to the "current" object. Initially this | 192 // The following methods apply to the "current" object. Initially this |
189 // is the root object, but calls to BeginGPUDevice/EndGPUDevice and | 193 // is the root object, but calls to BeginGPUDevice/EndGPUDevice and |
190 // BeginAuxAttributes/EndAuxAttributes change the object to which these | 194 // BeginAuxAttributes/EndAuxAttributes change the object to which these |
191 // calls should apply. | 195 // calls should apply. |
192 virtual void AddInt64(const char* name, int64 value) = 0; | 196 virtual void AddInt64(const char* name, int64 value) = 0; |
193 virtual void AddInt(const char* name, int value) = 0; | 197 virtual void AddInt(const char* name, int value) = 0; |
194 virtual void AddString(const char* name, const std::string& value) = 0; | 198 virtual void AddString(const char* name, const std::string& value) = 0; |
195 virtual void AddBool(const char* name, bool value) = 0; | 199 virtual void AddBool(const char* name, bool value) = 0; |
196 virtual void AddTimeDeltaInSecondsF(const char* name, | 200 virtual void AddTimeDeltaInSecondsF(const char* name, |
197 const base::TimeDelta& value) = 0; | 201 const base::TimeDelta& value) = 0; |
198 | 202 |
199 // Markers indicating that a GPUDevice is being described. | 203 // Markers indicating that a GPUDevice is being described. |
200 virtual void BeginGPUDevice() = 0; | 204 virtual void BeginGPUDevice() = 0; |
201 virtual void EndGPUDevice() = 0; | 205 virtual void EndGPUDevice() = 0; |
202 | 206 |
| 207 // Markers indicating that a VideoEncodeAccelerator::SupportedProfile is |
| 208 // being described. |
| 209 virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0; |
| 210 virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0; |
| 211 |
203 // Markers indicating that "auxiliary" attributes of the GPUInfo | 212 // Markers indicating that "auxiliary" attributes of the GPUInfo |
204 // (according to the DevTools protocol) are being described. | 213 // (according to the DevTools protocol) are being described. |
205 virtual void BeginAuxAttributes() = 0; | 214 virtual void BeginAuxAttributes() = 0; |
206 virtual void EndAuxAttributes() = 0; | 215 virtual void EndAuxAttributes() = 0; |
207 | 216 |
208 protected: | 217 protected: |
209 virtual ~Enumerator() {} | 218 virtual ~Enumerator() {} |
210 }; | 219 }; |
211 | 220 |
212 // Outputs the fields in this structure to the provided enumerator. | 221 // Outputs the fields in this structure to the provided enumerator. |
213 void EnumerateFields(Enumerator* enumerator) const; | 222 void EnumerateFields(Enumerator* enumerator) const; |
214 }; | 223 }; |
215 | 224 |
216 } // namespace gpu | 225 } // namespace gpu |
217 | 226 |
218 #endif // GPU_CONFIG_GPU_INFO_H_ | 227 #endif // GPU_CONFIG_GPU_INFO_H_ |
OLD | NEW |