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

Commit 25462be7 authored by Sally Qi's avatar Sally Qi Committed by Automerger Merge Worker
Browse files

Merge "Temp fix for overdimming issue in silkFX." into udc-dev am: 314a5746

parents b4909354 314a5746
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -247,6 +247,10 @@ public:


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


    float getHdrSdrRatio() const {
        return getOutputLayer()->getLayerFE().getCompositionState()->currentSdrHdrRatio;
    };

    wp<GraphicBuffer> getBuffer() const { return mBuffer.get(); }
    wp<GraphicBuffer> getBuffer() const { return mBuffer.get(); }


    bool isProtected() const { return mIsProtected.get(); }
    bool isProtected() const { return mIsProtected.get(); }
+4 −0
Original line number Original line Diff line number Diff line
@@ -378,6 +378,10 @@ bool CachedSet::hasUnsupportedDataspace() const {
            // to avoid flickering/color differences.
            // to avoid flickering/color differences.
            return true;
            return true;
        }
        }
        // TODO(b/274804887): temp fix of overdimming issue, skip caching if hsdr/sdr ratio > 1.01f
        if (layer.getState()->getHdrSdrRatio() > 1.01f) {
            return true;
        }
        return false;
        return false;
    });
    });
}
}
+20 −0
Original line number Original line Diff line number Diff line
@@ -662,6 +662,26 @@ TEST_F(CachedSetTest, holePunch_requiresNonBT601_625) {
    EXPECT_FALSE(cachedSet.requiresHolePunch());
    EXPECT_FALSE(cachedSet.requiresHolePunch());
}
}


TEST_F(CachedSetTest, holePunch_requiresNonHdrWithExtendedBrightness) {
    const auto dataspace = static_cast<ui::Dataspace>(ui::Dataspace::STANDARD_DCI_P3 |
                                                      ui::Dataspace::TRANSFER_SRGB |
                                                      ui::Dataspace::RANGE_EXTENDED);
    mTestLayers[0]->outputLayerCompositionState.dataspace = dataspace;
    mTestLayers[0]->layerFECompositionState.currentSdrHdrRatio = 5.f;
    mTestLayers[0]->layerState->update(&mTestLayers[0]->outputLayer);

    CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get();
    auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState;
    layerFECompositionState.buffer = sp<GraphicBuffer>::make();
    layerFECompositionState.blendMode = hal::BlendMode::NONE;
    sp<mock::LayerFE> layerFE = mTestLayers[0]->layerFE;

    CachedSet cachedSet(layer);
    EXPECT_CALL(*layerFE, hasRoundedCorners()).WillRepeatedly(Return(true));

    EXPECT_FALSE(cachedSet.requiresHolePunch());
}

TEST_F(CachedSetTest, holePunch_requiresNoBlending) {
TEST_F(CachedSetTest, holePunch_requiresNoBlending) {
    CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get();
    CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get();
    auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState;
    auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState;