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

Side by Side Diff: ui/display/manager/chromeos/mojo/touch_device_transform_struct_traits.h

Issue 2901563002: chromeos: adds TouchDeviceServer and wires up in mushrome (Closed)
Patch Set: no temporary Created 3 years, 7 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 // Copyright 2017 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_DISPLAY_MANAGER_CHROMEOS_MOJO_TOUCH_DEVICE_TRANSFORM_STRUCT_TRAITS_H_
6 #define UI_DISPLAY_MANAGER_CHROMEOS_MOJO_TOUCH_DEVICE_TRANSFORM_STRUCT_TRAITS_H_
7
8 #include <stdint.h>
9
10 #include "ui/display/manager/chromeos/mojo/touch_device_transform.mojom.h"
11 #include "ui/display/manager/chromeos/touch_device_transform.h"
12 #include "ui/gfx/mojo/transform_struct_traits.h"
13
14 namespace mojo {
15
16 template <>
17 struct StructTraits<display::mojom::TouchDeviceTransformDataView,
18 display::TouchDeviceTransform> {
19 public:
20 static int64_t display_id(const display::TouchDeviceTransform& r) {
21 return r.display_id;
22 }
23 static int32_t device_id(const display::TouchDeviceTransform& r) {
24 return r.device_id;
25 }
26 static const gfx::Transform& transform(
27 const display::TouchDeviceTransform& r) {
28 return r.transform;
29 }
30
31 static bool Read(display::mojom::TouchDeviceTransformDataView data,
32 display::TouchDeviceTransform* out) {
33 out->display_id = data.display_id();
34 out->device_id = data.device_id();
35 if (!data.ReadTransform(&(out->transform)))
36 return false;
37 return true;
38 }
39 };
40
41 } // namespace mojo
42
43 #endif // UI_DISPLAY_MANAGER_CHROMEOS_MOJO_TOUCH_DEVICE_TRANSFORM_STRUCT_TRAITS _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698