| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" | 5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/input.h> | 9 #include <linux/input.h> |
| 10 #include <poll.h> | 10 #include <poll.h> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 const int kTrackingIdForUnusedSlot = -1; | 92 const int kTrackingIdForUnusedSlot = -1; |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 namespace ui { | 96 namespace ui { |
| 97 | 97 |
| 98 TouchEventConverterEvdev::TouchEventConverterEvdev( | 98 TouchEventConverterEvdev::TouchEventConverterEvdev( |
| 99 int fd, | 99 ScopedInputDevice fd, |
| 100 base::FilePath path, | 100 base::FilePath path, |
| 101 int id, | 101 int id, |
| 102 const EventDeviceInfo& devinfo, | 102 const EventDeviceInfo& devinfo, |
| 103 DeviceEventDispatcherEvdev* dispatcher) | 103 DeviceEventDispatcherEvdev* dispatcher) |
| 104 : EventConverterEvdev(fd, | 104 : EventConverterEvdev(fd.get(), |
| 105 path, | 105 path, |
| 106 id, | 106 id, |
| 107 devinfo.device_type(), | 107 devinfo.device_type(), |
| 108 devinfo.name(), | 108 devinfo.name(), |
| 109 devinfo.vendor_id(), | 109 devinfo.vendor_id(), |
| 110 devinfo.product_id()), | 110 devinfo.product_id()), |
| 111 input_device_fd_(std::move(fd)), |
| 111 dispatcher_(dispatcher) { | 112 dispatcher_(dispatcher) { |
| 112 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 113 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 113 switches::kExtraTouchNoiseFiltering)) { | 114 switches::kExtraTouchNoiseFiltering)) { |
| 114 touch_noise_finder_.reset(new TouchNoiseFinder); | 115 touch_noise_finder_.reset(new TouchNoiseFinder); |
| 115 } | 116 } |
| 116 touch_evdev_debug_buffer_.Initialize(devinfo); | 117 touch_evdev_debug_buffer_.Initialize(devinfo); |
| 117 } | 118 } |
| 118 | 119 |
| 119 TouchEventConverterEvdev::~TouchEventConverterEvdev() { | 120 TouchEventConverterEvdev::~TouchEventConverterEvdev() { |
| 120 } | 121 } |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 if (pressure_max_ - pressure_min_) | 533 if (pressure_max_ - pressure_min_) |
| 533 pressure /= pressure_max_ - pressure_min_; | 534 pressure /= pressure_max_ - pressure_min_; |
| 534 return pressure; | 535 return pressure; |
| 535 } | 536 } |
| 536 | 537 |
| 537 int TouchEventConverterEvdev::NextTrackingId() { | 538 int TouchEventConverterEvdev::NextTrackingId() { |
| 538 return next_tracking_id_++ & kMaxTrackingId; | 539 return next_tracking_id_++ & kMaxTrackingId; |
| 539 } | 540 } |
| 540 | 541 |
| 541 } // namespace ui | 542 } // namespace ui |
| OLD | NEW |