From cae605cd5668f8107e340ad8a672c7f034147401 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 29 Mar 2017 12:10:31 -0700 Subject: Fix seamless rotation with SurfaceView WM bypass. First a brief review on seamless rotation. In seamless rotation the WM will do the following atomically: 1. Update the display transform. 2. Set window transforms to make the surfaces at their old size appear at the correct location in the new coordinate space. 3. Set a flag to undo the transforms when the surfaces resize. However, windows with NATIVE_WINDOW_TRANSFORM_DISPLAY needed to be special cased. The flag will perform step 2 in terms of buffer mapping, but not in terms of bounds computation. So to compensate the WM would apply the transform to the bounds, set these bounds, and then skip applying the transform matrix (as the buffer is transformed by the flag). Now that the WM can't see the Camera view, it can't implement this special logic and the Camera view inherits the parent transform. We compensate for this in SurfaceFlinger by omitting parent rotation transform components for Surfaces with NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY. To some extent this breaks arbitrary rotation for surfaces with NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY but this is essentially ok: 1. We lived with that bug until N-MR1 2. We fixed it in N-MR1 because the camera was falling back to ROTATE a lot which shouldn't be happening anymore, following introduction of specifying rotation animation in manifest. Test: Rotate camera, disable HWC, rotate camera some more. Switch to front camera, repeat. Bug: 36230754 Bug: 36727915 Change-Id: Ied390c9cb3968fcce32a84ee7947f699746fdc81 --- libs/gui/SurfaceControl.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'libs/gui/SurfaceControl.cpp') diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index 1e693796eb..7a68f1174a 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -209,13 +209,6 @@ status_t SurfaceControl::getLayerFrameStats(FrameStats* outStats) const { return client->getLayerFrameStats(mHandle, outStats); } -status_t SurfaceControl::getTransformToDisplayInverse(bool* outTransformToDisplayInverse) const { - status_t err = validate(); - if (err < 0) return err; - const sp& client(mClient); - return client->getTransformToDisplayInverse(mHandle, outTransformToDisplayInverse); -} - status_t SurfaceControl::validate() const { if (mHandle==0 || mClient==0) { -- cgit v1.2.3-59-g8ed1b