SurfaceView: Synchronize all surface view changes with VRI draw
Re landing with the following changes: We initially cloned the SurfaceControl handle to avoid locking when accessing the SurfaceControl from the position listener callbacks running from RT workers. But this meant the last reference to the layer handle would only be released by GC. If SurfaceViews are created and destroyed rapidly, we would be at the mercy of GC to release buffers. Original change: There are three transaction queues that can submit SurfaceView changes. 1. Buffer updates via BBQ apply token 2. SCC apply token 3. ViewRootImpl BBQ apply token It makes sense for most SurfaceView changes to be synchronized with ViewRootImpl draws since the caller can optionally synchronize the change with main window content. This change eliminates the tmp transaction that is applied directly via the SCC apply token and instead applies them with the ViewRootImpl draw transaction. Also take the opportunity to scope down mSurfaceControlLock usage. Test: atest SurfaceViewSyncTest Test: go/wm-smoke Test: run mem tests via forrest Bug: b/217973491, b/221631942 Change-Id: Idba712d146e62d7346920dc4f060cba92d47fada
Loading
Please register or sign in to comment