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

Unified Diff: ui/events/ozone/evdev/touch_event_converter_evdev.cc

Issue 1037843003: ozone: evdev: Allow setting slot values in EventDeviceInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: define ABS_MT_TOOL_Y if missing Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/ozone/evdev/event_device_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/touch_event_converter_evdev.cc
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.cc b/ui/events/ozone/evdev/touch_event_converter_evdev.cc
index fe734bc7861a92cbb35b7c5e4093e0dccdb8c38d..221e6bf72cca3a008bea9105d431249ce826390f 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev.cc
@@ -110,14 +110,19 @@ void TouchEventConverterEvdev::Initialize(const EventDeviceInfo& info) {
events_.resize(touch_points_);
for (size_t i = 0; i < events_.size(); ++i) {
- events_[i].x = info.GetSlotValue(ABS_MT_POSITION_X, i);
- events_[i].y = info.GetSlotValue(ABS_MT_POSITION_Y, i);
- events_[i].tracking_id = info.GetSlotValue(ABS_MT_TRACKING_ID, i);
+ events_[i].x = info.GetAbsMtSlotValue(ABS_MT_POSITION_X, i);
+ events_[i].y = info.GetAbsMtSlotValue(ABS_MT_POSITION_Y, i);
+ events_[i].tracking_id = info.GetAbsMtSlotValue(ABS_MT_TRACKING_ID, i);
events_[i].touching = (events_[i].tracking_id >= 0);
events_[i].slot = i;
- events_[i].radius_x = info.GetSlotValue(ABS_MT_TOUCH_MAJOR, i);
- events_[i].radius_y = info.GetSlotValue(ABS_MT_TOUCH_MINOR, i);
- events_[i].pressure = info.GetSlotValue(ABS_MT_PRESSURE, i);
+
+ // Optional bits.
+ events_[i].radius_x =
+ info.GetAbsMtSlotValueWithDefault(ABS_MT_TOUCH_MAJOR, i, 0);
+ events_[i].radius_y =
+ info.GetAbsMtSlotValueWithDefault(ABS_MT_TOUCH_MINOR, i, 0);
+ events_[i].pressure =
+ info.GetAbsMtSlotValueWithDefault(ABS_MT_PRESSURE, i, 0);
}
}
« no previous file with comments | « ui/events/ozone/evdev/event_device_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698