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

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

Merge "Skip SOLID_COLOR layers from SF Caching" into tm-dev

parents 28d5e739 7a8dc174
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,8 @@ public:

    bool hasProtectedLayers() const;

    bool hasSolidColorLayers() const;

private:
    CachedSet() = default;

+6 −0
Original line number Diff line number Diff line
@@ -248,6 +248,12 @@ public:
    bool isProtected() const {
        return getOutputLayer()->getLayerFE().getCompositionState()->hasProtectedContent;
    }

    bool hasSolidColorCompositionType() const {
        return getOutputLayer()->getLayerFE().getCompositionState()->compositionType ==
                aidl::android::hardware::graphics::composer3::Composition::SOLID_COLOR;
    }

    float getFps() const { return getOutputLayer()->getLayerFE().getCompositionState()->fps; }

    void dump(std::string& result) const;
+1 −0
Original line number Diff line number Diff line
@@ -377,6 +377,7 @@ void OutputLayer::writeStateToHWC(bool includeGeometry, bool skipLayer, uint32_t
    auto requestedCompositionType = outputIndependentState->compositionType;

    if (requestedCompositionType == Composition::SOLID_COLOR && state.overrideInfo.buffer) {
        // this should never happen, as SOLID_COLOR is skipped from caching, b/230073351
        requestedCompositionType = Composition::DEVICE;
    }

+6 −0
Original line number Diff line number Diff line
@@ -388,6 +388,12 @@ bool CachedSet::hasProtectedLayers() const {
                       [](const Layer& layer) { return layer.getState()->isProtected(); });
}

bool CachedSet::hasSolidColorLayers() const {
    return std::any_of(mLayers.cbegin(), mLayers.cend(), [](const Layer& layer) {
        return layer.getState()->hasSolidColorCompositionType();
    });
}

void CachedSet::dump(std::string& result) const {
    const auto now = std::chrono::steady_clock::now();

+7 −0
Original line number Diff line number Diff line
@@ -498,6 +498,13 @@ void Flattener::buildCachedSets(time_point now) {
        }
    }

    for (const CachedSet& layer : mLayers) {
        if (layer.hasSolidColorLayers()) {
            ATRACE_NAME("layer->hasSolidColorLayers()");
            return;
        }
    }

    std::vector<Run> runs = findCandidateRuns(now);

    std::optional<Run> bestRun = findBestRun(runs);