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

Commit f156b778 authored by Huihong Luo's avatar Huihong Luo
Browse files

Skip layers with protected contents from caching

DRM protected layers cause rendering issues with caching, and they can be safely excluded as caching is usually not really useful with DRM protected contents.
Bug: 190191280
Test: play a drm protected video with ExoPlayer

Change-Id: Ib3f592c4e3888e0aebdcce21d68893670d4f65d2
parent 57aa9a97
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 {