| 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 21 matching lines...) Expand all Loading... |
| 32 GPUInfo::GPUInfo() | 32 GPUInfo::GPUInfo() |
| 33 : finalized(false), | 33 : finalized(false), |
| 34 optimus(false), | 34 optimus(false), |
| 35 amd_switchable(false), | 35 amd_switchable(false), |
| 36 lenovo_dcute(false), | 36 lenovo_dcute(false), |
| 37 adapter_luid(0), | 37 adapter_luid(0), |
| 38 gl_reset_notification_strategy(0), | 38 gl_reset_notification_strategy(0), |
| 39 can_lose_context(false), | 39 can_lose_context(false), |
| 40 software_rendering(false), | 40 software_rendering(false), |
| 41 direct_rendering(true), | 41 direct_rendering(true), |
| 42 sandboxed(false) { | 42 sandboxed(false), |
| 43 process_crash_count(0) { |
| 43 } | 44 } |
| 44 | 45 |
| 45 GPUInfo::~GPUInfo() { } | 46 GPUInfo::~GPUInfo() { } |
| 46 | 47 |
| 47 void GPUInfo::EnumerateFields(Enumerator* enumerator) const { | 48 void GPUInfo::EnumerateFields(Enumerator* enumerator) const { |
| 48 struct GPUInfoKnownFields { | 49 struct GPUInfoKnownFields { |
| 49 bool finalized; | 50 bool finalized; |
| 50 base::TimeDelta initialization_time; | 51 base::TimeDelta initialization_time; |
| 51 bool optimus; | 52 bool optimus; |
| 52 bool amd_switchable; | 53 bool amd_switchable; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 std::string gl_extensions; | 69 std::string gl_extensions; |
| 69 std::string gl_ws_vendor; | 70 std::string gl_ws_vendor; |
| 70 std::string gl_ws_version; | 71 std::string gl_ws_version; |
| 71 std::string gl_ws_extensions; | 72 std::string gl_ws_extensions; |
| 72 uint32 gl_reset_notification_strategy; | 73 uint32 gl_reset_notification_strategy; |
| 73 bool can_lose_context; | 74 bool can_lose_context; |
| 74 GpuPerformanceStats performance_stats; | 75 GpuPerformanceStats performance_stats; |
| 75 bool software_rendering; | 76 bool software_rendering; |
| 76 bool direct_rendering; | 77 bool direct_rendering; |
| 77 bool sandboxed; | 78 bool sandboxed; |
| 79 int process_crash_count; |
| 78 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
| 79 DxDiagNode dx_diagnostics; | 81 DxDiagNode dx_diagnostics; |
| 80 #endif | 82 #endif |
| 81 }; | 83 }; |
| 82 | 84 |
| 83 // If this assert fails then most likely something below needs to be updated. | 85 // If this assert fails then most likely something below needs to be updated. |
| 84 // Note that this assert is only approximate. If a new field is added to | 86 // Note that this assert is only approximate. If a new field is added to |
| 85 // GPUInfo which fits within the current padding then it will not be caught. | 87 // GPUInfo which fits within the current padding then it will not be caught. |
| 86 COMPILE_ASSERT( | 88 COMPILE_ASSERT( |
| 87 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), | 89 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 enumerator->AddString("glWsVersion", gl_ws_version); | 122 enumerator->AddString("glWsVersion", gl_ws_version); |
| 121 enumerator->AddString("glWsExtensions", gl_ws_extensions); | 123 enumerator->AddString("glWsExtensions", gl_ws_extensions); |
| 122 enumerator->AddInt( | 124 enumerator->AddInt( |
| 123 "glResetNotificationStrategy", | 125 "glResetNotificationStrategy", |
| 124 static_cast<int>(gl_reset_notification_strategy)); | 126 static_cast<int>(gl_reset_notification_strategy)); |
| 125 enumerator->AddBool("can_lose_context", can_lose_context); | 127 enumerator->AddBool("can_lose_context", can_lose_context); |
| 126 // TODO(kbr): add performance_stats. | 128 // TODO(kbr): add performance_stats. |
| 127 enumerator->AddBool("softwareRendering", software_rendering); | 129 enumerator->AddBool("softwareRendering", software_rendering); |
| 128 enumerator->AddBool("directRendering", direct_rendering); | 130 enumerator->AddBool("directRendering", direct_rendering); |
| 129 enumerator->AddBool("sandboxed", sandboxed); | 131 enumerator->AddBool("sandboxed", sandboxed); |
| 132 enumerator->AddInt("processCrashCount", process_crash_count); |
| 130 // TODO(kbr): add dx_diagnostics on Windows. | 133 // TODO(kbr): add dx_diagnostics on Windows. |
| 131 enumerator->EndAuxAttributes(); | 134 enumerator->EndAuxAttributes(); |
| 132 } | 135 } |
| 133 | 136 |
| 134 } // namespace gpu | 137 } // namespace gpu |
| OLD | NEW |