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

Side by Side Diff: ui/events/gestures/motion_event_aura.h

Issue 494833003: Completed webkit radiusX, radiusY and rotationAngle handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaked NaN checks Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_
6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 16 matching lines...) Expand all
27 virtual int GetId() const OVERRIDE; 27 virtual int GetId() const OVERRIDE;
28 virtual Action GetAction() const OVERRIDE; 28 virtual Action GetAction() const OVERRIDE;
29 virtual int GetActionIndex() const OVERRIDE; 29 virtual int GetActionIndex() const OVERRIDE;
30 virtual size_t GetPointerCount() const OVERRIDE; 30 virtual size_t GetPointerCount() const OVERRIDE;
31 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; 31 virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
32 virtual float GetX(size_t pointer_index) const OVERRIDE; 32 virtual float GetX(size_t pointer_index) const OVERRIDE;
33 virtual float GetY(size_t pointer_index) const OVERRIDE; 33 virtual float GetY(size_t pointer_index) const OVERRIDE;
34 virtual float GetRawX(size_t pointer_index) const OVERRIDE; 34 virtual float GetRawX(size_t pointer_index) const OVERRIDE;
35 virtual float GetRawY(size_t pointer_index) const OVERRIDE; 35 virtual float GetRawY(size_t pointer_index) const OVERRIDE;
36 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; 36 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
37 virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE;
38 virtual float GetOrientation(size_t pointer_index) const OVERRIDE;
37 virtual float GetPressure(size_t pointer_index) const OVERRIDE; 39 virtual float GetPressure(size_t pointer_index) const OVERRIDE;
38 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE; 40 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
39 virtual int GetButtonState() const OVERRIDE; 41 virtual int GetButtonState() const OVERRIDE;
40 virtual base::TimeTicks GetEventTime() const OVERRIDE; 42 virtual base::TimeTicks GetEventTime() const OVERRIDE;
41 43
42 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; 44 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
43 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; 45 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
44 46
45 int GetSourceDeviceId(size_t pointer_index) const; 47 int GetSourceDeviceId(size_t pointer_index) const;
46 48
47 // We can't cleanup removed touch points immediately upon receipt of a 49 // We can't cleanup removed touch points immediately upon receipt of a
48 // TouchCancel or TouchRelease, as the MotionEvent needs to be able to report 50 // TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
49 // information about those touch events. Once the MotionEvent has been 51 // information about those touch events. Once the MotionEvent has been
50 // processed, we call CleanupRemovedTouchPoints to do the required 52 // processed, we call CleanupRemovedTouchPoints to do the required
51 // book-keeping. 53 // book-keeping.
52 void CleanupRemovedTouchPoints(const TouchEvent& event); 54 void CleanupRemovedTouchPoints(const TouchEvent& event);
53 55
54 private: 56 private:
55 struct PointData { 57 struct PointData {
56 PointData(); 58 PointData();
57 float x; 59 float x;
58 float y; 60 float y;
59 float raw_x; 61 float raw_x;
60 float raw_y; 62 float raw_y;
61 int touch_id; 63 int touch_id;
62 float pressure; 64 float pressure;
63 int source_device_id; 65 int source_device_id;
66 // TODO(mustaq): Switch radii to diameters below, to be
67 // consistent with relevant event params.
64 float major_radius; 68 float major_radius;
jdduke (slow) 2014/08/29 16:45:09 Any reason not to do this TODO now?
mustaq 2014/08/29 20:54:01 Done. Wanted to investigate later if this private
69 float minor_radius;
70 float orientation;
65 }; 71 };
66 72
67 MotionEventAura( 73 MotionEventAura(
68 size_t pointer_count, 74 size_t pointer_count,
69 const base::TimeTicks& last_touch_time, 75 const base::TimeTicks& last_touch_time,
70 Action cached_action, 76 Action cached_action,
71 int cached_action_index, 77 int cached_action_index,
72 const PointData (&active_touches)[MotionEvent::MAX_TOUCH_POINT_COUNT]); 78 const PointData (&active_touches)[MotionEvent::MAX_TOUCH_POINT_COUNT]);
73 79
74 static PointData GetPointDataFromTouchEvent(const TouchEvent& touch); 80 static PointData GetPointDataFromTouchEvent(const TouchEvent& touch);
(...skipping 11 matching lines...) Expand all
86 92
87 // We want constant time indexing by pointer_index, and fast indexing by id. 93 // We want constant time indexing by pointer_index, and fast indexing by id.
88 PointData active_touches_[MotionEvent::MAX_TOUCH_POINT_COUNT]; 94 PointData active_touches_[MotionEvent::MAX_TOUCH_POINT_COUNT];
89 95
90 DISALLOW_COPY_AND_ASSIGN(MotionEventAura); 96 DISALLOW_COPY_AND_ASSIGN(MotionEventAura);
91 }; 97 };
92 98
93 } // namespace ui 99 } // namespace ui
94 100
95 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ 101 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698