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

Unified Diff: gpu/ipc/common/gpu_info_struct_traits.h

Issue 2147693002: Struct traits used by GpuInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DxDiagNode struct traits Read() to a cc file 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/common/gpu_info.typemap ('k') | gpu/ipc/common/gpu_info_struct_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « gpu/ipc/common/gpu_info.typemap ('k') | gpu/ipc/common/gpu_info_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698