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

Unified Diff: ui/events/ozone/evdev/event_device_test_util.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_info.cc ('k') | ui/events/ozone/evdev/touch_event_converter_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_device_test_util.cc
diff --git a/ui/events/ozone/evdev/event_device_test_util.cc b/ui/events/ozone/evdev/event_device_test_util.cc
index b5256b76c2bd7004da264dda33046e8ee0c537ec..cb4116ca3f8618cdb7a9a04fff735fd8f4c05a0c 100644
--- a/ui/events/ozone/evdev/event_device_test_util.cc
+++ b/ui/events/ozone/evdev/event_device_test_util.cc
@@ -405,6 +405,18 @@ bool CapabilitiesToDeviceInfo(const DeviceCapabilities& capabilities,
devinfo->SetAbsInfo(axis.code, axis.absinfo);
}
+ size_t slots = devinfo->GetAbsMtSlotCount();
+ std::vector<int32_t> zero_slots(slots, 0);
+ std::vector<int32_t> minus_one_slots(slots, -1);
+ for (int code = EVDEV_ABS_MT_FIRST; code <= EVDEV_ABS_MT_LAST; ++code) {
+ if (!devinfo->HasAbsEvent(code))
+ continue;
+ if (code == ABS_MT_TRACKING_ID)
+ devinfo->SetAbsMtSlots(code, minus_one_slots);
+ else
+ devinfo->SetAbsMtSlots(code, zero_slots);
+ }
+
return true;
}
« no previous file with comments | « ui/events/ozone/evdev/event_device_info.cc ('k') | ui/events/ozone/evdev/touch_event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698