SurfaceControl life-cycle refactoring.
We provide a method called "release" which allows the client
to drop its references without reparenting the SurfaceControl
to null as the destructor would. The Java and NDK API's already
have this method but it's not perfectly functional at the moment.
Additionally we remove the strange pass-through of clear to destroy
and expose destroy directly.
Test: Builds
Bug: 123587983
Change-Id: Ia89ada1476daef97e6f30d50a57065c3636a6489
diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp
index 4f0ded3..50a2e60 100644
--- a/services/surfaceflinger/tests/Transaction_test.cpp
+++ b/services/surfaceflinger/tests/Transaction_test.cpp
@@ -1137,7 +1137,7 @@
.setRelativeLayer(layerG, layerR->getHandle(), 1)
.apply();
- layerG->clear();
+ layerG.clear();
// layerG should have been removed
getScreenCapture()->expectColor(Rect(0, 0, 32, 32), Color::RED);
}
@@ -4360,7 +4360,7 @@
mCapture->checkPixel(64, 64, 111, 111, 111);
}
- mChild->clear();
+ mChild.clear();
{
SCOPED_TRACE("After destroying child");
@@ -5232,7 +5232,7 @@
ASSERT_NO_FATAL_FAILURE(fillBufferQueueLayerColor(redLayer, Color::RED, 60, 60));
auto redLayerHandle = redLayer->getHandle();
- redLayer->clear();
+ redLayer.clear();
SurfaceComposerClient::Transaction().apply(true);
sp<GraphicBuffer> outBuffer;