Merge "Exclude translation caused by surface insets from the matrix" into rvc-dev am: 126e671343
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788480 Change-Id: Icb4d916b6fc6334852625b744158922b411946cb
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user