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

Commit 6bb1f9ae authored by Leon Scroggins's avatar Leon Scroggins Committed by Automerger Merge Worker
Browse files

Merge "HolePunchPIP: Do not use hole punch for HDR videos" into sc-dev am: de5764d1

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

Change-Id: Ia02ccfe7fdef225e3c017afdc92b4d9f5ee847b9
parents fa480e99 de5764d1
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -294,6 +294,12 @@ bool CachedSet::requiresHolePunch() const {
        return false;
    }

    // Do not use a hole punch with an HDR layer; this should be done in client
    // composition to properly mix HDR with SDR.
    if (hasHdrLayers()) {
        return false;
    }

    const auto& layerFE = mLayers[0].getState()->getOutputLayer()->getLayerFE();
    if (layerFE.getCompositionState()->forceClientComposition) {
        return false;
+14 −0
Original line number Diff line number Diff line
@@ -429,6 +429,20 @@ TEST_F(CachedSetTest, holePunch_requiresSingleLayer) {
    EXPECT_FALSE(cachedSet.requiresHolePunch());
}

TEST_F(CachedSetTest, holePunch_requiresNonHdr) {
    mTestLayers[0]->outputLayerCompositionState.dataspace = ui::Dataspace::BT2020_PQ;
    mTestLayers[0]->layerState->update(&mTestLayers[0]->outputLayer);

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

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

    EXPECT_FALSE(cachedSet.requiresHolePunch());
}

TEST_F(CachedSetTest, requiresHolePunch) {
    CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get();
    mTestLayers[0]->layerFECompositionState.buffer = sp<GraphicBuffer>::make();