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

Unified Diff: ppapi/cpp/input_event.cc

Issue 2890323002: Add tilt_x and tilt_y to ppapi touchpoint. (Closed)
Patch Set: Created 3 years, 7 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: ppapi/cpp/input_event.cc
diff --git a/ppapi/cpp/input_event.cc b/ppapi/cpp/input_event.cc
index 90f41fa2b8fbaeb99a51990a221a27dac8d3ac25..f305bdb1fb0034717df28e6353f2c6aa719b1b83 100644
--- a/ppapi/cpp/input_event.cc
+++ b/ppapi/cpp/input_event.cc
@@ -324,14 +324,28 @@ TouchPoint TouchInputEvent::GetTouchById(PP_TouchListType list,
uint32_t id) const {
if (!has_interface<PPB_TouchInputEvent_1_0>())
return TouchPoint();
- return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()->
- GetTouchById(pp_resource(), list, id));
+ if (!has_interface<PPB_TouchInputEvent_1_1>())
bbudge 2017/05/19 22:52:47 use brackets for multiline body. Also, the condit
jkwang 2017/05/23 04:07:44 Done.
+ return TouchPoint(
+ get_interface<PPB_TouchInputEvent_1_1>()->GetTouchById(pp_resource(),
+ list, id),
+ get_interface<PPB_TouchInputEvent_1_1>()->GetTouchTiltById(
+ pp_resource(), list, id));
+
+ return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()->GetTouchById(
+ pp_resource(), list, id));
}
TouchPoint TouchInputEvent::GetTouchByIndex(PP_TouchListType list,
uint32_t index) const {
if (!has_interface<PPB_TouchInputEvent_1_0>())
return TouchPoint();
+ if (!has_interface<PPB_TouchInputEvent_1_1>())
+ return TouchPoint(
+ get_interface<PPB_TouchInputEvent_1_1>()->GetTouchByIndex(pp_resource(),
+ list, index),
+ get_interface<PPB_TouchInputEvent_1_1>()->GetTouchTiltByIndex(
+ pp_resource(), list, index));
+
return TouchPoint(get_interface<PPB_TouchInputEvent_1_0>()->
GetTouchByIndex(pp_resource(), list, index));
}
« no previous file with comments | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/touch_point.h » ('j') | ppapi/cpp/touch_point.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698