SF: Refactor display device creation
Move display device creation to its own function which handles all
initialization before creating a DisplayDevice instance, which now just
simply constructs an instance from the passed values.
Also introduces a factory to abstract creating libgui Surface instances,
so that can be replaced by the test.
Test: Builds
Bug: 74827900
Change-Id: Ia80c865dc96b300033c506cc3093e563bcab787b
(cherry picked from commit 99d3da56143c24c99ba73b830c9e16a6f9814770)
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index 737971f..fbb0d46 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -77,9 +77,14 @@
int32_t hwcId,
bool isSecure,
const wp<IBinder>& displayToken,
+ const sp<ANativeWindow>& nativeWindow,
const sp<DisplaySurface>& displaySurface,
- const sp<IGraphicBufferProducer>& producer,
- bool supportWideColor, bool supportHdr);
+ std::unique_ptr<RE::Surface> renderSurface,
+ int displayWidth,
+ int displayHeight,
+ bool supportWideColor,
+ bool supportHdr,
+ int initialPowerMode);
// clang-format on
~DisplayDevice();