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

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

Issue 2147693002: Struct traits used by GpuInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: VideoEncodeAcceleratorSupportedProfile Created 4 years, 5 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
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 namespace mojo { 7 namespace mojo {
8 8
9 // static 9 // static
10 bool StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice>::Read( 10 bool StructTraits<gpu::mojom::GpuDevice, gpu::GPUInfo::GPUDevice>::Read(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 *out = gpu::CollectInfoResult::kCollectInfoNonFatalFailure; 50 *out = gpu::CollectInfoResult::kCollectInfoNonFatalFailure;
51 return true; 51 return true;
52 case gpu::mojom::CollectInfoResult::kCollectInfoFatalFailure: 52 case gpu::mojom::CollectInfoResult::kCollectInfoFatalFailure:
53 *out = gpu::CollectInfoResult::kCollectInfoFatalFailure; 53 *out = gpu::CollectInfoResult::kCollectInfoFatalFailure;
54 return true; 54 return true;
55 } 55 }
56 NOTREACHED() << "Invalid CollectInfoResult value:" << input; 56 NOTREACHED() << "Invalid CollectInfoResult value:" << input;
57 return false; 57 return false;
58 } 58 }
59 59
60 // static
61 gpu::mojom::VideoCodecProfile
62 EnumTraits<gpu::mojom::VideoCodecProfile, gpu::VideoCodecProfile>::ToMojom(
63 gpu::VideoCodecProfile video_codec_profile) {
64 return static_cast<gpu::mojom::VideoCodecProfile>(video_codec_profile);
Fady Samuel 2016/07/15 18:08:38 Use switch statement.
Alex Z. 2016/07/18 12:50:05 Done.
65 }
66
67 // static
68 bool EnumTraits<gpu::mojom::VideoCodecProfile, gpu::VideoCodecProfile>::
69 FromMojom(gpu::mojom::VideoCodecProfile input,
70 gpu::VideoCodecProfile* out) {
71 *out = static_cast<gpu::VideoCodecProfile>(input);
Fady Samuel 2016/07/15 18:08:38 use switch statement.
Alex Z. 2016/07/18 12:50:05 Done.
72 return true;
73 }
74
75 // static
76 bool StructTraits<gpu::mojom::VideoDecodeAcceleratorSupportedProfile,
77 gpu::VideoDecodeAcceleratorSupportedProfile>::
78 Read(gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView data,
79 gpu::VideoDecodeAcceleratorSupportedProfile* out) {
80 out->encrypted_only = data.encrypted_only();
81 return data.ReadProfile(&out->profile) &&
82 data.ReadMaxResolution(&out->max_resolution) &&
83 data.ReadMinResolution(&out->min_resolution);
84 }
85
86 // static
87 bool StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfile,
88 gpu::VideoEncodeAcceleratorSupportedProfile>::
89 Read(gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data,
90 gpu::VideoEncodeAcceleratorSupportedProfile* out) {
91 out->max_framerate_numerator = data.max_framerate_numerator();
92 out->max_framerate_denominator = data.max_framerate_denominator();
93 return data.ReadProfile(&out->profile) &&
94 data.ReadMaxResolution(&out->max_resolution);
95 }
96
60 } // namespace mojo 97 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698