| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "gpu/config/gpu_info.h" | 7 #include "gpu/config/gpu_info.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 software_rendering(false), | 74 software_rendering(false), |
| 75 direct_rendering(true), | 75 direct_rendering(true), |
| 76 sandboxed(false), | 76 sandboxed(false), |
| 77 process_crash_count(0), | 77 process_crash_count(0), |
| 78 in_process_gpu(true), | 78 in_process_gpu(true), |
| 79 basic_info_state(kCollectInfoNone), | 79 basic_info_state(kCollectInfoNone), |
| 80 context_info_state(kCollectInfoNone), | 80 context_info_state(kCollectInfoNone), |
| 81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 82 dx_diagnostics_info_state(kCollectInfoNone), | 82 dx_diagnostics_info_state(kCollectInfoNone), |
| 83 #endif | 83 #endif |
| 84 jpeg_decode_accelerator_supported(false) { | 84 jpeg_decode_accelerator_supported(false) |
| 85 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 86 , |
| 87 system_visual(0), |
| 88 rgba_visual(0) |
| 89 #endif |
| 90 { |
| 85 } | 91 } |
| 86 | 92 |
| 87 GPUInfo::GPUInfo(const GPUInfo& other) = default; | 93 GPUInfo::GPUInfo(const GPUInfo& other) = default; |
| 88 | 94 |
| 89 GPUInfo::~GPUInfo() { } | 95 GPUInfo::~GPUInfo() { } |
| 90 | 96 |
| 91 void GPUInfo::EnumerateFields(Enumerator* enumerator) const { | 97 void GPUInfo::EnumerateFields(Enumerator* enumerator) const { |
| 92 struct GPUInfoKnownFields { | 98 struct GPUInfoKnownFields { |
| 93 base::TimeDelta initialization_time; | 99 base::TimeDelta initialization_time; |
| 94 bool optimus; | 100 bool optimus; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 122 CollectInfoResult basic_info_state; | 128 CollectInfoResult basic_info_state; |
| 123 CollectInfoResult context_info_state; | 129 CollectInfoResult context_info_state; |
| 124 #if defined(OS_WIN) | 130 #if defined(OS_WIN) |
| 125 CollectInfoResult dx_diagnostics_info_state; | 131 CollectInfoResult dx_diagnostics_info_state; |
| 126 DxDiagNode dx_diagnostics; | 132 DxDiagNode dx_diagnostics; |
| 127 #endif | 133 #endif |
| 128 VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities; | 134 VideoDecodeAcceleratorCapabilities video_decode_accelerator_capabilities; |
| 129 VideoEncodeAcceleratorSupportedProfiles | 135 VideoEncodeAcceleratorSupportedProfiles |
| 130 video_encode_accelerator_supported_profiles; | 136 video_encode_accelerator_supported_profiles; |
| 131 bool jpeg_decode_accelerator_supported; | 137 bool jpeg_decode_accelerator_supported; |
| 138 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 139 VisualID system_visual; |
| 140 VisualID rgba_visual; |
| 141 #endif |
| 132 }; | 142 }; |
| 133 | 143 |
| 134 // If this assert fails then most likely something below needs to be updated. | 144 // If this assert fails then most likely something below needs to be updated. |
| 135 // Note that this assert is only approximate. If a new field is added to | 145 // Note that this assert is only approximate. If a new field is added to |
| 136 // GPUInfo which fits within the current padding then it will not be caught. | 146 // GPUInfo which fits within the current padding then it will not be caught. |
| 137 static_assert( | 147 static_assert( |
| 138 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), | 148 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), |
| 139 "fields have changed in GPUInfo, GPUInfoKnownFields must be updated"); | 149 "fields have changed in GPUInfo, GPUInfoKnownFields must be updated"); |
| 140 | 150 |
| 141 // Required fields (according to DevTools protocol) first. | 151 // Required fields (according to DevTools protocol) first. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // TODO(kbr): add dx_diagnostics on Windows. | 196 // TODO(kbr): add dx_diagnostics on Windows. |
| 187 enumerator->AddInt("videoDecodeAcceleratorFlags", | 197 enumerator->AddInt("videoDecodeAcceleratorFlags", |
| 188 video_decode_accelerator_capabilities.flags); | 198 video_decode_accelerator_capabilities.flags); |
| 189 for (const auto& profile : | 199 for (const auto& profile : |
| 190 video_decode_accelerator_capabilities.supported_profiles) | 200 video_decode_accelerator_capabilities.supported_profiles) |
| 191 EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator); | 201 EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator); |
| 192 for (const auto& profile : video_encode_accelerator_supported_profiles) | 202 for (const auto& profile : video_encode_accelerator_supported_profiles) |
| 193 EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator); | 203 EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator); |
| 194 enumerator->AddBool("jpegDecodeAcceleratorSupported", | 204 enumerator->AddBool("jpegDecodeAcceleratorSupported", |
| 195 jpeg_decode_accelerator_supported); | 205 jpeg_decode_accelerator_supported); |
| 206 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 207 enumerator->AddInt64("systemVisual", system_visual); |
| 208 enumerator->AddInt64("rgbaVisual", rgba_visual); |
| 209 #endif |
| 196 enumerator->EndAuxAttributes(); | 210 enumerator->EndAuxAttributes(); |
| 197 } | 211 } |
| 198 | 212 |
| 199 } // namespace gpu | 213 } // namespace gpu |
| OLD | NEW |