Loading libs/gui/LayerState.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -267,8 +267,9 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eFlagsChanged) { what |= eFlagsChanged; flags = other.flags; mask = other.mask; flags &= ~other.mask; flags |= (other.flags & other.mask); mask |= other.mask; } if (other.what & eLayerStackChanged) { what |= eLayerStackChanged; Loading services/surfaceflinger/tests/Transaction_test.cpp +24 −0 Original line number Diff line number Diff line Loading @@ -4427,6 +4427,30 @@ TEST_F(LayerUpdateTest, MergingTransactions) { } } TEST_F(LayerUpdateTest, MergingTransactionFlags) { Transaction().hide(mFGSurfaceControl).apply(); std::unique_ptr<ScreenCapture> sc; { SCOPED_TRACE("before merge"); ScreenCapture::captureScreen(&sc); sc->expectBGColor(0, 12); sc->expectBGColor(75, 75); sc->expectBGColor(145, 145); } Transaction t1, t2; t1.show(mFGSurfaceControl); t2.setFlags(mFGSurfaceControl, 0 /* flags */, layer_state_t::eLayerSecure /* mask */); t1.merge(std::move(t2)); t1.apply(); { SCOPED_TRACE("after merge"); ScreenCapture::captureScreen(&sc); sc->expectFGColor(75, 75); } } class ChildLayerTest : public LayerUpdateTest { protected: void SetUp() override { Loading Loading
libs/gui/LayerState.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -267,8 +267,9 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eFlagsChanged) { what |= eFlagsChanged; flags = other.flags; mask = other.mask; flags &= ~other.mask; flags |= (other.flags & other.mask); mask |= other.mask; } if (other.what & eLayerStackChanged) { what |= eLayerStackChanged; Loading
services/surfaceflinger/tests/Transaction_test.cpp +24 −0 Original line number Diff line number Diff line Loading @@ -4427,6 +4427,30 @@ TEST_F(LayerUpdateTest, MergingTransactions) { } } TEST_F(LayerUpdateTest, MergingTransactionFlags) { Transaction().hide(mFGSurfaceControl).apply(); std::unique_ptr<ScreenCapture> sc; { SCOPED_TRACE("before merge"); ScreenCapture::captureScreen(&sc); sc->expectBGColor(0, 12); sc->expectBGColor(75, 75); sc->expectBGColor(145, 145); } Transaction t1, t2; t1.show(mFGSurfaceControl); t2.setFlags(mFGSurfaceControl, 0 /* flags */, layer_state_t::eLayerSecure /* mask */); t1.merge(std::move(t2)); t1.apply(); { SCOPED_TRACE("after merge"); ScreenCapture::captureScreen(&sc); sc->expectFGColor(75, 75); } } class ChildLayerTest : public LayerUpdateTest { protected: void SetUp() override { Loading