Loading
surfaceflinger: simplify memory management for layerproto
Use std::vector<Layer> instead of a tree of std::unique_ptr<Layer> to manage layers. This significantly reduces the number of allocations, and more importantly, we can get rid of "new" in generateLayer. Because there is no "new", it is easier to reason that there is no leaked layer. We still keep the pointers to top-level layers in LayerTree::topLevelLayers. But AFAICT, we probably don't need it after all. Test: dumpsys, winscope trace Change-Id: I302c9115ab025b69e9ea05f4bcd759ed3ee4a8eb