Chromium Code Reviews| Index: ui/ozone/common/mojo/display_mode_params_struct_traits.h |
| diff --git a/ui/ozone/common/mojo/display_mode_params_struct_traits.h b/ui/ozone/common/mojo/display_mode_params_struct_traits.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6548cc93e480293edc8521b2dc2984a2201dfeaa |
| --- /dev/null |
| +++ b/ui/ozone/common/mojo/display_mode_params_struct_traits.h |
| @@ -0,0 +1,31 @@ |
| +#ifndef UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ |
| +#define UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ |
| + |
| +#include "ui/ozone/common/mojo/display_mode_params.mojom.h" |
| +#include "ui/ozone/common/gpu/ozone_gpu_message_params.h" |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct StructTraits<ui::mojom::DisplayModeParamsDataView, ui::DisplayMode_Params> { |
| + static const gfx::Size& size(const ui::DisplayMode_Params& d) { return d.size; } |
| + static bool is_interlaced(const ui::DisplayMode_Params& d) { return d.is_interlaced; } |
| + static float refresh_rate(const ui::DisplayMode_Params& d) { |
| + return d.refresh_rate; |
| + } |
| + |
| + static bool Read(ui::mojom::DisplayModeParamsDataView data, ui::DisplayMode_Params* out) { |
| + |
|
kylechar
2017/01/16 23:08:24
You're not setting is_interlaced or refresh_rate o
thanhph1
2017/01/17 16:47:59
Done, thanks!
|
| + if (data.is_null()) |
| + return false; |
| + |
| + if (!data.ReadSize(&out->size)) |
| + return false; |
| + return true; |
| + } |
| + |
| +}; |
| + |
| +} |
| + |
| +#endif // UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ |