Optimize magnifier viewport drawing
1. Reduce the number of drawIfNeeded calls in fullscreen mode by 99%. Because updateMagnificationSpec -> setMagnifiedRegionBorderShown will be called with motion events when changing zoom. Then even if the border region is not changed, it still always forces redraw. So simply skip if the border shown state is not changed. 2. Only apply surface transaction if related attributes are changed. 3. drawIfNeeded was always called inside WM lock, so the change [1] didn't work. With this change, drawIfNeeded is still called on the same animation thread but it is executed from message directly, then the change [1] can take effect that avoids holding WM lock when calling lockCanvas. [1]: Id828744c8c5bcb4bdb3be9a11810338614b84b2e Bug: 276845499 Fix: 316075123 Test: atest AccessibilityMagnificationTest Change-Id: Ibbb9f86112bf734cd0d2cd27f39aabcd13e003cc
Loading
Please register or sign in to comment