Revert "Layer: Use raw pointers for Current/Drawing parent"
This reverts commit cbdb79a195e6c690e16948a7e7c3abbd36414b17.
Bug: 203175614
Bug: 203559094
Change-Id: I5432ad46bfbbe5a009e3fb72ae7ac129263260ce
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 82c91e7..8de43e0 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -223,7 +223,7 @@
* of a camera where the buffer remains in native orientation,
* we want the pixels to always be upright.
*/
- auto p = mDrawingParent;
+ sp<Layer> p = mDrawingParent.promote();
if (p != nullptr) {
const auto parentTransform = p->getTransform();
tr = tr * inverseOrientation(parentTransform.getOrientation());