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 #include "gpu/config/gpu_info.h" | 5 #include "gpu/config/gpu_info.h" |
6 | 6 |
7 namespace { | 7 namespace { |
8 | 8 |
9 void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator, | 9 void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator, |
10 const gpu::GPUInfo::GPUDevice& device) { | 10 const gpu::GPUInfo::GPUDevice& device) { |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 GPUInfo::GPUInfo() | 30 GPUInfo::GPUInfo() |
31 : finalized(false), | 31 : finalized(false), |
32 optimus(false), | 32 optimus(false), |
33 amd_switchable(false), | 33 amd_switchable(false), |
34 lenovo_dcute(false), | 34 lenovo_dcute(false), |
35 adapter_luid(0), | 35 adapter_luid(0), |
36 gl_reset_notification_strategy(0), | 36 gl_reset_notification_strategy(0), |
37 can_lose_context(false), | 37 can_lose_context(false), |
38 software_rendering(false), | 38 software_rendering(false), |
39 direct_rendering(true), | |
piman
2014/03/11 21:32:45
This is the more reasonable default, only GLX can
| |
39 sandboxed(false) { | 40 sandboxed(false) { |
40 } | 41 } |
41 | 42 |
42 GPUInfo::~GPUInfo() { } | 43 GPUInfo::~GPUInfo() { } |
43 | 44 |
44 void GPUInfo::EnumerateFields(Enumerator* enumerator) const { | 45 void GPUInfo::EnumerateFields(Enumerator* enumerator) const { |
45 struct GPUInfoKnownFields { | 46 struct GPUInfoKnownFields { |
46 bool finalized; | 47 bool finalized; |
47 base::TimeDelta initialization_time; | 48 base::TimeDelta initialization_time; |
48 bool optimus; | 49 bool optimus; |
(...skipping 14 matching lines...) Expand all Loading... | |
63 std::string gl_vendor; | 64 std::string gl_vendor; |
64 std::string gl_renderer; | 65 std::string gl_renderer; |
65 std::string gl_extensions; | 66 std::string gl_extensions; |
66 std::string gl_ws_vendor; | 67 std::string gl_ws_vendor; |
67 std::string gl_ws_version; | 68 std::string gl_ws_version; |
68 std::string gl_ws_extensions; | 69 std::string gl_ws_extensions; |
69 uint32 gl_reset_notification_strategy; | 70 uint32 gl_reset_notification_strategy; |
70 bool can_lose_context; | 71 bool can_lose_context; |
71 GpuPerformanceStats performance_stats; | 72 GpuPerformanceStats performance_stats; |
72 bool software_rendering; | 73 bool software_rendering; |
74 bool direct_rendering; | |
73 bool sandboxed; | 75 bool sandboxed; |
74 #if defined(OS_WIN) | 76 #if defined(OS_WIN) |
75 DxDiagNode dx_diagnostics; | 77 DxDiagNode dx_diagnostics; |
76 #endif | 78 #endif |
77 }; | 79 }; |
78 | 80 |
79 // If this assert fails then most likely something below needs to be updated. | 81 // If this assert fails then most likely something below needs to be updated. |
80 // Note that this assert is only approximate. If a new field is added to | 82 // Note that this assert is only approximate. If a new field is added to |
81 // GPUInfo which fits within the current padding then it will not be caught. | 83 // GPUInfo which fits within the current padding then it will not be caught. |
82 COMPILE_ASSERT( | 84 COMPILE_ASSERT( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 enumerator->AddString("glExtensions", gl_extensions); | 116 enumerator->AddString("glExtensions", gl_extensions); |
115 enumerator->AddString("glWsVendor", gl_ws_vendor); | 117 enumerator->AddString("glWsVendor", gl_ws_vendor); |
116 enumerator->AddString("glWsVersion", gl_ws_version); | 118 enumerator->AddString("glWsVersion", gl_ws_version); |
117 enumerator->AddString("glWsExtensions", gl_ws_extensions); | 119 enumerator->AddString("glWsExtensions", gl_ws_extensions); |
118 enumerator->AddInt( | 120 enumerator->AddInt( |
119 "glResetNotificationStrategy", | 121 "glResetNotificationStrategy", |
120 static_cast<int>(gl_reset_notification_strategy)); | 122 static_cast<int>(gl_reset_notification_strategy)); |
121 enumerator->AddBool("can_lose_context", can_lose_context); | 123 enumerator->AddBool("can_lose_context", can_lose_context); |
122 // TODO(kbr): add performance_stats. | 124 // TODO(kbr): add performance_stats. |
123 enumerator->AddBool("softwareRendering", software_rendering); | 125 enumerator->AddBool("softwareRendering", software_rendering); |
126 enumerator->AddBool("directRendering", direct_rendering); | |
124 enumerator->AddBool("sandboxed", sandboxed); | 127 enumerator->AddBool("sandboxed", sandboxed); |
125 // TODO(kbr): add dx_diagnostics on Windows. | 128 // TODO(kbr): add dx_diagnostics on Windows. |
126 enumerator->EndAuxAttributes(); | 129 enumerator->EndAuxAttributes(); |
127 } | 130 } |
128 | 131 |
129 } // namespace gpu | 132 } // namespace gpu |
OLD | NEW |