| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ipc/common/gpu_info_struct_traits.h" | 5 #include "gpu/ipc/common/gpu_info_struct_traits.h" |
| 6 | 6 |
| 7 #include "ipc/ipc_message_utils.h" | 7 #include "ipc/ipc_message_utils.h" |
| 8 #include "mojo/common/common_custom_types_struct_traits.h" | 8 #include "mojo/common/common_custom_types_struct_traits.h" |
| 9 | 9 |
| 10 namespace mojo { | 10 namespace mojo { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 bool StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice>::Read( | 13 bool StructTraits<gpu::mojom::GpuDeviceDataView, gpu::GPUInfo::GPUDevice>::Read( |
| 14 gpu::mojom::GpuDeviceDataView data, | 14 gpu::mojom::GpuDeviceDataView data, |
| 15 gpu::GPUInfo::GPUDevice* out) { | 15 gpu::GPUInfo::GPUDevice* out) { |
| 16 out->vendor_id = data.vendor_id(); | 16 out->vendor_id = data.vendor_id(); |
| 17 out->device_id = data.device_id(); | 17 out->device_id = data.device_id(); |
| 18 out->active = data.active(); | 18 out->active = data.active(); |
| 19 return data.ReadVendorString(&out->vendor_string) && | 19 return data.ReadVendorString(&out->vendor_string) && |
| 20 data.ReadDeviceString(&out->device_string); | 20 data.ReadDeviceString(&out->device_string); |
| 21 } | 21 } |
| 22 | 22 |
| 23 // static | 23 // static |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return true; | 175 return true; |
| 176 case gpu::mojom::VideoCodecProfile::HEVCPROFILE_MAIN_STILL_PICTURE: | 176 case gpu::mojom::VideoCodecProfile::HEVCPROFILE_MAIN_STILL_PICTURE: |
| 177 *out = gpu::VideoCodecProfile::HEVCPROFILE_MAIN_STILL_PICTURE; | 177 *out = gpu::VideoCodecProfile::HEVCPROFILE_MAIN_STILL_PICTURE; |
| 178 return true; | 178 return true; |
| 179 } | 179 } |
| 180 NOTREACHED() << "Invalid VideoCodecProfile: " << input; | 180 NOTREACHED() << "Invalid VideoCodecProfile: " << input; |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 | 183 |
| 184 // static | 184 // static |
| 185 bool StructTraits<gpu::mojom::VideoDecodeAcceleratorSupportedProfile, | 185 bool StructTraits<gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView, |
| 186 gpu::VideoDecodeAcceleratorSupportedProfile>:: | 186 gpu::VideoDecodeAcceleratorSupportedProfile>:: |
| 187 Read(gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView data, | 187 Read(gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView data, |
| 188 gpu::VideoDecodeAcceleratorSupportedProfile* out) { | 188 gpu::VideoDecodeAcceleratorSupportedProfile* out) { |
| 189 out->encrypted_only = data.encrypted_only(); | 189 out->encrypted_only = data.encrypted_only(); |
| 190 return data.ReadProfile(&out->profile) && | 190 return data.ReadProfile(&out->profile) && |
| 191 data.ReadMaxResolution(&out->max_resolution) && | 191 data.ReadMaxResolution(&out->max_resolution) && |
| 192 data.ReadMinResolution(&out->min_resolution); | 192 data.ReadMinResolution(&out->min_resolution); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // static | 195 // static |
| 196 bool StructTraits<gpu::mojom::VideoDecodeAcceleratorCapabilities, | 196 bool StructTraits<gpu::mojom::VideoDecodeAcceleratorCapabilitiesDataView, |
| 197 gpu::VideoDecodeAcceleratorCapabilities>:: | 197 gpu::VideoDecodeAcceleratorCapabilities>:: |
| 198 Read(gpu::mojom::VideoDecodeAcceleratorCapabilitiesDataView data, | 198 Read(gpu::mojom::VideoDecodeAcceleratorCapabilitiesDataView data, |
| 199 gpu::VideoDecodeAcceleratorCapabilities* out) { | 199 gpu::VideoDecodeAcceleratorCapabilities* out) { |
| 200 out->flags = data.flags(); | 200 out->flags = data.flags(); |
| 201 return true; | 201 return true; |
| 202 } | 202 } |
| 203 | 203 |
| 204 // static | 204 // static |
| 205 bool StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfile, | 205 bool StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView, |
| 206 gpu::VideoEncodeAcceleratorSupportedProfile>:: | 206 gpu::VideoEncodeAcceleratorSupportedProfile>:: |
| 207 Read(gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data, | 207 Read(gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data, |
| 208 gpu::VideoEncodeAcceleratorSupportedProfile* out) { | 208 gpu::VideoEncodeAcceleratorSupportedProfile* out) { |
| 209 out->max_framerate_numerator = data.max_framerate_numerator(); | 209 out->max_framerate_numerator = data.max_framerate_numerator(); |
| 210 out->max_framerate_denominator = data.max_framerate_denominator(); | 210 out->max_framerate_denominator = data.max_framerate_denominator(); |
| 211 return data.ReadProfile(&out->profile) && | 211 return data.ReadProfile(&out->profile) && |
| 212 data.ReadMaxResolution(&out->max_resolution); | 212 data.ReadMaxResolution(&out->max_resolution); |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool StructTraits<gpu::mojom::GpuInfo, gpu::GPUInfo>::Read( | 215 bool StructTraits<gpu::mojom::GpuInfoDataView, gpu::GPUInfo>::Read( |
| 216 gpu::mojom::GpuInfoDataView data, | 216 gpu::mojom::GpuInfoDataView data, |
| 217 gpu::GPUInfo* out) { | 217 gpu::GPUInfo* out) { |
| 218 out->optimus = data.optimus(); | 218 out->optimus = data.optimus(); |
| 219 out->amd_switchable = data.amd_switchable(); | 219 out->amd_switchable = data.amd_switchable(); |
| 220 out->lenovo_dcute = data.lenovo_dcute(); | 220 out->lenovo_dcute = data.lenovo_dcute(); |
| 221 out->adapter_luid = data.adapter_luid(); | 221 out->adapter_luid = data.adapter_luid(); |
| 222 out->gl_reset_notification_strategy = data.gl_reset_notification_strategy(); | 222 out->gl_reset_notification_strategy = data.gl_reset_notification_strategy(); |
| 223 out->software_rendering = data.software_rendering(); | 223 out->software_rendering = data.software_rendering(); |
| 224 out->direct_rendering = data.direct_rendering(); | 224 out->direct_rendering = data.direct_rendering(); |
| 225 out->sandboxed = data.sandboxed(); | 225 out->sandboxed = data.sandboxed(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 253 data.ReadDxDiagnosticsInfoState(&out->dx_diagnostics_info_state) && | 253 data.ReadDxDiagnosticsInfoState(&out->dx_diagnostics_info_state) && |
| 254 data.ReadDxDiagnostics(&out->dx_diagnostics) && | 254 data.ReadDxDiagnostics(&out->dx_diagnostics) && |
| 255 #endif | 255 #endif |
| 256 data.ReadVideoDecodeAcceleratorCapabilities( | 256 data.ReadVideoDecodeAcceleratorCapabilities( |
| 257 &out->video_decode_accelerator_capabilities) && | 257 &out->video_decode_accelerator_capabilities) && |
| 258 data.ReadVideoEncodeAcceleratorSupportedProfiles( | 258 data.ReadVideoEncodeAcceleratorSupportedProfiles( |
| 259 &out->video_encode_accelerator_supported_profiles); | 259 &out->video_encode_accelerator_supported_profiles); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace mojo | 262 } // namespace mojo |
| OLD | NEW |