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_GFX_MOJO_ACCELERATED_WIDGET_STRUCT_TRAITS_H_ | 5 #ifndef UI_GFX_MOJO_ACCELERATED_WIDGET_STRUCT_TRAITS_H_ |
6 #define UI_GFX_MOJO_ACCELERATED_WIDGET_STRUCT_TRAITS_H_ | 6 #define UI_GFX_MOJO_ACCELERATED_WIDGET_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "ui/gfx/mojo/accelerated_widget.mojom.h" | 8 #include "ui/gfx/mojo/accelerated_widget.mojom.h" |
9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 template <> | 13 template <> |
14 struct StructTraits<gfx::mojom::AcceleratedWidget, gfx::AcceleratedWidget> { | 14 struct StructTraits<gfx::mojom::AcceleratedWidgetDataView, |
| 15 gfx::AcceleratedWidget> { |
15 static uint64_t widget(const gfx::AcceleratedWidget& widget) { | 16 static uint64_t widget(const gfx::AcceleratedWidget& widget) { |
16 #if defined(OS_WIN) || defined(USE_OZONE) || defined(USE_X11) | 17 #if defined(OS_WIN) || defined(USE_OZONE) || defined(USE_X11) |
17 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
18 return reinterpret_cast<uint64_t>(widget); | 19 return reinterpret_cast<uint64_t>(widget); |
19 #else | 20 #else |
20 return static_cast<uint64_t>(widget); | 21 return static_cast<uint64_t>(widget); |
21 #endif | 22 #endif |
22 #else | 23 #else |
23 NOTIMPLEMENTED(); | 24 NOTIMPLEMENTED(); |
24 return 0; | 25 return 0; |
(...skipping 13 matching lines...) Expand all Loading... |
38 NOTIMPLEMENTED(); | 39 NOTIMPLEMENTED(); |
39 *out = 0; | 40 *out = 0; |
40 #endif | 41 #endif |
41 return true; | 42 return true; |
42 } | 43 } |
43 }; | 44 }; |
44 | 45 |
45 } // namespace mojo | 46 } // namespace mojo |
46 | 47 |
47 #endif // UI_GFX_MOJO_ACCELERATED_WIDGET_STRUCT_TRAITS_H_ | 48 #endif // UI_GFX_MOJO_ACCELERATED_WIDGET_STRUCT_TRAITS_H_ |
OLD | NEW |