Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc379fbf authored by Tiger Huang's avatar Tiger Huang Committed by Automerger Merge Worker
Browse files

Merge "Exclude translation caused by surface insets from the matrix" into...

Merge "Exclude translation caused by surface insets from the matrix" into rvc-dev am: 126e6713 am: 3f94c62f am: 430f4f1a am: ef01714e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788480

Change-Id: I6e306d4a9fa8e573ff504a0008c73bef8ac703c2
parents bea90943 ef01714e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5181,17 +5181,18 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        float9[Matrix.MSKEW_Y] = mWinAnimator.mDtDx;
        float9[Matrix.MSKEW_X] = mWinAnimator.mDtDy;
        float9[Matrix.MSCALE_Y] = mWinAnimator.mDsDy;
        int x = mSurfacePosition.x;
        int y = mSurfacePosition.y;
        transformSurfaceInsetsPosition(mTmpPoint, mAttrs.surfaceInsets);
        int x = mSurfacePosition.x + mTmpPoint.x;
        int y = mSurfacePosition.y + mTmpPoint.y;

        // We might be on a display which has been re-parented to a view in another window, so here
        // computes the global location of our display.
        DisplayContent dc = getDisplayContent();
        while (dc != null && dc.getParentWindow() != null) {
            final WindowState displayParent = dc.getParentWindow();
            x += displayParent.mWindowFrames.mFrame.left - displayParent.mAttrs.surfaceInsets.left
            x += displayParent.mWindowFrames.mFrame.left
                    + (dc.getLocationInParentWindow().x * displayParent.mGlobalScale + 0.5f);
            y += displayParent.mWindowFrames.mFrame.top - displayParent.mAttrs.surfaceInsets.top
            y += displayParent.mWindowFrames.mFrame.top
                    + (dc.getLocationInParentWindow().y * displayParent.mGlobalScale + 0.5f);
            dc = displayParent.getDisplayContent();
        }
+1 −0
Original line number Diff line number Diff line
@@ -646,6 +646,7 @@ public class WindowStateTests extends WindowTestsBase {
        final WindowState win1 = createWindow(null, TYPE_APPLICATION, dc, "win1");
        win1.mHasSurface = true;
        win1.mSurfaceControl = mock(SurfaceControl.class);
        win1.mAttrs.surfaceInsets.set(1, 2, 3, 4);
        win1.getFrameLw().offsetTo(WINDOW_OFFSET, 0);
        win1.updateSurfacePosition(t);
        win1.getTransformationMatrix(values, matrix);