diff options
| author | Evan Rosky <erosky@google.com> | 2021-05-06 22:08:20 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-05-06 22:08:20 +0000 |
| commit | afb641756cd89701ac07a8cbbf8f3e0f3ed48c41 (patch) | |
| tree | 54ea8284660d35ce0f261905e1d90708d8fe0b8b /core/java/android/view/MotionEvent.java | |
| parent | 7043460f485966bf346ce0c0c7bfa7dae4fe080d (diff) | |
| parent | 1476d63b2b8d23061fcde97289f223399e8bef73 (diff) | |
Merge "Compat-rotate motion-events injected into dispatcher" into sc-dev
Diffstat (limited to 'core/java/android/view/MotionEvent.java')
| -rw-r--r-- | core/java/android/view/MotionEvent.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index 6801c27851a9..b054468aff7e 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -1567,6 +1567,8 @@ public final class MotionEvent extends InputEvent implements Parcelable { int axis, int pointerIndex, int historyPos); @FastNative private static native void nativeTransform(long nativePtr, Matrix matrix); + @FastNative + private static native void nativeApplyTransform(long nativePtr, Matrix matrix); // -------------- @CriticalNative ---------------------- @@ -3260,6 +3262,21 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** + * Transforms all of the points in the event directly instead of modifying the event's + * internal transform. + * + * @param matrix The transformation matrix to apply. + * @hide + */ + public void applyTransform(Matrix matrix) { + if (matrix == null) { + throw new IllegalArgumentException("matrix must not be null"); + } + + nativeApplyTransform(mNativePtr, matrix); + } + + /** * Add a new movement to the batch of movements in this event. The event's * current location, position and size is updated to the new values. * The current values in the event are added to a list of historical values. |
