Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0825c22 authored by Su Hong Koo's avatar Su Hong Koo Committed by Android (Google) Code Review
Browse files

Merge "SF: Wire up mock enableLayerCachingTexturePool" into main

parents 8a9580c6 657953d8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -219,7 +219,14 @@ TEST_P(FoldableTest, disableVsyncOnPowerOffPacesetter) {
    ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), getOuterDisplayId());
}

TEST_F(FoldableTest, layerCachingTexturePoolOnFrontInternal) {
TEST_P(FoldableTest, layerCachingTexturePoolOnFrontInternal) {
    SET_FLAG_FOR_TEST(flags::pacesetter_selection, GetParam());

    ON_CALL(mFlinger.mockSchedulerCallback(), enableLayerCachingTexturePool)
            .WillByDefault([&](PhysicalDisplayId displayId, bool enable) {
                mFlinger.enableLayerCachingTexturePool(displayId, enable);
            });

    ASSERT_EQ(mFlinger.scheduler()->pacesetterDisplayId(), getInnerDisplayId());

    // In order for TexturePool to be enabled, layer caching needs to be enabled.
+4 −0
Original line number Diff line number Diff line
@@ -619,6 +619,10 @@ public:
        mFlinger->mNewLayers.emplace_back(std::move(layer));
    }

    void enableLayerCachingTexturePool(PhysicalDisplayId id, bool enable) {
        FTL_FAKE_GUARD(kMainThreadContext, mFlinger->enableLayerCachingTexturePool(id, enable));
    }

    /* ------------------------------------------------------------------------
     * Read-only access to private data to assert post-conditions.
     */