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

Side by Side Diff: content/browser/renderer_host/input/motion_event_android.h

Issue 494833003: Completed webkit radiusX, radiusY and rotationAngle handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 21 matching lines...) Expand all
32 jint history_size, 32 jint history_size,
33 jint action_index, 33 jint action_index,
34 jfloat pos_x_0_pixels, 34 jfloat pos_x_0_pixels,
35 jfloat pos_y_0_pixels, 35 jfloat pos_y_0_pixels,
36 jfloat pos_x_1_pixels, 36 jfloat pos_x_1_pixels,
37 jfloat pos_y_1_pixels, 37 jfloat pos_y_1_pixels,
38 jint pointer_id_0, 38 jint pointer_id_0,
39 jint pointer_id_1, 39 jint pointer_id_1,
40 jfloat touch_major_0_pixels, 40 jfloat touch_major_0_pixels,
41 jfloat touch_major_1_pixels, 41 jfloat touch_major_1_pixels,
42 jfloat touch_minor_0_pixels,
43 jfloat touch_minor_1_pixels,
44 jfloat orientation_0_rad,
45 jfloat orientation_1_rad,
42 jfloat raw_pos_x_pixels, 46 jfloat raw_pos_x_pixels,
43 jfloat raw_pos_y_pixels, 47 jfloat raw_pos_y_pixels,
44 jint android_tool_type_0, 48 jint android_tool_type_0,
45 jint android_tool_type_1, 49 jint android_tool_type_1,
46 jint android_button_state); 50 jint android_button_state);
47 virtual ~MotionEventAndroid(); 51 virtual ~MotionEventAndroid();
48 52
49 // ui::MotionEvent methods. 53 // ui::MotionEvent methods.
50 virtual int GetId() const OVERRIDE; 54 virtual int GetId() const OVERRIDE;
51 virtual Action GetAction() const OVERRIDE; 55 virtual Action GetAction() const OVERRIDE;
52 virtual int GetActionIndex() const OVERRIDE; 56 virtual int GetActionIndex() const OVERRIDE;
53 virtual size_t GetPointerCount() const OVERRIDE; 57 virtual size_t GetPointerCount() const OVERRIDE;
54 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; 58 virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
55 virtual float GetX(size_t pointer_index) const OVERRIDE; 59 virtual float GetX(size_t pointer_index) const OVERRIDE;
56 virtual float GetY(size_t pointer_index) const OVERRIDE; 60 virtual float GetY(size_t pointer_index) const OVERRIDE;
57 virtual float GetRawX(size_t pointer_index) const OVERRIDE; 61 virtual float GetRawX(size_t pointer_index) const OVERRIDE;
58 virtual float GetRawY(size_t pointer_index) const OVERRIDE; 62 virtual float GetRawY(size_t pointer_index) const OVERRIDE;
59 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; 63 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
64 virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE;
65 virtual float GetOrientation(size_t pointer_index) const OVERRIDE;
60 virtual float GetPressure(size_t pointer_index) const OVERRIDE; 66 virtual float GetPressure(size_t pointer_index) const OVERRIDE;
61 virtual base::TimeTicks GetEventTime() const OVERRIDE; 67 virtual base::TimeTicks GetEventTime() const OVERRIDE;
62 virtual size_t GetHistorySize() const OVERRIDE; 68 virtual size_t GetHistorySize() const OVERRIDE;
63 virtual base::TimeTicks GetHistoricalEventTime( 69 virtual base::TimeTicks GetHistoricalEventTime(
64 size_t historical_index) const OVERRIDE; 70 size_t historical_index) const OVERRIDE;
65 virtual float GetHistoricalTouchMajor(size_t pointer_index, 71 virtual float GetHistoricalTouchMajor(size_t pointer_index,
66 size_t historical_index) const OVERRIDE; 72 size_t historical_index) const OVERRIDE;
73 virtual float GetHistoricalTouchMinor(size_t pointer_index,
74 size_t historical_index) const OVERRIDE;
75 virtual float GetHistoricalOrientation(size_t pointer_index,
76 size_t historical_index) const OVERRIDE;
67 virtual float GetHistoricalX(size_t pointer_index, 77 virtual float GetHistoricalX(size_t pointer_index,
68 size_t historical_index) const OVERRIDE; 78 size_t historical_index) const OVERRIDE;
69 virtual float GetHistoricalY(size_t pointer_index, 79 virtual float GetHistoricalY(size_t pointer_index,
70 size_t historical_index) const OVERRIDE; 80 size_t historical_index) const OVERRIDE;
71 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE; 81 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
72 virtual int GetButtonState() const OVERRIDE; 82 virtual int GetButtonState() const OVERRIDE;
73 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; 83 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
74 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; 84 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
75 85
76 // Additional Android MotionEvent methods. 86 // Additional Android MotionEvent methods.
77 float GetTouchMinor() const { return GetTouchMinor(0); }
78 float GetTouchMinor(size_t pointer_index) const;
79 float GetOrientation() const;
80 base::TimeTicks GetDownTime() const; 87 base::TimeTicks GetDownTime() const;
81 88
82 static bool RegisterMotionEventAndroid(JNIEnv* env); 89 static bool RegisterMotionEventAndroid(JNIEnv* env);
83 90
84 static base::android::ScopedJavaLocalRef<jobject> Obtain( 91 static base::android::ScopedJavaLocalRef<jobject> Obtain(
85 const MotionEventAndroid& event); 92 const MotionEventAndroid& event);
86 static base::android::ScopedJavaLocalRef<jobject> Obtain( 93 static base::android::ScopedJavaLocalRef<jobject> Obtain(
87 base::TimeTicks down_time, 94 base::TimeTicks down_time,
88 base::TimeTicks event_time, 95 base::TimeTicks event_time,
89 Action action, 96 Action action,
(...skipping 18 matching lines...) Expand all
108 base::android::ScopedJavaGlobalRef<jobject> event_; 115 base::android::ScopedJavaGlobalRef<jobject> event_;
109 116
110 base::TimeTicks cached_time_; 117 base::TimeTicks cached_time_;
111 Action cached_action_; 118 Action cached_action_;
112 size_t cached_pointer_count_; 119 size_t cached_pointer_count_;
113 size_t cached_history_size_; 120 size_t cached_history_size_;
114 int cached_action_index_; 121 int cached_action_index_;
115 gfx::PointF cached_positions_[MAX_POINTERS_TO_CACHE]; 122 gfx::PointF cached_positions_[MAX_POINTERS_TO_CACHE];
116 int cached_pointer_ids_[MAX_POINTERS_TO_CACHE]; 123 int cached_pointer_ids_[MAX_POINTERS_TO_CACHE];
117 float cached_touch_majors_[MAX_POINTERS_TO_CACHE]; 124 float cached_touch_majors_[MAX_POINTERS_TO_CACHE];
125 float cached_touch_minors_[MAX_POINTERS_TO_CACHE];
126 float cached_orientations_[MAX_POINTERS_TO_CACHE];
118 gfx::Vector2dF cached_raw_position_offset_; 127 gfx::Vector2dF cached_raw_position_offset_;
119 ToolType cached_tool_types_[MAX_POINTERS_TO_CACHE]; 128 ToolType cached_tool_types_[MAX_POINTERS_TO_CACHE];
120 int cached_button_state_; 129 int cached_button_state_;
121 130
122 // Used to convert pixel coordinates from the Java-backed MotionEvent to 131 // Used to convert pixel coordinates from the Java-backed MotionEvent to
123 // DIP coordinates cached/returned by the MotionEventAndroid. 132 // DIP coordinates cached/returned by the MotionEventAndroid.
124 const float pix_to_dip_; 133 const float pix_to_dip_;
125 134
126 // Whether |event_| should be recycled on destruction. This will only be true 135 // Whether |event_| should be recycled on destruction. This will only be true
127 // for those events generated via |Obtain(...)|. 136 // for those events generated via |Obtain(...)|.
128 bool should_recycle_; 137 bool should_recycle_;
129 }; 138 };
130 139
131 } // namespace content 140 } // namespace content
132 141
133 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ 142 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698