Merge "Fix incorrect magnification border after rotation" into sc-dev am: 9da336b4c1

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

Change-Id: Ifeb346220dbd930d840e21f1da6af976696c4c2b
This commit is contained in:
Ryan Lin
2021-06-17 02:02:11 +00:00
committed by Automerger Merge Worker

View File

@@ -735,7 +735,7 @@ final class AccessibilityController {
Slog.i(LOG_TAG, "Rotation: " + Surface.rotationToString(rotation) Slog.i(LOG_TAG, "Rotation: " + Surface.rotationToString(rotation)
+ " displayId: " + displayContent.getDisplayId()); + " displayId: " + displayContent.getDisplayId());
} }
mMagnifedViewport.onRotationChanged(displayContent.getPendingTransaction()); mMagnifedViewport.onRotationChanged();
mHandler.sendEmptyMessage(MyHandler.MESSAGE_NOTIFY_ROTATION_CHANGED); mHandler.sendEmptyMessage(MyHandler.MESSAGE_NOTIFY_ROTATION_CHANGED);
} }
@@ -894,7 +894,7 @@ final class AccessibilityController {
private final RectF mTempRectF = new RectF(); private final RectF mTempRectF = new RectF();
private final Point mTempPoint = new Point(); private final Point mScreenSize = new Point();
private final Matrix mTempMatrix = new Matrix(); private final Matrix mTempMatrix = new Matrix();
@@ -923,8 +923,8 @@ final class AccessibilityController {
if (mDisplayContext.getResources().getConfiguration().isScreenRound()) { if (mDisplayContext.getResources().getConfiguration().isScreenRound()) {
mCircularPath = new Path(); mCircularPath = new Path();
mDisplay.getRealSize(mTempPoint); mDisplay.getRealSize(mScreenSize);
final int centerXY = mTempPoint.x / 2; final int centerXY = mScreenSize.x / 2;
mCircularPath.addCircle(centerXY, centerXY, centerXY, Path.Direction.CW); mCircularPath.addCircle(centerXY, centerXY, centerXY, Path.Direction.CW);
} else { } else {
mCircularPath = null; mCircularPath = null;
@@ -953,9 +953,9 @@ final class AccessibilityController {
} }
void recomputeBounds() { void recomputeBounds() {
mDisplay.getRealSize(mTempPoint); mDisplay.getRealSize(mScreenSize);
final int screenWidth = mTempPoint.x; final int screenWidth = mScreenSize.x;
final int screenHeight = mTempPoint.y; final int screenHeight = mScreenSize.y;
mMagnificationRegion.set(0, 0, 0, 0); mMagnificationRegion.set(0, 0, 0, 0);
final Region availableBounds = mTempRegion1; final Region availableBounds = mTempRegion1;
@@ -1088,7 +1088,7 @@ final class AccessibilityController {
|| windowType == TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY; || windowType == TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY;
} }
void onRotationChanged(SurfaceControl.Transaction t) { void onRotationChanged() {
// If we are showing the magnification border, hide it immediately so // If we are showing the magnification border, hide it immediately so
// the user does not see strange artifacts during rotation. The screenshot // the user does not see strange artifacts during rotation. The screenshot
// used for rotation already has the border. After the rotation is complete // used for rotation already has the border. After the rotation is complete
@@ -1102,7 +1102,7 @@ final class AccessibilityController {
mHandler.sendMessageDelayed(message, delay); mHandler.sendMessageDelayed(message, delay);
} }
recomputeBounds(); recomputeBounds();
mWindow.updateSize(t); mWindow.updateSize();
} }
void setMagnifiedRegionBorderShown(boolean shown, boolean animate) { void setMagnifiedRegionBorderShown(boolean shown, boolean animate) {
@@ -1184,9 +1184,9 @@ final class AccessibilityController {
/* ignore */ /* ignore */
} }
mSurfaceControl = surfaceControl; mSurfaceControl = surfaceControl;
mDisplay.getRealSize(mTempPoint); mDisplay.getRealSize(mScreenSize);
mBlastBufferQueue = new BLASTBufferQueue(SURFACE_TITLE, mSurfaceControl, mBlastBufferQueue = new BLASTBufferQueue(SURFACE_TITLE, mSurfaceControl,
mTempPoint.x, mTempPoint.y, PixelFormat.RGBA_8888); mScreenSize.x, mScreenSize.y, PixelFormat.RGBA_8888);
final SurfaceControl.Transaction t = mService.mTransactionFactory.get(); final SurfaceControl.Transaction t = mService.mTransactionFactory.get();
final int layer = final int layer =
@@ -1260,10 +1260,11 @@ final class AccessibilityController {
} }
} }
void updateSize(SurfaceControl.Transaction t) { void updateSize() {
synchronized (mService.mGlobalLock) { synchronized (mService.mGlobalLock) {
mDisplay.getRealSize(mTempPoint); mDisplay.getRealSize(mScreenSize);
t.setBufferSize(mSurfaceControl, mTempPoint.x, mTempPoint.y); mBlastBufferQueue.update(mSurfaceControl, mScreenSize.x, mScreenSize.y,
PixelFormat.RGBA_8888);
invalidate(mDirtyRect); invalidate(mDirtyRect);
} }
} }
@@ -1332,8 +1333,8 @@ final class AccessibilityController {
pw.println(prefix pw.println(prefix
+ " mBounds= " + mBounds + " mBounds= " + mBounds
+ " mDirtyRect= " + mDirtyRect + " mDirtyRect= " + mDirtyRect
+ " mWidth= " + mSurfaceControl.getWidth() + " mWidth= " + mScreenSize.x
+ " mHeight= " + mSurfaceControl.getHeight()); + " mHeight= " + mScreenSize.y);
} }
private final class AnimationController extends Handler { private final class AnimationController extends Handler {