Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / gpu / config / gpu_info_collector.h
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 GPU_CONFIG_GPU_INFO_COLLECTOR_H_
6 #define GPU_CONFIG_GPU_INFO_COLLECTOR_H_
7
8 #include "base/basictypes.h"
9 #include "build/build_config.h"
10 #include "gpu/config/gpu_info.h"
11 #include "gpu/gpu_export.h"
12
13 namespace gpu {
14
15 // Collect GPU vendor_id and device ID.
16 GPU_EXPORT CollectInfoResult CollectGpuID(uint32* vendor_id, uint32* device_id);
17
18 // Collects basic GPU info without creating a GL/DirectX context (and without
19 // the danger of crashing), including vendor_id and device_id.
20 // This is called at browser process startup time.
21 // The subset each platform collects may be different.
22 GPU_EXPORT CollectInfoResult CollectBasicGraphicsInfo(GPUInfo* gpu_info);
23
24 // Create a GL/DirectX context and collect related info.
25 // This is called at GPU process startup time.
26 GPU_EXPORT CollectInfoResult CollectContextGraphicsInfo(GPUInfo* gpu_info);
27
28 #if defined(OS_WIN)
29 // Collect the DirectX Disagnostics information about the attached displays.
30 GPU_EXPORT bool GetDxDiagnostics(DxDiagNode* output);
31 #endif  // OS_WIN
32
33 // Create a GL context and collect GL strings and versions.
34 GPU_EXPORT CollectInfoResult CollectGraphicsInfoGL(GPUInfo* gpu_info);
35
36 // Each platform stores the driver version on the GL_VERSION string differently
37 GPU_EXPORT CollectInfoResult CollectDriverInfoGL(GPUInfo* gpu_info);
38
39 // Merge GPUInfo from CollectContextGraphicsInfo into basic GPUInfo.
40 // This is platform specific, depending on which info are collected at which
41 // stage.
42 GPU_EXPORT void MergeGPUInfo(GPUInfo* basic_gpu_info,
43                              const GPUInfo& context_gpu_info);
44
45 // MergeGPUInfo() when GL driver is used.
46 GPU_EXPORT void MergeGPUInfoGL(GPUInfo* basic_gpu_info,
47                                const GPUInfo& context_gpu_info);
48
49 }  // namespace gpu
50
51 #endif  // GPU_CONFIG_GPU_INFO_COLLECTOR_H_