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

Commit 70d154a8 authored by Huihong Luo's avatar Huihong Luo Committed by Automerger Merge Worker
Browse files

Merge "Skip layers with protected contents from caching" into sc-dev am: 32cab9f9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14851449

Change-Id: Icf1ba6d8465e5dd873e389cfc0b9c3077469774d
parents 0af6c6fb 32cab9f9
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 {