TouchInputMapper: Use ui::Transform to calculate orientation angles
Rather than manually re-orienting the calculated angles for orientation
and tilt, we use the transform to compute the oriented values for these
non-planar axes. This approach is both less error-prone and less verbose.
In this CL, we also transform the coverage rect from raw to display
space using the computed transform.
Bug: 236798672
Test: atest inputflinger_tests
Change-Id: Ibfb6d2ab43e6fd7a63736ee7d9610c42be44affd
diff --git a/include/input/Input.h b/include/input/Input.h
index 015efdd..1a35196 100644
--- a/include/input/Input.h
+++ b/include/input/Input.h
@@ -203,6 +203,13 @@
*/
vec2 transformWithoutTranslation(const ui::Transform& transform, const vec2& xy);
+/*
+ * Transform an angle on the x-y plane. An angle of 0 radians corresponds to "north" or
+ * pointing upwards in the negative Y direction, a positive angle points towards the right, and a
+ * negative angle points towards the left.
+ */
+float transformAngle(const ui::Transform& transform, float angleRadians);
+
const char* inputEventTypeToString(int32_t type);
std::string inputEventSourceToString(int32_t source);