Plumb through display orientation separate from transform
This is exclusively used for getRaw compatibility. The input
transform can include window rotation and also, apparently,
nested view rotations as it the events get mutated by ui-toolkit.
Bug: 187686656
Test: cd frameworks/native/services/inputflinger && atest
Change-Id: I2fd7a2b2acbe422d962d0646d41c60eb48160620
diff --git a/libs/gui/include/gui/WindowInfo.h b/libs/gui/include/gui/WindowInfo.h
index 51ddc50..b0c631a 100644
--- a/libs/gui/include/gui/WindowInfo.h
+++ b/libs/gui/include/gui/WindowInfo.h
@@ -164,6 +164,9 @@
// Transform applied to individual windows.
ui::Transform transform;
+ // Display orientation. Used for compatibility raw coordinates.
+ uint32_t displayOrientation = ui::Transform::ROT_0;
+
// Display size in its natural rotation. Used to rotate raw coordinates for compatibility.
int32_t displayWidth = 0;
int32_t displayHeight = 0;
diff --git a/libs/gui/tests/WindowInfo_test.cpp b/libs/gui/tests/WindowInfo_test.cpp
index 09c02ca..58f3981 100644
--- a/libs/gui/tests/WindowInfo_test.cpp
+++ b/libs/gui/tests/WindowInfo_test.cpp
@@ -59,6 +59,7 @@
i.globalScaleFactor = 0.3;
i.alpha = 0.7;
i.transform.set({0.4, -1, 100, 0.5, 0, 40, 0, 0, 1});
+ i.displayOrientation = ui::Transform::ROT_0;
i.displayWidth = 1000;
i.displayHeight = 2000;
i.visible = false;