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

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

Issue 349463002: [Android] Map raw touch coordinates to global gesture locations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/gesture_event_data.cc
diff --git a/ui/events/gesture_detection/gesture_event_data.cc b/ui/events/gesture_detection/gesture_event_data.cc
index 518e6fc9b6562fa40a3811db8d6cc658f043b25a..bcad2704d320729aefc4186d9a1c3b3d8b312503 100644
--- a/ui/events/gesture_detection/gesture_event_data.cc
+++ b/ui/events/gesture_detection/gesture_event_data.cc
@@ -13,13 +13,17 @@ GestureEventData::GestureEventData(const GestureEventDetails& details,
base::TimeTicks time,
float x,
float y,
+ float raw_x,
+ float raw_y,
int touch_point_count,
const gfx::RectF& bounding_box)
: details(details),
motion_event_id(motion_event_id),
time(time),
x(x),
- y(y) {
+ y(y),
+ raw_x(raw_x),
+ raw_y(raw_y) {
DCHECK_GE(motion_event_id, 0);
DCHECK_NE(0, touch_point_count);
this->details.set_touch_points(touch_point_count);
@@ -27,23 +31,20 @@ GestureEventData::GestureEventData(const GestureEventDetails& details,
}
GestureEventData::GestureEventData(EventType type,
- int motion_event_id,
- base::TimeTicks time,
- float x,
- float y,
- int touch_point_count,
- const gfx::RectF& bounding_box)
- : details(GestureEventDetails(type, 0, 0)),
- motion_event_id(motion_event_id),
- time(time),
- x(x),
- y(y) {
- DCHECK_GE(motion_event_id, 0);
- details.set_touch_points(touch_point_count);
- details.set_bounding_box(bounding_box);
+ const GestureEventData& other)
+ : details(type, 0, 0),
+ motion_event_id(other.motion_event_id),
+ time(other.time),
+ x(other.x),
+ y(other.y),
+ raw_x(other.raw_x),
+ raw_y(other.raw_y) {
+ details.set_touch_points(other.details.touch_points());
+ details.set_bounding_box(other.details.bounding_box_f());
}
-GestureEventData::GestureEventData() : x(0), y(0) {
+GestureEventData::GestureEventData()
+ : motion_event_id(0), x(0), y(0), raw_x(0), raw_y(0) {
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698