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

Side by Side Diff: ui/display/mojo/display_mode_struct_traits.h

Issue 2646213002: Write mojom and StructTraits for DisplaySnapshot. (Closed)
Patch Set: Rebase. Created 3 years, 9 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
« no previous file with comments | « ui/display/mojo/display_mode.typemap ('k') | ui/display/mojo/display_mode_struct_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_MODE_STRUCT_TRAITS_H_ 5 #ifndef UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
6 #define UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ 6 #define UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
7 7
8 #include "ui/display/types/display_mode.h" 8 #include "ui/display/types/display_mode.h"
9 #include "ui/display/mojo/display_mode.mojom.h" 9 #include "ui/display/mojo/display_mode.mojom.h"
10 #include "ui/gfx/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
(...skipping 12 matching lines...) Expand all
23 const std::unique_ptr<display::DisplayMode>& display_mode) { 23 const std::unique_ptr<display::DisplayMode>& display_mode) {
24 return display_mode->is_interlaced(); 24 return display_mode->is_interlaced();
25 } 25 }
26 26
27 static float refresh_rate( 27 static float refresh_rate(
28 const std::unique_ptr<display::DisplayMode>& display_mode) { 28 const std::unique_ptr<display::DisplayMode>& display_mode) {
29 return display_mode->refresh_rate(); 29 return display_mode->refresh_rate();
30 } 30 }
31 31
32 static bool Read(display::mojom::DisplayModeDataView data, 32 static bool Read(display::mojom::DisplayModeDataView data,
33 std::unique_ptr<display::DisplayMode>* out) { 33 std::unique_ptr<display::DisplayMode>* out);
34 gfx::Size size;
35 if (!data.ReadSize(&size))
36 return false;
37 *out = base::MakeUnique<display::DisplayMode>(size, data.is_interlaced(),
38 data.refresh_rate());
39 return true;
40 }
41 }; 34 };
42 35
43 } // namespace mojo 36 } // namespace mojo
44 37
45 #endif // UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_ 38 #endif // UI_DISPLAY_MOJO_DISPLAY_MODE_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « ui/display/mojo/display_mode.typemap ('k') | ui/display/mojo/display_mode_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698