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

Unified Diff: ui/base/x/events_x.cc

Issue 10868100: x11: Use kernel timestamps for touch events (if available). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | ui/base/x/valuators.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/events_x.cc
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index 8c2dff28b588be303844774b7c0027ef99154da3..11734ce75cd81448e3278ae3ab3b469b20d65db0 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -772,9 +772,13 @@ base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) {
break;
case GenericEvent: {
double start, end;
+ float touch_timestamp;
if (GetGestureTimes(native_event, &start, &end)) {
// If the driver supports gesture times, use them.
return base::TimeDelta::FromMicroseconds(end * 1000000);
+ } else if (ValuatorTracker::GetInstance()->ExtractValuator(*native_event,
+ ValuatorTracker::VAL_TOUCH_RAW_TIMESTAMP, &touch_timestamp)) {
+ return base::TimeDelta::FromMicroseconds(touch_timestamp * 1000000);
} else {
XIDeviceEvent* xide =
static_cast<XIDeviceEvent*>(native_event->xcookie.data);
« no previous file with comments | « no previous file | ui/base/x/valuators.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698