OSDN Git Service

WM: Fix seamless rotation
authorAdrian Roos <roosa@google.com>
Thu, 7 Jun 2018 13:29:34 +0000 (15:29 +0200)
committerAdrian Roos <roosa@google.com>
Fri, 15 Jun 2018 23:35:03 +0000 (23:35 +0000)
commit0e7b70a3d54844487281913a6061ad198f0a29dc
tree4aca1a7462a52001c99396441f3c2ac38d11c2bc
parent9d4a5b5b18108ccb7b5bcffd0fb4889d20a69866
WM: Fix seamless rotation

With the introduction of the surface hierarchy, the seamless rotation
behavior in WSA is no longer correct: it also applies the WindowState's
offset, which leads to that being applied twice.

Instead of doing that, we simply rotate the WSA surface within the place
that WindowState dictates now.

Finally, the location of the WindowState itself also needs to be
transformed into the new orientation.

Fixes: 109927566
Test: atest CoordinateTransformsTest
Test: atest 'WindowStateTests#testSeamlesslyRotateWindow'
Change-Id: I9fb27a0a8a2bddc6ec88a4fcce6d6ea00929fb91
(cherry picked from commit 41f7e9d10306603c7a4410938e77418f13f6e939)
services/core/java/com/android/server/wm/DisplayContent.java
services/core/java/com/android/server/wm/WindowContainer.java
services/core/java/com/android/server/wm/WindowState.java
services/core/java/com/android/server/wm/WindowStateAnimator.java
services/core/java/com/android/server/wm/utils/CoordinateTransforms.java
services/tests/servicestests/src/com/android/server/wm/WindowStateTests.java
services/tests/servicestests/src/com/android/server/wm/utils/CoordinateTransformsTest.java