OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_DISPLAY_MOJO_DISPLAY_STRUCT_TRAITS_H_ | 5 #ifndef UI_DISPLAY_MOJO_DISPLAY_STRUCT_TRAITS_H_ |
6 #define UI_DISPLAY_MOJO_DISPLAY_STRUCT_TRAITS_H_ | 6 #define UI_DISPLAY_MOJO_DISPLAY_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "ui/display/display.h" | 8 #include "ui/display/display.h" |
9 #include "ui/display/mojo/display.mojom.h" | 9 #include "ui/display/mojo/display.mojom.h" |
10 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" | 10 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 }; | 28 }; |
29 | 29 |
30 template <> | 30 template <> |
31 struct StructTraits<display::mojom::DisplayDataView, display::Display> { | 31 struct StructTraits<display::mojom::DisplayDataView, display::Display> { |
32 static int64_t id(const display::Display& display) { return display.id(); } | 32 static int64_t id(const display::Display& display) { return display.id(); } |
33 | 33 |
34 static const gfx::Rect& bounds(const display::Display& display) { | 34 static const gfx::Rect& bounds(const display::Display& display) { |
35 return display.bounds(); | 35 return display.bounds(); |
36 } | 36 } |
37 | 37 |
| 38 static gfx::Size size_in_pixels(const display::Display& display) { |
| 39 return display.GetSizeInPixel(); |
| 40 } |
| 41 |
38 static const gfx::Rect& work_area(const display::Display& display) { | 42 static const gfx::Rect& work_area(const display::Display& display) { |
39 return display.work_area(); | 43 return display.work_area(); |
40 } | 44 } |
41 | 45 |
42 static float device_scale_factor(const display::Display& display) { | 46 static float device_scale_factor(const display::Display& display) { |
43 return display.device_scale_factor(); | 47 return display.device_scale_factor(); |
44 } | 48 } |
45 | 49 |
46 static display::Display::Rotation rotation(const display::Display& display) { | 50 static display::Display::Rotation rotation(const display::Display& display) { |
47 return display.rotation(); | 51 return display.rotation(); |
48 } | 52 } |
49 | 53 |
50 static display::Display::TouchSupport touch_support( | 54 static display::Display::TouchSupport touch_support( |
51 const display::Display& display) { | 55 const display::Display& display) { |
52 return display.touch_support(); | 56 return display.touch_support(); |
53 } | 57 } |
54 | 58 |
55 static const gfx::Size& maximum_cursor_size(const display::Display& display) { | 59 static const gfx::Size& maximum_cursor_size(const display::Display& display) { |
56 return display.maximum_cursor_size(); | 60 return display.maximum_cursor_size(); |
57 } | 61 } |
58 | 62 |
| 63 static int32_t color_depth(const display::Display& display) { |
| 64 return display.color_depth(); |
| 65 } |
| 66 |
| 67 static int32_t depth_per_component(const display::Display& display) { |
| 68 return display.depth_per_component(); |
| 69 } |
| 70 |
| 71 static bool is_monochrome(const display::Display& display) { |
| 72 return display.is_monochrome(); |
| 73 } |
| 74 |
59 static bool Read(display::mojom::DisplayDataView data, display::Display* out); | 75 static bool Read(display::mojom::DisplayDataView data, display::Display* out); |
60 }; | 76 }; |
61 | 77 |
62 } // namespace mojo | 78 } // namespace mojo |
63 | 79 |
64 #endif // UI_DISPLAY_MOJO_DISPLAY_STRUCT_TRAITS_H_ | 80 #endif // UI_DISPLAY_MOJO_DISPLAY_STRUCT_TRAITS_H_ |
OLD | NEW |