| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 return touch.was_touching ? ET_TOUCH_MOVED : ET_TOUCH_PRESSED; | 437 return touch.was_touching ? ET_TOUCH_MOVED : ET_TOUCH_PRESSED; |
| 438 return touch.was_touching ? ET_TOUCH_RELEASED : ET_UNKNOWN; | 438 return touch.was_touching ? ET_TOUCH_RELEASED : ET_UNKNOWN; |
| 439 } | 439 } |
| 440 | 440 |
| 441 void TouchEventConverterEvdev::ReportTouchEvent( | 441 void TouchEventConverterEvdev::ReportTouchEvent( |
| 442 const InProgressTouchEvdev& event, | 442 const InProgressTouchEvdev& event, |
| 443 EventType event_type, | 443 EventType event_type, |
| 444 base::TimeTicks timestamp) { | 444 base::TimeTicks timestamp) { |
| 445 ui::PointerDetails details(event.reported_tool_type, event.radius_x, | 445 ui::PointerDetails details(event.reported_tool_type, event.radius_x, |
| 446 event.radius_y, event.pressure, | 446 event.radius_y, event.pressure, |
| 447 /* tilt_x */ 0.0f, /* tilt_y */ 0.0f); | 447 /* tilt_x */ 0.0f, /* tilt_y */ 0.0f, |
| 448 /* tangentialPressure */ 0.0f, /* twist */ 0); |
| 448 dispatcher_->DispatchTouchEvent( | 449 dispatcher_->DispatchTouchEvent( |
| 449 TouchEventParams(input_device_.id, event.slot, event_type, | 450 TouchEventParams(input_device_.id, event.slot, event_type, |
| 450 gfx::PointF(event.x, event.y), details, timestamp)); | 451 gfx::PointF(event.x, event.y), details, timestamp)); |
| 451 } | 452 } |
| 452 | 453 |
| 453 void TouchEventConverterEvdev::CancelAllTouches() { | 454 void TouchEventConverterEvdev::CancelAllTouches() { |
| 454 // TODO(denniskempin): Remove once upper layers properly handle single | 455 // TODO(denniskempin): Remove once upper layers properly handle single |
| 455 // cancelled touches. | 456 // cancelled touches. |
| 456 for (size_t i = 0; i < events_.size(); i++) { | 457 for (size_t i = 0; i < events_.size(); i++) { |
| 457 InProgressTouchEvdev* event = &events_[i]; | 458 InProgressTouchEvdev* event = &events_[i]; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 if (pressure_max_ - pressure_min_) | 557 if (pressure_max_ - pressure_min_) |
| 557 pressure /= pressure_max_ - pressure_min_; | 558 pressure /= pressure_max_ - pressure_min_; |
| 558 return pressure; | 559 return pressure; |
| 559 } | 560 } |
| 560 | 561 |
| 561 int TouchEventConverterEvdev::NextTrackingId() { | 562 int TouchEventConverterEvdev::NextTrackingId() { |
| 562 return next_tracking_id_++ & kMaxTrackingId; | 563 return next_tracking_id_++ & kMaxTrackingId; |
| 563 } | 564 } |
| 564 | 565 |
| 565 } // namespace ui | 566 } // namespace ui |
| OLD | NEW |