Loading services/surfaceflinger/tests/unittests/CompositionTest.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -284,12 +284,15 @@ struct BaseDisplayVariant { constexpr auto kDisplayConnectionType = ui::DisplayConnectionType::Internal; constexpr bool kIsPrimary = true; test->mDisplay = FakeDisplayDeviceInjector(test->mFlinger, compositionDisplay, test->mDisplay = FakeDisplayDeviceInjector(test->mFlinger, compositionDisplay, kDisplayConnectionType, HWC_DISPLAY, kIsPrimary) .setDisplaySurface(test->mDisplaySurface) .setNativeWindow(test->mNativeWindow) .setSecure(Derived::IS_SECURE) .setPowerMode(Derived::INIT_POWER_MODE) .setRefreshRateSelector(test->mFlinger.scheduler()->refreshRateSelector()) .skipRegisterDisplay() .inject(); Mock::VerifyAndClear(test->mNativeWindow.get()); Loading services/surfaceflinger/tests/unittests/SurfaceFlinger_PowerHintTest.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ void SurfaceFlingerPowerHintTest::SetUp() { .setDisplaySurface(mDisplaySurface) .setNativeWindow(mNativeWindow) .setPowerMode(hal::PowerMode::ON) .setRefreshRateSelector(mFlinger.scheduler()->refreshRateSelector()) .skipRegisterDisplay() .inject(); } Loading services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h +7 −1 Original line number Diff line number Diff line Loading @@ -855,6 +855,11 @@ public: return *this; } auto& skipRegisterDisplay() { mRegisterDisplay = false; return *this; } sp<DisplayDevice> inject() NO_THREAD_SAFETY_ANALYSIS { const auto displayId = mCreationArgs.compositionDisplay->getDisplayId(); Loading Loading @@ -918,7 +923,7 @@ public: ui::ColorModes(), std::nullopt); if (mFlinger.scheduler()) { if (mFlinger.scheduler() && mRegisterDisplay) { mFlinger.scheduler()->registerDisplay(physicalId, display->holdRefreshRateSelector()); } Loading @@ -937,6 +942,7 @@ public: sp<BBinder> mDisplayToken = sp<BBinder>::make(); DisplayDeviceCreationArgs mCreationArgs; DisplayModes mDisplayModes; bool mRegisterDisplay = true; const std::optional<ui::DisplayConnectionType> mConnectionType; const std::optional<hal::HWDisplayId> mHwcDisplayId; }; Loading Loading
services/surfaceflinger/tests/unittests/CompositionTest.cpp +10 −7 Original line number Diff line number Diff line Loading @@ -284,12 +284,15 @@ struct BaseDisplayVariant { constexpr auto kDisplayConnectionType = ui::DisplayConnectionType::Internal; constexpr bool kIsPrimary = true; test->mDisplay = FakeDisplayDeviceInjector(test->mFlinger, compositionDisplay, test->mDisplay = FakeDisplayDeviceInjector(test->mFlinger, compositionDisplay, kDisplayConnectionType, HWC_DISPLAY, kIsPrimary) .setDisplaySurface(test->mDisplaySurface) .setNativeWindow(test->mNativeWindow) .setSecure(Derived::IS_SECURE) .setPowerMode(Derived::INIT_POWER_MODE) .setRefreshRateSelector(test->mFlinger.scheduler()->refreshRateSelector()) .skipRegisterDisplay() .inject(); Mock::VerifyAndClear(test->mNativeWindow.get()); Loading
services/surfaceflinger/tests/unittests/SurfaceFlinger_PowerHintTest.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ void SurfaceFlingerPowerHintTest::SetUp() { .setDisplaySurface(mDisplaySurface) .setNativeWindow(mNativeWindow) .setPowerMode(hal::PowerMode::ON) .setRefreshRateSelector(mFlinger.scheduler()->refreshRateSelector()) .skipRegisterDisplay() .inject(); } Loading
services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h +7 −1 Original line number Diff line number Diff line Loading @@ -855,6 +855,11 @@ public: return *this; } auto& skipRegisterDisplay() { mRegisterDisplay = false; return *this; } sp<DisplayDevice> inject() NO_THREAD_SAFETY_ANALYSIS { const auto displayId = mCreationArgs.compositionDisplay->getDisplayId(); Loading Loading @@ -918,7 +923,7 @@ public: ui::ColorModes(), std::nullopt); if (mFlinger.scheduler()) { if (mFlinger.scheduler() && mRegisterDisplay) { mFlinger.scheduler()->registerDisplay(physicalId, display->holdRefreshRateSelector()); } Loading @@ -937,6 +942,7 @@ public: sp<BBinder> mDisplayToken = sp<BBinder>::make(); DisplayDeviceCreationArgs mCreationArgs; DisplayModes mDisplayModes; bool mRegisterDisplay = true; const std::optional<ui::DisplayConnectionType> mConnectionType; const std::optional<hal::HWDisplayId> mHwcDisplayId; }; Loading