Loading services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,9 @@ Rect OutputLayer::calculateOutputDisplayFrame() const { // Some HWCs may clip client composited input to its displayFrame. Make sure // that this does not cut off the shadow. if (layerState.forceClientComposition && layerState.shadowSettings.length > 0.0f) { const auto outset = layerState.shadowSettings.length; // RenderEngine currently blurs shadows to smooth out edges, so outset by // 2x the length instead of 1x to compensate const auto outset = layerState.shadowSettings.length * 2; geomLayerBounds.left -= outset; geomLayerBounds.top -= outset; geomLayerBounds.right += outset; Loading services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ TEST_F(OutputLayerDisplayFrameTest, shadowExpandsDisplayFrame) { mLayerFEState.geomLayerBounds = FloatRect{100.f, 100.f, 200.f, 200.f}; Rect expected{mLayerFEState.geomLayerBounds}; expected.inset(-kShadowRadius, -kShadowRadius, -kShadowRadius, -kShadowRadius); expected.inset(-2 * kShadowRadius, -2 * kShadowRadius, -2 * kShadowRadius, -2 * kShadowRadius); EXPECT_THAT(calculateOutputDisplayFrame(), expected); } Loading Loading
services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,9 @@ Rect OutputLayer::calculateOutputDisplayFrame() const { // Some HWCs may clip client composited input to its displayFrame. Make sure // that this does not cut off the shadow. if (layerState.forceClientComposition && layerState.shadowSettings.length > 0.0f) { const auto outset = layerState.shadowSettings.length; // RenderEngine currently blurs shadows to smooth out edges, so outset by // 2x the length instead of 1x to compensate const auto outset = layerState.shadowSettings.length * 2; geomLayerBounds.left -= outset; geomLayerBounds.top -= outset; geomLayerBounds.right += outset; Loading
services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ TEST_F(OutputLayerDisplayFrameTest, shadowExpandsDisplayFrame) { mLayerFEState.geomLayerBounds = FloatRect{100.f, 100.f, 200.f, 200.f}; Rect expected{mLayerFEState.geomLayerBounds}; expected.inset(-kShadowRadius, -kShadowRadius, -kShadowRadius, -kShadowRadius); expected.inset(-2 * kShadowRadius, -2 * kShadowRadius, -2 * kShadowRadius, -2 * kShadowRadius); EXPECT_THAT(calculateOutputDisplayFrame(), expected); } Loading