diff options
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 4 | ||||
| -rw-r--r-- | services/surfaceflinger/Layer.h | 4 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 7 |
3 files changed, 6 insertions, 9 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 37714f55c1..2593681b6b 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1893,7 +1893,7 @@ void Layer::setInputInfo(const InputWindowInfo& info) { setTransactionFlags(eTransactionNeeded); } -void Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { +LayerProto* Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { LayerProto* layerProto = layersProto.add_layers(); writeToProtoDrawingState(layerProto, traceFlags); writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); @@ -1901,6 +1901,8 @@ void Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { for (const sp<Layer>& layer : mDrawingChildren) { layer->writeToProto(layersProto, traceFlags); } + + return layerProto; } void Layer::writeToProtoDrawingState(LayerProto* layerInfo, uint32_t traceFlags) const { diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index 76edfa5fcb..174ac8da1e 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -454,8 +454,8 @@ public: bool isRemovedFromCurrentState() const; - void writeToProto(LayersProto& layersProto, - uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; + LayerProto* writeToProto(LayersProto& layersProto, + uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const; // Write states that are modified by the main thread. This includes drawing // state as well as buffer data. This should be called in the main or tracing diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 65d02adeef..b7a2c760e6 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -4277,13 +4277,8 @@ void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t rootProto->add_children(offscreenLayer->sequence); // Add layer - LayerProto* layerProto = layersProto.add_layers(); - offscreenLayer->writeToProtoDrawingState(layerProto, traceFlags); - offscreenLayer->writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, - traceFlags); + LayerProto* layerProto = offscreenLayer->writeToProto(layersProto, traceFlags); layerProto->set_parent(offscreenRootLayerId); - - offscreenLayer->writeToProto(layersProto, traceFlags); } } |