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

Unified Diff: ui/events/gesture_detection/motion_event_generic.cc

Issue 1187273004: Pass MotionEvent tilt angles to Blink on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
Index: ui/events/gesture_detection/motion_event_generic.cc
diff --git a/ui/events/gesture_detection/motion_event_generic.cc b/ui/events/gesture_detection/motion_event_generic.cc
index a90c72af8bf70486a152e01d458557c7c1511cc9..45a8b39832f2067442c2a42d47d1c8563eabe14f 100644
--- a/ui/events/gesture_detection/motion_event_generic.cc
+++ b/ui/events/gesture_detection/motion_event_generic.cc
@@ -29,6 +29,7 @@ PointerProperties::PointerProperties(float x, float y, float touch_major)
touch_major(touch_major),
touch_minor(0),
orientation(0),
+ tilt(0),
source_device_id(0) {
}
@@ -44,6 +45,7 @@ PointerProperties::PointerProperties(const MotionEvent& event,
touch_major(event.GetTouchMajor(pointer_index)),
touch_minor(event.GetTouchMinor(pointer_index)),
orientation(event.GetOrientation(pointer_index)),
+ tilt(event.GetTilt(pointer_index)),
source_device_id(0) {
}
@@ -170,6 +172,11 @@ float MotionEventGeneric::GetPressure(size_t pointer_index) const {
return pointers_[pointer_index].pressure;
}
+float MotionEventGeneric::GetTilt(size_t pointer_index) const {
+ DCHECK_LT(pointer_index, pointers_->size());
+ return pointers_[pointer_index].tilt;
+}
+
MotionEvent::ToolType MotionEventGeneric::GetToolType(
size_t pointer_index) const {
DCHECK_LT(pointer_index, pointers_->size());

Powered by Google App Engine
This is Rietveld 408576698