Fix missing position updates to blur regions
The PositionUpdateListener sometimes gets called after the FrameDrawingCallback, because there is no ordering guarantee between these two callbacks. This causes the BlurRegions sent to SF to not have up-to-date positions. For example, an empty Rect gets sent as the blur region bounds, because the position update hasn't arrived when the surface transaction is sent. When the position update arrives it set the correct bounds, but it requires another draw to happen so that the correct position is picked up. This CL fixes this issue by saving the blur regions that were last sent to SF in FrameDrawingCallback and sending another transaction when the position update arrives. That transaction is merged into the previous one for the same frame, so the final transaction sent to SF has correct values. The CL also moves the FrameDrawingCallback registering logic entirely in the BlurAggregator in the first onPreDraw. This cleans up VRI Bug: 197239228 Test: atest --iterations 100 BlurTest#testBackgroundblurSimple Test: atest BlurAggregatorTest Change-Id: Ia122df40fdf2aa124299461c2e2597b61fa92699
Loading
Please register or sign in to comment