Loading services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h +4 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,10 @@ public: ui::Dataspace getDataspace() const { return mOutputDataspace.get(); } float getHdrSdrRatio() const { return getOutputLayer()->getLayerFE().getCompositionState()->currentSdrHdrRatio; }; wp<GraphicBuffer> getBuffer() const { return mBuffer.get(); } bool isProtected() const { return mIsProtected.get(); } Loading services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ bool CachedSet::hasUnsupportedDataspace() const { // to avoid flickering/color differences. 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; }); } Loading services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -662,6 +662,26 @@ TEST_F(CachedSetTest, holePunch_requiresNonBT601_625) { 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) { CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get(); auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState; Loading Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h +4 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,10 @@ public: ui::Dataspace getDataspace() const { return mOutputDataspace.get(); } float getHdrSdrRatio() const { return getOutputLayer()->getLayerFE().getCompositionState()->currentSdrHdrRatio; }; wp<GraphicBuffer> getBuffer() const { return mBuffer.get(); } bool isProtected() const { return mIsProtected.get(); } Loading
services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -378,6 +378,10 @@ bool CachedSet::hasUnsupportedDataspace() const { // to avoid flickering/color differences. 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; }); } Loading
services/surfaceflinger/CompositionEngine/tests/planner/CachedSetTest.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -662,6 +662,26 @@ TEST_F(CachedSetTest, holePunch_requiresNonBT601_625) { 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) { CachedSet::Layer& layer = *mTestLayers[0]->cachedSetLayer.get(); auto& layerFECompositionState = mTestLayers[0]->layerFECompositionState; Loading