Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: gpu/ipc/common/gpu_info_struct_traits.cc

Issue 2220093002: GpuInfo mojom struct and struct traits and unit test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/common/gpu_info_struct_traits.h ('k') | gpu/ipc/common/struct_traits_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
8 #include "mojo/common/common_custom_types_struct_traits.h"
9
7 namespace mojo { 10 namespace mojo {
8 11
9 // static 12 // static
10 bool StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice>::Read( 13 bool StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice>::Read(
11 gpu::mojom::GpuDeviceDataView data, 14 gpu::mojom::GpuDeviceDataView data,
12 gpu::GPUInfo::GPUDevice* out) { 15 gpu::GPUInfo::GPUDevice* out) {
13 out->vendor_id = data.vendor_id(); 16 out->vendor_id = data.vendor_id();
14 out->device_id = data.device_id(); 17 out->device_id = data.device_id();
15 out->active = data.active(); 18 out->active = data.active();
16 return data.ReadVendorString(&out->vendor_string) && 19 return data.ReadVendorString(&out->vendor_string) &&
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 bool StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfile, 205 bool StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfile,
203 gpu::VideoEncodeAcceleratorSupportedProfile>:: 206 gpu::VideoEncodeAcceleratorSupportedProfile>::
204 Read(gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data, 207 Read(gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data,
205 gpu::VideoEncodeAcceleratorSupportedProfile* out) { 208 gpu::VideoEncodeAcceleratorSupportedProfile* out) {
206 out->max_framerate_numerator = data.max_framerate_numerator(); 209 out->max_framerate_numerator = data.max_framerate_numerator();
207 out->max_framerate_denominator = data.max_framerate_denominator(); 210 out->max_framerate_denominator = data.max_framerate_denominator();
208 return data.ReadProfile(&out->profile) && 211 return data.ReadProfile(&out->profile) &&
209 data.ReadMaxResolution(&out->max_resolution); 212 data.ReadMaxResolution(&out->max_resolution);
210 } 213 }
211 214
215 bool StructTraits<gpu::mojom::GpuInfo, gpu::GPUInfo>::Read(
216 gpu::mojom::GpuInfoDataView data,
217 gpu::GPUInfo* out) {
218 out->optimus = data.optimus();
219 out->amd_switchable = data.amd_switchable();
220 out->lenovo_dcute = data.lenovo_dcute();
221 out->adapter_luid = data.adapter_luid();
222 out->gl_reset_notification_strategy = data.gl_reset_notification_strategy();
223 out->can_lose_context = data.can_lose_context();
224 out->software_rendering = data.software_rendering();
225 out->direct_rendering = data.direct_rendering();
226 out->sandboxed = data.sandboxed();
227 out->in_process_gpu = data.in_process_gpu();
228 out->process_crash_count = data.process_crash_count();
229 out->jpeg_decode_accelerator_supported =
230 data.jpeg_decode_accelerator_supported();
231
232 return data.ReadInitializationTime(&out->initialization_time) &&
233 data.ReadDisplayLinkVersion(&out->display_link_version) &&
234 data.ReadGpu(&out->gpu) &&
235 data.ReadSecondaryGpus(&out->secondary_gpus) &&
236 data.ReadDriverVendor(&out->driver_vendor) &&
237 data.ReadDriverVersion(&out->driver_version) &&
238 data.ReadDriverDate(&out->driver_date) &&
239 data.ReadPixelShaderVersion(&out->pixel_shader_version) &&
240 data.ReadVertexShaderVersion(&out->vertex_shader_version) &&
241 data.ReadMaxMsaaSamples(&out->max_msaa_samples) &&
242 data.ReadMachineModelName(&out->machine_model_name) &&
243 data.ReadMachineModelVersion(&out->machine_model_version) &&
244 data.ReadGlVersion(&out->gl_version) &&
245 data.ReadGlVendor(&out->gl_vendor) &&
246 data.ReadGlRenderer(&out->gl_renderer) &&
247 data.ReadGlExtensions(&out->gl_extensions) &&
248 data.ReadGlWsVendor(&out->gl_ws_vendor) &&
249 data.ReadGlWsVersion(&out->gl_ws_version) &&
250 data.ReadGlWsExtensions(&out->gl_ws_extensions) &&
251 data.ReadBasicInfoState(&out->basic_info_state) &&
252 data.ReadContextInfoState(&out->context_info_state) &&
253 #if defined(OS_WIN)
254 data.ReadDxDiagnosticsInfoState(&out->dx_diagnostics_info_state) &&
255 data.ReadDxDiagnostics(&out->dx_diagnostics) &&
256 #endif
257 data.ReadVideoDecodeAcceleratorCapabilities(
258 &out->video_decode_accelerator_capabilities) &&
259 data.ReadVideoEncodeAcceleratorSupportedProfiles(
260 &out->video_encode_accelerator_supported_profiles);
261 }
262
212 } // namespace mojo 263 } // namespace mojo
OLDNEW
« no previous file with comments | « gpu/ipc/common/gpu_info_struct_traits.h ('k') | gpu/ipc/common/struct_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698