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

Commit 5c6adeaf authored by Huihong Luo's avatar Huihong Luo
Browse files

HDR video fix

Ignore caching if HDR layer is detected, this should not be a big issue,
however, the real fix is to figure out the color mismatch. A new bug is filed to track this.

Bug: 187319372
Test: play a HDR video in YouTube, then swipe to PIP mode, and tap Pause button
Change-Id: I18f8706d03e7677c5aac54b34ff2477ae1b33f8a
parent 64812298
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ public:

    compositionengine::OutputLayer* getBlurLayer() const;

    bool hasHdrLayers() const;

private:
    CachedSet() = default;

+9 −0
Original line number Diff line number Diff line
@@ -240,6 +240,15 @@ public:
    void resetFramesSinceBufferUpdate() { mFramesSinceBufferUpdate = 0; }
    int64_t getFramesSinceBufferUpdate() const { return mFramesSinceBufferUpdate; }

    ui::Dataspace getDataspace() const { return mOutputDataspace.get(); }

    bool isHdr() const {
        const ui::Dataspace transfer =
                static_cast<ui::Dataspace>(getDataspace() & ui::Dataspace::TRANSFER_MASK);
        return (transfer == ui::Dataspace::TRANSFER_ST2084 ||
                transfer == ui::Dataspace::TRANSFER_HLG);
    }

    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
@@ -346,6 +346,11 @@ compositionengine::OutputLayer* CachedSet::getBlurLayer() const {
    return mBlurLayer ? mBlurLayer->getOutputLayer() : nullptr;
}

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

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

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