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

Commit 6d590fe0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Omit DISPLAY_DECORATION layers from CachedSets"" into tm-dev

parents 1c94d263 0096933b
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -401,19 +401,6 @@ bool Flattener::mergeWithCachedSets(const std::vector<const LayerState*>& layers
    return true;
}

namespace {
bool isDisplayDecoration(const CachedSet& cachedSet) {
    return cachedSet.getLayerCount() == 1 &&
            cachedSet.getFirstLayer()
                    .getState()
                    ->getOutputLayer()
                    ->getLayerFE()
                    .getCompositionState()
                    ->compositionType ==
            aidl::android::hardware::graphics::composer3::Composition::DISPLAY_DECORATION;
}
} // namespace

std::vector<Flattener::Run> Flattener::findCandidateRuns(time_point now) const {
    ATRACE_CALL();
    std::vector<Run> runs;
@@ -437,7 +424,7 @@ std::vector<Flattener::Run> Flattener::findCandidateRuns(time_point now) const {
        }

        if (layerIsInactive && (firstLayer || runHasFirstLayer || !layerHasBlur) &&
            !currentSet->hasUnsupportedDataspace() && !isDisplayDecoration(*currentSet)) {
            !currentSet->hasUnsupportedDataspace()) {
            if (isPartOfRun) {
                builder.increment();
            } else {
+3 −3
Original line number Diff line number Diff line
@@ -1340,14 +1340,14 @@ TEST_F(FlattenerTest, flattenLayers_skipsColorLayers) {
    EXPECT_NE(nullptr, overrideBuffer4);
}

TEST_F(FlattenerTest, flattenLayers_skips_DISPLAY_DECORATION) {
TEST_F(FlattenerTest, flattenLayers_includes_DISPLAY_DECORATION) {
    auto& layerState1 = mTestLayers[0]->layerState;
    const auto& overrideBuffer1 = layerState1->getOutputLayer()->getState().overrideInfo.buffer;

    auto& layerState2 = mTestLayers[1]->layerState;
    const auto& overrideBuffer2 = layerState2->getOutputLayer()->getState().overrideInfo.buffer;

    // The third layer uses DISPLAY_DECORATION, which should never be cached.
    // The third layer uses DISPLAY_DECORATION, which should be cached.
    auto& layerState3 = mTestLayers[2]->layerState;
    const auto& overrideBuffer3 = layerState3->getOutputLayer()->getState().overrideInfo.buffer;
    mTestLayers[2]->layerFECompositionState.compositionType =
@@ -1388,7 +1388,7 @@ TEST_F(FlattenerTest, flattenLayers_skips_DISPLAY_DECORATION) {

    EXPECT_NE(nullptr, overrideBuffer1);
    EXPECT_EQ(overrideBuffer1, overrideBuffer2);
    EXPECT_EQ(nullptr, overrideBuffer3);
    EXPECT_EQ(overrideBuffer1, overrideBuffer3);
}

} // namespace