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

Commit 3f94c62f 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 rvc-dev am: 126e6713

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

Change-Id: Icb4d916b6fc6334852625b744158922b411946cb
parents 437b7d74 126e6713
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -5158,17 +5158,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);