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

Commit dcdf9048 authored by Rachel Lee's avatar Rachel Lee Committed by Android (Google) Code Review
Browse files

Merge "SF: use CategoryDefault for layers w/ setFrameRate" into main

parents eb3ad209 0dd4bd48
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -327,7 +327,8 @@ LayerInfo::RefreshRateVotes LayerInfo::getRefreshRateVote(const RefreshRateSelec
            mLayerVote.type != LayerHistory::LayerVoteType::ExplicitDefault) {
            ATRACE_FORMAT_INSTANT("Vote %s", ftl::enum_string(mLayerVote.type).c_str());
            ALOGV("%s voted %d", mName.c_str(), static_cast<int>(mLayerVote.type));
            votes.push_back(mLayerVote);
            votes.push_back({mLayerVote.type, mLayerVote.fps, mLayerVote.seamlessness,
                             FrameRateCategory::Default, mLayerVote.categorySmoothSwitchOnly});
        }

        return votes;
+1 −1
Original line number Diff line number Diff line
@@ -646,7 +646,7 @@ TEST_F(LayerHistoryTest, oneLayerExplicitVoteWithCategory) {
    // Second LayerRequirement is the frame rate specification
    EXPECT_EQ(LayerHistory::LayerVoteType::ExplicitDefault, summarizeLayerHistory(time)[1].vote);
    EXPECT_EQ(73.4_Hz, summarizeLayerHistory(time)[1].desiredRefreshRate);
    EXPECT_EQ(FrameRateCategory::High, summarizeLayerHistory(time)[1].frameRateCategory);
    EXPECT_EQ(FrameRateCategory::Default, summarizeLayerHistory(time)[1].frameRateCategory);

    // layer became inactive, but the vote stays
    setDefaultLayerVote(layer.get(), LayerHistory::LayerVoteType::Heuristic);
+5 −2
Original line number Diff line number Diff line
@@ -213,7 +213,8 @@ TEST_F(LayerInfoTest, getRefreshRateVote_explicitVote) {
TEST_F(LayerInfoTest, getRefreshRateVote_explicitVoteWithCategory) {
    LayerInfo::LayerVote vote = {.type = LayerHistory::LayerVoteType::ExplicitDefault,
                                 .fps = 20_Hz,
                                 .category = FrameRateCategory::High};
                                 .category = FrameRateCategory::High,
                                 .categorySmoothSwitchOnly = true};
    layerInfo.setLayerVote(vote);

    auto actualVotes =
@@ -221,10 +222,12 @@ TEST_F(LayerInfoTest, getRefreshRateVote_explicitVoteWithCategory) {
    ASSERT_EQ(actualVotes.size(), 2u);
    ASSERT_EQ(actualVotes[0].type, LayerHistory::LayerVoteType::ExplicitCategory);
    ASSERT_EQ(actualVotes[0].category, vote.category);
    ASSERT_TRUE(actualVotes[0].categorySmoothSwitchOnly);
    ASSERT_EQ(actualVotes[1].type, vote.type);
    ASSERT_EQ(actualVotes[1].fps, vote.fps);
    ASSERT_EQ(actualVotes[1].seamlessness, vote.seamlessness);
    ASSERT_EQ(actualVotes[1].category, vote.category);
    ASSERT_EQ(actualVotes[1].category, FrameRateCategory::Default);
    ASSERT_TRUE(actualVotes[1].categorySmoothSwitchOnly);
}

TEST_F(LayerInfoTest, getRefreshRateVote_explicitCategory) {