Chromium Code Reviews| Index: gpu/ipc/common/gpu_info_struct_traits.h |
| diff --git a/gpu/ipc/common/gpu_info_struct_traits.h b/gpu/ipc/common/gpu_info_struct_traits.h |
| index ca142166271e96b88dd5ecef0f556047bb4bc5b6..04e57e32075d5ac444c511667c01980324303ff2 100644 |
| --- a/gpu/ipc/common/gpu_info_struct_traits.h |
| +++ b/gpu/ipc/common/gpu_info_struct_traits.h |
| @@ -7,6 +7,7 @@ |
| #include "gpu/config/gpu_info.h" |
| #include "gpu/ipc/common/gpu_info.mojom.h" |
| +#include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
| namespace mojo { |
| @@ -47,5 +48,83 @@ struct EnumTraits<gpu::mojom::CollectInfoResult, gpu::CollectInfoResult> { |
| gpu::CollectInfoResult* out); |
| }; |
| +template <> |
| +struct EnumTraits<gpu::mojom::VideoCodecProfile, gpu::VideoCodecProfile> { |
| + static gpu::mojom::VideoCodecProfile ToMojom( |
| + gpu::VideoCodecProfile video_codec_profile); |
| + static bool FromMojom(gpu::mojom::VideoCodecProfile input, |
| + gpu::VideoCodecProfile* out); |
| +}; |
| + |
| +template <> |
| +struct StructTraits<gpu::mojom::VideoDecodeAcceleratorSupportedProfile, |
| + gpu::VideoDecodeAcceleratorSupportedProfile> { |
| + static bool Read( |
| + gpu::mojom::VideoDecodeAcceleratorSupportedProfileDataView data, |
| + gpu::VideoDecodeAcceleratorSupportedProfile* out); |
| + |
| + static gpu::VideoCodecProfile profile( |
| + const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
| + return input.profile; |
| + } |
| + |
| + static const gfx::Size& max_resolution( |
| + const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
| + return input.max_resolution; |
| + } |
| + |
| + static const gfx::Size& min_resolution( |
| + const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
| + return input.min_resolution; |
| + } |
| + |
| + static bool encrypted_only( |
| + const gpu::VideoDecodeAcceleratorSupportedProfile& input) { |
| + return input.encrypted_only; |
| + } |
| +}; |
| + |
| +template <> |
| +struct StructTraits<gpu::mojom::VideoDecodeAcceleratorCapabilities, |
| + gpu::VideoDecodeAcceleratorCapabilities> { |
| + static bool Read(gpu::mojom::VideoDecodeAcceleratorCapabilitiesDataView data, |
|
Fady Samuel
2016/07/26 15:31:56
Move to cc file. We generally move all Read method
Alex Z.
2016/07/26 15:37:25
Done.
|
| + gpu::VideoDecodeAcceleratorCapabilities* out) { |
| + out->flags = data.flags(); |
| + return true; |
| + } |
| + |
| + static uint32_t flags(const gpu::VideoDecodeAcceleratorCapabilities& input) { |
| + return input.flags; |
| + } |
| +}; |
| + |
| +template <> |
| +struct StructTraits<gpu::mojom::VideoEncodeAcceleratorSupportedProfile, |
| + gpu::VideoEncodeAcceleratorSupportedProfile> { |
| + static bool Read( |
| + gpu::mojom::VideoEncodeAcceleratorSupportedProfileDataView data, |
| + gpu::VideoEncodeAcceleratorSupportedProfile* out); |
| + |
| + static gpu::VideoCodecProfile profile( |
| + const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
| + return input.profile; |
| + } |
| + |
| + static const gfx::Size& max_resolution( |
| + const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
| + return input.max_resolution; |
| + } |
| + |
| + static uint32_t max_framerate_numerator( |
| + const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
| + return input.max_framerate_numerator; |
| + } |
| + |
| + static uint32_t max_framerate_denominator( |
| + const gpu::VideoEncodeAcceleratorSupportedProfile& input) { |
| + return input.max_framerate_denominator; |
| + } |
| +}; |
| + |
| } // namespace mojo |
| #endif // CC_IPC_GPU_STRUCT_TRAITS_H_ |