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

Side by Side Diff: ui/ozone/common/mojo/display_mode_params_struct_traits.h

Issue 2636073002: Create mojom and StructTraits for ui/display/types/display_mode.cc (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 #ifndef UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
2 #define UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
3
4 #include "ui/ozone/common/mojo/display_mode_params.mojom.h"
5 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
6
7 namespace mojo {
8
9 template <>
10 struct StructTraits<ui::mojom::DisplayModeParamsDataView, ui::DisplayMode_Params > {
11 static const gfx::Size& size(const ui::DisplayMode_Params& d) { return d.size; }
12 static bool is_interlaced(const ui::DisplayMode_Params& d) { return d.is_inter laced; }
13 static float refresh_rate(const ui::DisplayMode_Params& d) {
14 return d.refresh_rate;
15 }
16
17 static bool Read(ui::mojom::DisplayModeParamsDataView data, ui::DisplayMode_Pa rams* out) {
18
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!
19 if (data.is_null())
20 return false;
21
22 if (!data.ReadSize(&out->size))
23 return false;
24 return true;
25 }
26
27 };
28
29 }
30
31 #endif // UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698