SurfaceFlinger: Remove removeLayer
We remove explicit layer destruction and replace it
with reparent->null, completing the transition to
a reference counted model.
Test: Manual
Bug: 62536731
Bug: 111373437
Bug: 111297488
Change-Id: I8ac7c5c5125e1c8daf84b42db00e1dd93a544bb5
diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp
index d118ad6..991ea36 100644
--- a/services/surfaceflinger/tests/Transaction_test.cpp
+++ b/services/surfaceflinger/tests/Transaction_test.cpp
@@ -1023,7 +1023,7 @@
.setRelativeLayer(layerG, layerR->getHandle(), 1)
.apply();
- mClient->destroySurface(layerG->getHandle());
+ layerG->clear();
// layerG should have been removed
screenshot()->expectColor(Rect(0, 0, 32, 32), Color::RED);
}
@@ -4030,9 +4030,9 @@
asTransaction([&](Transaction& t) { t.reparent(mChild, nullptr); });
{
mCapture = screenshot();
- // Nothing should have changed.
+ // The surface should now be offscreen.
mCapture->expectFGColor(64, 64);
- mCapture->expectChildColor(74, 74);
+ mCapture->expectFGColor(74, 74);
mCapture->expectFGColor(84, 84);
}
}
@@ -4610,7 +4610,7 @@
ASSERT_NO_FATAL_FAILURE(fillBufferQueueLayerColor(redLayer, Color::RED, 60, 60));
auto redLayerHandle = redLayer->getHandle();
- mClient->destroySurface(redLayerHandle);
+ redLayer->clear();
SurfaceComposerClient::Transaction().apply(true);
sp<GraphicBuffer> outBuffer;