[Mirror Layers] Added functions to update mirrored layers info (2/4)

Added updateMirrorInfo and updateBufferInfoFromClone to ensure the state
and buffer of the clones are updated properly. updateMirrorInfo is
called when commitTransaction is called to update the drawing state,
children, and relatives. updateBufferInfoFromClone is called in
handlePageFlip after the real layer calls latchBuffer to ensure the
cloned layer gets the updated buffer and buffer info.

Test: No mirror request yet so everything runs normally
Bug: 131622422
Change-Id: Ic2b1f66cab98175dbdccf90f2f8310c7f19d8cff
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 8699747..86e73c2 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2600,6 +2600,7 @@
     });
 
     commitOffscreenLayers();
+    mDrawingState.traverseInZOrder([&](Layer* layer) { layer->updateMirrorInfo(); });
 }
 
 void SurfaceFlinger::withTracingLock(std::function<void()> lockedOperation) {
@@ -2718,6 +2719,8 @@
         mBootStage = BootStage::BOOTANIMATION;
     }
 
+    mDrawingState.traverseInZOrder([&](Layer* layer) { layer->updateCloneBufferInfo(); });
+
     // Only continue with the refresh if there is actually new work to do
     return !mLayersWithQueuedFrames.empty() && newDataLatched;
 }