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

Unified Diff: ui/events/gesture_detection/motion_event.h

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) 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/events_stub.cc ('k') | ui/events/gesture_detection/motion_event_generic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/motion_event.h
diff --git a/ui/events/gesture_detection/motion_event.h b/ui/events/gesture_detection/motion_event.h
index 560afcbd044c20155ed281e7762f33ddbba77bb7..770a2290d0c3bd9ddaea295584e8338f62a567bb 100644
--- a/ui/events/gesture_detection/motion_event.h
+++ b/ui/events/gesture_detection/motion_event.h
@@ -60,6 +60,8 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
virtual float GetTouchMajor(size_t pointer_index) const = 0;
virtual float GetTouchMinor(size_t pointer_index) const = 0;
virtual float GetOrientation(size_t pointer_index) const = 0;
+ virtual float GetTilt(size_t pointer_index) const = 0;
+ virtual float GetTiltDirection(size_t pointer_index) const = 0;
virtual float GetPressure(size_t pointer_index) const = 0;
virtual ToolType GetToolType(size_t pointer_index) const = 0;
virtual int GetButtonState() const = 0;
@@ -94,6 +96,14 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
// radians. The return value lies in [-PI/2, PI/2].
float GetOrientation() const { return GetOrientation(0); }
+ // Gets the tilt angle of the stylus away from the perpendicular to the
+ // screen. The return value lies in [0, PI/2). Default is NaN.
+ float GetTilt() const { return GetTilt(0); }
+
+ // Gets the clockwise angle from the X axis to the XY-projection of the
+ // stylus. The range is from -PI radians to PI radians. Default is NaN.
+ float GetTiltDirection() const { return GetTiltDirection(0); }
+
float GetPressure() const { return GetPressure(0); }
ToolType GetToolType() const { return GetToolType(0); }
« no previous file with comments | « ui/events/events_stub.cc ('k') | ui/events/gesture_detection/motion_event_generic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698