Use destroy in transaction for animation
Previously, the code calls destroy which will be invoked immediately so there needed to be ways to delay destroy. This caused some overhead where there needed to be Runnables to ensure client state updates were called before the destroy. Instead, use the Transaction.destroy so the destroy doesn't get invoked until apply is called. This allows any other client states to get updated before the destroy is called. This is specifically necessary for reparent calls since a Surface can be reparented from a Surface that's about to get destroyed to a valid Surface that's not getting destroyed. This change ensures that Surfaces will get reparented before Surfaces are destroyed when Transactions are applied. Original CL: ag/35732887 Reason for revert: Original issue is fixed in ag/3647191. Fixes: 72953020 Test: SurfaceAnimatorTest Change-Id: I8bc58e0efc2ae1558c122a40eb52e9c874c0c997
Loading
Please register or sign in to comment