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

Unified Diff: content/browser/renderer_host/input/motion_event_android.cc

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: content/browser/renderer_host/input/motion_event_android.cc
diff --git a/content/browser/renderer_host/input/motion_event_android.cc b/content/browser/renderer_host/input/motion_event_android.cc
index fa21047d71b78cdf37b5c39c2ef6fe5799c2f15d..d8c0b445f0443659bf6c07800716608c3f0c7ab5 100644
--- a/content/browser/renderer_host/input/motion_event_android.cc
+++ b/content/browser/renderer_host/input/motion_event_android.cc
@@ -240,6 +240,14 @@ float MotionEventAndroid::GetOrientation(size_t pointer_index) const {
AttachCurrentThread(), event_.obj(), pointer_index));
}
+float MotionEventAndroid::GetTilt(size_t pointer_index) const {
+ DCHECK_LT(pointer_index, cached_pointer_count_);
+ if (!event_.obj())
+ return 0.f;
+ return Java_MotionEvent_getAxisValueF_I_I(
+ AttachCurrentThread(), event_.obj(), AXIS_TILT, pointer_index);
+}
+
float MotionEventAndroid::GetPressure(size_t pointer_index) const {
DCHECK_LT(pointer_index, cached_pointer_count_);
// Note that this early return is a special case exercised only in testing, as

Powered by Google App Engine
This is Rietveld 408576698