SF: Carve out LayerCreationArgs

Move most layer creation logic outside of Layer.

Specify layer sequence id via creation args
and move ownerUid/ownerPid into the layer
creation args so we can share logic between
the existing layer class and the new server
layer state.

Add layer parent and mirror from handles
to be used with the new LayerLifecycleManager.

Bug: 238781169
Test: presubmit

Change-Id: I7cf344181b29f405c070cda2ad45f06233fd1e8c
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index d512841..1d50830 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -65,6 +65,7 @@
 #include "DisplayIdGenerator.h"
 #include "Effects/Daltonizer.h"
 #include "FlagManager.h"
+#include "FrontEnd/LayerCreationArgs.h"
 #include "FrontEnd/TransactionHandler.h"
 #include "LayerVector.h"
 #include "Scheduler/RefreshRateConfigs.h"
@@ -755,8 +756,7 @@
     /*
      * Layer management
      */
-    status_t createLayer(LayerCreationArgs& args, const sp<IBinder>& parentHandle,
-                         gui::CreateSurfaceResult& outResult);
+    status_t createLayer(LayerCreationArgs& args, gui::CreateSurfaceResult& outResult);
 
     status_t createBufferStateLayer(LayerCreationArgs& args, sp<IBinder>* outHandle,
                                     sp<Layer>* outLayer);
@@ -777,8 +777,8 @@
     void markLayerPendingRemovalLocked(const sp<Layer>& layer);
 
     // add a layer to SurfaceFlinger
-    status_t addClientLayer(const sp<Client>& client, const sp<IBinder>& handle,
-                            const sp<Layer>& lbc, const wp<Layer>& parentLayer, bool addToRoot,
+    status_t addClientLayer(const LayerCreationArgs& args, const sp<IBinder>& handle,
+                            const sp<Layer>& layer, const wp<Layer>& parentLayer,
                             uint32_t* outTransformHint);
 
     // Traverse through all the layers and compute and cache its bounds.