From 33fcefefaeea7bb11177fcc34170220e16ca3252 Mon Sep 17 00:00:00 2001 From: mincheli Date: Tue, 24 Mar 2020 19:04:29 +0800 Subject: [PATCH] Correct the dirty region of magnifification bounds The window type of window magnification is non-magnified. When window magnification and fullscreen magnification are both enabled during the test, we can find that the bounds of non-magnified area have afterimage remained on the screen. When drawing magnification bounds, Accessibility controller would clean the dirty region of the canvas first then draw new magnification bounds on the canvas. While the dirty region is always the current rectangle of magnified region that not includes the one of the previous frame. So the part of the previous frame would not be fully cleared. Hence the afterimage would happen. To fix it, we also have to correct the dirty region by the XOR of magnified region and the old magnified region. Bug: 152264396 Test: manual test Change-Id: I19c796bdcf9eb80df8c05a83ed7a79e7981e77b1 Merged-In: I19c796bdcf9eb80df8c05a83ed7a79e7981e77b1 --- .../java/com/android/server/wm/AccessibilityController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index 4fe58433ddb67..3f9f95cf83702 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -726,8 +726,7 @@ final class AccessibilityController { } else { final Region dirtyRegion = mTempRegion3; dirtyRegion.set(mMagnificationRegion); - dirtyRegion.op(mOldMagnificationRegion, Region.Op.UNION); - dirtyRegion.op(nonMagnifiedBounds, Region.Op.INTERSECT); + dirtyRegion.op(mOldMagnificationRegion, Region.Op.XOR); dirtyRegion.getBounds(dirtyRect); mWindow.invalidate(dirtyRect); }