Loading services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,13 @@ void OutputLayer::updateCompositionState(bool includeGeometry) { const auto& profile = *mOutput.getDisplayColorProfile(); if (includeGeometry) { // Clear the forceClientComposition flag before it is set for any // reason. Note that since it can be set by some checks below when // updating the geometry state, we only clear it when updating the // geometry since those conditions for forcing client composition won't // go away otherwise. mState.forceClientComposition = false; mState.displayFrame = calculateOutputDisplayFrame(); mState.sourceCrop = calculateOutputSourceCrop(); mState.bufferTransform = Loading services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,7 @@ public: TEST_F(OutputLayerUpdateCompositionStateTest, setsStateNormally) { mLayerFEState.isSecure = true; mOutputState.isSecure = true; mOutputLayer.editState().forceClientComposition = true; setupGeometryChildCallValues(); Loading Loading @@ -520,13 +521,25 @@ TEST_F(OutputLayerUpdateCompositionStateTest, setsOutputLayerColorspaceCorrectly } TEST_F(OutputLayerUpdateCompositionStateTest, doesNotRecomputeGeometryIfNotRequested) { mOutputLayer.editState().forceClientComposition = false; mOutputLayer.updateCompositionState(false); EXPECT_EQ(false, mOutputLayer.getState().forceClientComposition); } TEST_F(OutputLayerUpdateCompositionStateTest, doesNotClearForceClientCompositionIfNotDoingGeometry) { mOutputLayer.editState().forceClientComposition = true; mOutputLayer.updateCompositionState(false); EXPECT_EQ(true, mOutputLayer.getState().forceClientComposition); } TEST_F(OutputLayerUpdateCompositionStateTest, clientCompositionForcedFromFrontEndFlagAtAnyTime) { mLayerFEState.forceClientComposition = true; mOutputLayer.editState().forceClientComposition = false; mOutputLayer.updateCompositionState(false); Loading @@ -535,6 +548,7 @@ TEST_F(OutputLayerUpdateCompositionStateTest, clientCompositionForcedFromFrontEn TEST_F(OutputLayerUpdateCompositionStateTest, clientCompositionForcedFromUnsupportedDataspaceAtAnyTime) { mOutputLayer.editState().forceClientComposition = false; EXPECT_CALL(mDisplayColorProfile, isDataspaceSupported(_)).WillRepeatedly(Return(false)); mOutputLayer.updateCompositionState(false); Loading Loading
services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,13 @@ void OutputLayer::updateCompositionState(bool includeGeometry) { const auto& profile = *mOutput.getDisplayColorProfile(); if (includeGeometry) { // Clear the forceClientComposition flag before it is set for any // reason. Note that since it can be set by some checks below when // updating the geometry state, we only clear it when updating the // geometry since those conditions for forcing client composition won't // go away otherwise. mState.forceClientComposition = false; mState.displayFrame = calculateOutputDisplayFrame(); mState.sourceCrop = calculateOutputSourceCrop(); mState.bufferTransform = Loading
services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -458,6 +458,7 @@ public: TEST_F(OutputLayerUpdateCompositionStateTest, setsStateNormally) { mLayerFEState.isSecure = true; mOutputState.isSecure = true; mOutputLayer.editState().forceClientComposition = true; setupGeometryChildCallValues(); Loading Loading @@ -520,13 +521,25 @@ TEST_F(OutputLayerUpdateCompositionStateTest, setsOutputLayerColorspaceCorrectly } TEST_F(OutputLayerUpdateCompositionStateTest, doesNotRecomputeGeometryIfNotRequested) { mOutputLayer.editState().forceClientComposition = false; mOutputLayer.updateCompositionState(false); EXPECT_EQ(false, mOutputLayer.getState().forceClientComposition); } TEST_F(OutputLayerUpdateCompositionStateTest, doesNotClearForceClientCompositionIfNotDoingGeometry) { mOutputLayer.editState().forceClientComposition = true; mOutputLayer.updateCompositionState(false); EXPECT_EQ(true, mOutputLayer.getState().forceClientComposition); } TEST_F(OutputLayerUpdateCompositionStateTest, clientCompositionForcedFromFrontEndFlagAtAnyTime) { mLayerFEState.forceClientComposition = true; mOutputLayer.editState().forceClientComposition = false; mOutputLayer.updateCompositionState(false); Loading @@ -535,6 +548,7 @@ TEST_F(OutputLayerUpdateCompositionStateTest, clientCompositionForcedFromFrontEn TEST_F(OutputLayerUpdateCompositionStateTest, clientCompositionForcedFromUnsupportedDataspaceAtAnyTime) { mOutputLayer.editState().forceClientComposition = false; EXPECT_CALL(mDisplayColorProfile, isDataspaceSupported(_)).WillRepeatedly(Return(false)); mOutputLayer.updateCompositionState(false); Loading