| 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..223d51ed5ac2ccf428b0d84784ac05069fa02c54
|
| --- /dev/null
|
| +++ b/ui/ozone/common/mojo/display_mode_params_struct_traits.h
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PARAMS_STRUCT_TRAITS_H_
|
| +#define UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PARAMS_STRUCT_TRAITS_H_
|
| +
|
| +#include "ui/gfx/geometry/size.h"
|
| +#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
|
| +#include "ui/ozone/common/mojo/display_mode_params.mojom.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <>
|
| +struct StructTraits<ui::mojom::DisplayModeParamsDataView,
|
| + ui::DisplayMode_Params> {
|
| + static const gfx::Size& size(const ui::DisplayMode_Params& display_mode) {
|
| + return display_mode.size;
|
| + }
|
| +
|
| + static bool is_interlaced(const ui::DisplayMode_Params& display_mode) {
|
| + return display_mode.is_interlaced;
|
| + }
|
| +
|
| + static float refresh_rate(const ui::DisplayMode_Params& display_mode) {
|
| + return display_mode.refresh_rate;
|
| + }
|
| +
|
| + static bool Read(ui::mojom::DisplayModeParamsDataView data,
|
| + ui::DisplayMode_Params* out) {
|
| + if (!data.ReadSize(&out->size))
|
| + return false;
|
| +
|
| + out->is_interlaced = data.is_interlaced();
|
| + out->refresh_rate = data.refresh_rate();
|
| +
|
| + return true;
|
| + }
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PARAMS_STRUCT_TRAITS_H_
|
|
|