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

Commit 32cab9f9 authored by Huihong Luo's avatar Huihong Luo Committed by Android (Google) Code Review
Browse files

Merge "Skip layers with protected contents from caching" into sc-dev

parents c99c8905 f156b778
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -135,6 +135,8 @@ public:

    bool hasHdrLayers() const;

    bool hasProtectedLayers() const;

private:
    CachedSet() = default;

+4 −0
Original line number Diff line number Diff line
@@ -249,6 +249,10 @@ public:
                transfer == ui::Dataspace::TRANSFER_HLG);
    }

    bool isProtected() const {
        return getOutputLayer()->getLayerFE().getCompositionState()->hasProtectedContent;
    }

    void dump(std::string& result) const;
    std::optional<std::string> compare(const LayerState& other) const;

+5 −0
Original line number Diff line number Diff line
@@ -350,6 +350,11 @@ bool CachedSet::hasHdrLayers() const {
                       [](const Layer& layer) { return layer.getState()->isHdr(); });
}

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

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

+1 −1
Original line number Diff line number Diff line
@@ -373,7 +373,7 @@ std::vector<Flattener::Run> Flattener::findCandidateRuns(time_point now) const {
        const bool layerIsInactive = now - currentSet->getLastUpdate() > kActiveLayerTimeout;
        const bool layerHasBlur = currentSet->hasBlurBehind();
        if (layerIsInactive && (firstLayer || runHasFirstLayer || !layerHasBlur) &&
            !currentSet->hasHdrLayers()) {
            !currentSet->hasHdrLayers() && !currentSet->hasProtectedLayers()) {
            if (isPartOfRun) {
                builder.append(currentSet->getLayerCount());
            } else {