| 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/tablet_event_converter_evdev.h" | 5 #include "ui/events/ozone/evdev/tablet_event_converter_evdev.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 ssize_t read_size = read(fd, inputs, sizeof(inputs)); | 74 ssize_t read_size = read(fd, inputs, sizeof(inputs)); |
| 75 if (read_size < 0) { | 75 if (read_size < 0) { |
| 76 if (errno == EINTR || errno == EAGAIN) | 76 if (errno == EINTR || errno == EAGAIN) |
| 77 return; | 77 return; |
| 78 if (errno != ENODEV) | 78 if (errno != ENODEV) |
| 79 PLOG(ERROR) << "error reading device " << path_.value(); | 79 PLOG(ERROR) << "error reading device " << path_.value(); |
| 80 Stop(); | 80 Stop(); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (!enabled_) | 84 if (!IsEnabled()) |
| 85 return; | 85 return; |
| 86 | 86 |
| 87 DCHECK_EQ(read_size % sizeof(*inputs), 0u); | 87 DCHECK_EQ(read_size % sizeof(*inputs), 0u); |
| 88 ProcessEvents(inputs, read_size / sizeof(*inputs)); | 88 ProcessEvents(inputs, read_size / sizeof(*inputs)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void TabletEventConverterEvdev::ProcessEvents(const input_event* inputs, | 91 void TabletEventConverterEvdev::ProcessEvents(const input_event* inputs, |
| 92 int count) { | 92 int count) { |
| 93 for (int i = 0; i < count; ++i) { | 93 for (int i = 0; i < count; ++i) { |
| 94 const input_event& input = inputs[i]; | 94 const input_event& input = inputs[i]; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 input_device_.id, EF_NONE, cursor_->GetLocation(), | 219 input_device_.id, EF_NONE, cursor_->GetLocation(), |
| 220 PointerDetails(GetToolType(stylus_), /* pointer_id*/ 0, | 220 PointerDetails(GetToolType(stylus_), /* pointer_id*/ 0, |
| 221 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, | 221 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure_, |
| 222 tilt_x_, tilt_y_), | 222 tilt_x_, tilt_y_), |
| 223 TimeTicksFromInputEvent(input))); | 223 TimeTicksFromInputEvent(input))); |
| 224 | 224 |
| 225 abs_value_dirty_ = false; | 225 abs_value_dirty_ = false; |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace ui | 228 } // namespace ui |
| OLD | NEW |