| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_GPU_GPU_INFO_COLLECTOR_H_ | |
| 6 #define CONTENT_GPU_GPU_INFO_COLLECTOR_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "build/build_config.h" | |
| 10 #include "content/common/content_export.h" | |
| 11 #include "content/public/common/gpu_info.h" | |
| 12 | |
| 13 namespace gpu_info_collector { | |
| 14 | |
| 15 enum GpuIDResult { | |
| 16 kGpuIDFailure, | |
| 17 kGpuIDSuccess, | |
| 18 kGpuIDNotSupported | |
| 19 }; | |
| 20 | |
| 21 // Collect GPU vendor_id and device ID. | |
| 22 CONTENT_EXPORT GpuIDResult CollectGpuID(uint32* vendor_id, uint32* device_id); | |
| 23 | |
| 24 // Collects basic GPU info without creating a GL/DirectX context (and without | |
| 25 // the danger of crashing), including vendor_id and device_id. | |
| 26 // This is called at browser process startup time. | |
| 27 // The subset each platform collects may be different. | |
| 28 CONTENT_EXPORT bool CollectBasicGraphicsInfo( | |
| 29 content::GPUInfo* gpu_info); | |
| 30 | |
| 31 // Create a GL/DirectX context and collect related info. | |
| 32 // This is called at GPU process startup time. | |
| 33 // Returns true on success. | |
| 34 bool CollectContextGraphicsInfo(content::GPUInfo* gpu_info); | |
| 35 | |
| 36 #if defined(OS_WIN) | |
| 37 // Collect the DirectX Disagnostics information about the attached displays. | |
| 38 bool GetDxDiagnostics(content::DxDiagNode* output); | |
| 39 #endif // OS_WIN | |
| 40 | |
| 41 // Create a GL context and collect GL strings and versions. | |
| 42 CONTENT_EXPORT bool CollectGraphicsInfoGL(content::GPUInfo* gpu_info); | |
| 43 | |
| 44 // Each platform stores the driver version on the GL_VERSION string differently | |
| 45 bool CollectDriverInfoGL(content::GPUInfo* gpu_info); | |
| 46 | |
| 47 // Merge GPUInfo from CollectContextGraphicsInfo into basic GPUInfo. | |
| 48 // This is platform specific, depending on which info are collected at which | |
| 49 // stage. | |
| 50 void MergeGPUInfo(content::GPUInfo* basic_gpu_info, | |
| 51 const content::GPUInfo& context_gpu_info); | |
| 52 | |
| 53 // MergeGPUInfo() when GL driver is used. | |
| 54 void MergeGPUInfoGL(content::GPUInfo* basic_gpu_info, | |
| 55 const content::GPUInfo& context_gpu_info); | |
| 56 | |
| 57 // Advanced Micro Devices has interesting configurations on laptops were | |
| 58 // there are two videocards that can alternatively a given process output. | |
| 59 enum AMDVideoCardType { | |
| 60 UNKNOWN, | |
| 61 STANDALONE, | |
| 62 INTEGRATED, | |
| 63 SWITCHABLE | |
| 64 }; | |
| 65 | |
| 66 } // namespace gpu_info_collector | |
| 67 | |
| 68 #endif // CONTENT_GPU_GPU_INFO_COLLECTOR_H_ | |
| OLD | NEW |