Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PROXY_STRUCT_TRAITS_H_ | |
| 6 #define UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PROXY_STRUCT_TRAITS_H_ | |
| 7 | |
| 8 #include "base/logging.h" | |
|
kylechar
2017/01/17 17:19:26
I don't think this is used.
thanhph1
2017/01/17 20:19:05
Done.
| |
| 9 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" | |
| 10 | |
|
kylechar
2017/01/17 17:19:27
You have no #include that contains mojom::DisplayM
thanhph1
2017/01/17 20:19:05
Done.
| |
| 11 namespace mojo { | |
| 12 | |
| 13 template <> | |
| 14 struct StructTraits<ui::mojom::DisplayModeProxyDataView, | |
| 15 ui::DisplayMode_Params> { | |
| 16 static const gfx::Size& size(const ui::DisplayMode_Params& d) { | |
|
kylechar
2017/01/17 17:19:26
I would call the parameter |mode| or |display_mode
thanhph1
2017/01/17 20:19:05
Done.
| |
| 17 return d.size; | |
| 18 } | |
|
kylechar
2017/01/17 17:19:26
Whitespace between methods.
thanhph1
2017/01/17 20:19:05
Done.
| |
| 19 static bool is_interlaced(const ui::DisplayMode_Params& d) { | |
| 20 return d.is_interlaced; | |
| 21 } | |
| 22 static float refresh_rate(const ui::DisplayMode_Params& d) { | |
| 23 return d.refresh_rate; | |
| 24 } | |
| 25 | |
| 26 static bool Read(ui::mojom::DisplayModeProxyDataView data, | |
| 27 ui::DisplayMode_Params* out) { | |
| 28 if (data.is_null()) | |
|
kylechar
2017/01/17 17:19:27
You shouldn't need this check.
thanhph1
2017/01/17 20:19:05
Done.
| |
| 29 return false; | |
| 30 | |
| 31 if (!data.ReadSize(&out->size)) | |
| 32 return false; | |
| 33 | |
| 34 out->is_interlaced = data.is_interlaced(); | |
| 35 out->refresh_rate = data.refresh_rate(); | |
| 36 | |
| 37 return true; | |
| 38 } | |
| 39 }; | |
| 40 | |
| 41 } // namespace mojo | |
| 42 | |
| 43 #endif // UI_OZONE_COMMON_MOJO_DISPLAY_MODE_PROXY_STRUCT_TRAITS_H_ | |
| OLD | NEW |