Move Joystick and Touchpad event transformation logic to MotionEvent

We would like to have all source and axis based transformations
calculated in the same place, which will be in the MotionEvent class.
This has the added benefit that MotionEvents created by developers
through MotionEvent.obtain() in Java will behave like motion events
generated from input devices in terms of how they're affected by
transformations.

Since axes from joysticks and touchpads should never be transfomred,
we previously solved this by using identity matrices for them in
InputDispatcher. Now, we move that logic to MotionEvent when applying
the transform.

Bug: 179274888
Test: atest libinput_test
Test: atest inputflinger_tests
Change-Id: Ic02466e01f2ba3131aca73bd10933ff81cb38cc9
diff --git a/include/input/Input.h b/include/input/Input.h
index 54c7114..7cc595a 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -801,8 +801,11 @@
 
     static std::string actionToString(int32_t action);
 
+    // MotionEvent will transform various axes in different ways, based on the source. For
+    // example, the x and y axes will not have any offsets/translations applied if it comes from a
+    // relative mouse device (since SOURCE_RELATIVE_MOUSE is a non-pointer source). These methods
+    // are used to apply these transformations for different axes.
     static vec2 calculateTransformedXY(uint32_t source, const ui::Transform&, const vec2& xy);
-
     static float calculateTransformedAxisValue(int32_t axis, uint32_t source, const ui::Transform&,
                                                const PointerCoords&);