Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -2449,6 +2449,13 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs, const bool willReleaseBufferOnLatch = layer->willReleaseBufferOnLatch(); auto it = mLegacyLayers.find(layer->id); if (it == mLegacyLayers.end() && layer->changes.test(frontend::RequestedLayerState::Changes::Destroyed)) { // Layer handle was created and immediately destroyed. It was destroyed before it // was added to the map. continue; } LLOG_ALWAYS_FATAL_WITH_TRACE_IF(it == mLegacyLayers.end(), "Couldnt find layer object for %s", layer->getDebugString().c_str()); Loading services/surfaceflinger/tests/LayerTransaction_test.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,15 @@ TEST_F(LayerTransactionTest, CommitCallbackCalledOnce) { ASSERT_EQ(callCount, 1); } TEST_F(LayerTransactionTest, AddRemoveLayers) { for (int i = 0; i < 100; i++) { sp<SurfaceControl> layer; ASSERT_NO_FATAL_FAILURE( layer = createLayer("test", 32, 32, ISurfaceComposerClient::eFXSurfaceBufferState)); layer.clear(); } } } // namespace android // TODO(b/129481165): remove the #pragma below and fix conversion issues Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -2449,6 +2449,13 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, nsecs_t frameTimeNs, const bool willReleaseBufferOnLatch = layer->willReleaseBufferOnLatch(); auto it = mLegacyLayers.find(layer->id); if (it == mLegacyLayers.end() && layer->changes.test(frontend::RequestedLayerState::Changes::Destroyed)) { // Layer handle was created and immediately destroyed. It was destroyed before it // was added to the map. continue; } LLOG_ALWAYS_FATAL_WITH_TRACE_IF(it == mLegacyLayers.end(), "Couldnt find layer object for %s", layer->getDebugString().c_str()); Loading
services/surfaceflinger/tests/LayerTransaction_test.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,15 @@ TEST_F(LayerTransactionTest, CommitCallbackCalledOnce) { ASSERT_EQ(callCount, 1); } TEST_F(LayerTransactionTest, AddRemoveLayers) { for (int i = 0; i < 100; i++) { sp<SurfaceControl> layer; ASSERT_NO_FATAL_FAILURE( layer = createLayer("test", 32, 32, ISurfaceComposerClient::eFXSurfaceBufferState)); layer.clear(); } } } // namespace android // TODO(b/129481165): remove the #pragma below and fix conversion issues Loading