SF: use shared_ptr to track hwcLayer
Use std::shared_ptr to track hwcLayer pointers.
This is necessary because the calculation of
data for HWComposer is done in Layer and the processing of that
data is done in SurfaceFlinger, and we need to make sure that
the hwcLayer is not destroyed by Layer while or before being
used by SurfaceFlinger.
Bug: 112259502
Test: cts -m CtsViewTestCases
SurfaceFlinger_test
vrflinger_test
Change-Id: I683dd071efbeebd9a9941053183daf4efb88469e
diff --git a/services/surfaceflinger/LayerBE.cpp b/services/surfaceflinger/LayerBE.cpp
index 51b615b..eea4ebd 100644
--- a/services/surfaceflinger/LayerBE.cpp
+++ b/services/surfaceflinger/LayerBE.cpp
@@ -35,7 +35,7 @@
}
void CompositionInfo::dumpHwc(const char* tag) const {
- ALOGV("[%s]\thwcLayer=%p", tag, hwc.hwcLayer);
+ ALOGV("[%s]\thwcLayer=%p", tag, hwc.hwcLayer.get());
ALOGV("[%s]\tfence=%p", tag, hwc.fence.get());
ALOGV("[%s]\ttransform=%d", tag, hwc.transform);
ALOGV("[%s]\tz=%d", tag, hwc.z);