SF: Start restructuring display creation
Create the compositionengine::Display first thing, outside of
DisplayDevice, and pass it in as part of creating the DisplayDevice,
rather than creating it internal to DisplayDevice.
Also to start, move the logic to allocate a DisplayId for a HWC backed
virtual display into the CompositionEngine class.
This is a first step to moving the internal setup of the display to
CompositionEngine, and eventually eliminating DisplayDevice entirely, as
it is but a thin wrapper around the other class.
DisplayTransactionTest is adjusted so the dummy created DisplayDevices
have an appropriate compositionengine::Display.
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Bug: 142831417
Change-Id: I8417682f4ead7b550a8973d4716c627e31b07b6e
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 5f76260..7d86087 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -810,7 +810,8 @@
* Display management
*/
sp<DisplayDevice> setupNewDisplayDeviceInternal(
- const wp<IBinder>& displayToken, const std::optional<DisplayId>& displayId,
+ const wp<IBinder>& displayToken,
+ std::shared_ptr<compositionengine::Display> compositionDisplay,
const DisplayDeviceState& state,
const sp<compositionengine::DisplaySurface>& dispSurface,
const sp<IGraphicBufferProducer>& producer);