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

Commit 4fb58377 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "[sf-newfe] Set correct composition type for refresh rate layer" into main

parents c9a675e7 bd51f95d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -491,6 +491,9 @@ aidl::android::hardware::graphics::composer3::Composition RequestedLayerState::g
    if (flags & layer_state_t::eLayerIsDisplayDecoration) {
        return Composition::DISPLAY_DECORATION;
    }
    if (flags & layer_state_t::eLayerIsRefreshRateIndicator) {
        return Composition::REFRESH_RATE_INDICATOR;
    }
    if (potentialCursor) {
        return Composition::CURSOR;
    }
+13 −0
Original line number Diff line number Diff line
@@ -770,4 +770,17 @@ TEST_F(LayerSnapshotTest, skipRoundCornersWhenProtected) {
    EXPECT_EQ(getSnapshot({.id = 1})->roundedCorner.radius.x, 42.f);
}

TEST_F(LayerSnapshotTest, setRefreshRateIndicatorCompositionType) {
    setFlags(1, layer_state_t::eLayerIsRefreshRateIndicator,
             layer_state_t::eLayerIsRefreshRateIndicator);
    setBuffer(1,
              std::make_shared<renderengine::mock::FakeExternalTexture>(1U /*width*/, 1U /*height*/,
                                                                        42ULL /* bufferId */,
                                                                        HAL_PIXEL_FORMAT_RGBA_8888,
                                                                        0 /*usage*/));
    UPDATE_AND_VERIFY(mSnapshotBuilder, STARTING_ZORDER);
    EXPECT_EQ(getSnapshot({.id = 1})->compositionType,
              aidl::android::hardware::graphics::composer3::Composition::REFRESH_RATE_INDICATOR);
}

} // namespace android::surfaceflinger::frontend