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

Commit 10c6e46b authored by Huihong Luo's avatar Huihong Luo Committed by Automerger Merge Worker
Browse files

Merge "HDR video fix" into sc-dev am: 8330256d

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

Change-Id: Ic4279db1aad79d852f4e13777d8f953aef854595
parents 363574b6 8330256d
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 {