Loading services/surfaceflinger/Layer.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1893,6 +1893,16 @@ void Layer::setInputInfo(const InputWindowInfo& info) { setTransactionFlags(eTransactionNeeded); } void Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { LayerProto* layerProto = layersProto.add_layers(); writeToProtoDrawingState(layerProto, traceFlags); writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); for (const sp<Layer>& layer : mDrawingChildren) { layer->writeToProto(layersProto, traceFlags); } } void Layer::writeToProtoDrawingState(LayerProto* layerInfo, uint32_t traceFlags) const { ui::Transform transform = getTransform(); Loading Loading @@ -2014,6 +2024,8 @@ void Layer::writeToProtoCommonState(LayerProto* layerInfo, LayerVector::StateSet } else { layerInfo->set_z_order_relative_of(-1); } layerInfo->set_is_relative_of(state.isRelativeOf); } if (traceFlags & SurfaceTracing::TRACE_INPUT) { Loading services/surfaceflinger/Layer.h +3 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,9 @@ public: bool isRemovedFromCurrentState() const; void 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 // thread. Loading services/surfaceflinger/SurfaceFlinger.cpp +4 −15 Original line number Diff line number Diff line Loading @@ -4257,12 +4257,9 @@ void SurfaceFlinger::dumpWideColorInfo(std::string& result) const { LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const { LayersProto layersProto; mDrawingState.traverseInZOrder([&](Layer* layer) { LayerProto* layerProto = layersProto.add_layers(); layer->writeToProtoDrawingState(layerProto, traceFlags); layer->writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); }); for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) { layer->writeToProto(layersProto, traceFlags); } return layersProto; } Loading @@ -4286,15 +4283,7 @@ void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t traceFlags); layerProto->set_parent(offscreenRootLayerId); // Add children offscreenLayer->traverseInZOrder(LayerVector::StateSet::Drawing, [&](Layer* layer) { if (layer == offscreenLayer) { return; } LayerProto* childProto = layersProto.add_layers(); layer->writeToProtoDrawingState(childProto, traceFlags); layer->writeToProtoCommonState(childProto, LayerVector::StateSet::Drawing, traceFlags); }); offscreenLayer->writeToProto(layersProto, traceFlags); } } Loading services/surfaceflinger/layerproto/layers.proto +2 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,8 @@ message LayerProto { // layer or set by a parent layer. float shadow_radius = 49; ColorTransformProto color_transform = 50; bool is_relative_of = 51; } message PositionProto { Loading Loading
services/surfaceflinger/Layer.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -1893,6 +1893,16 @@ void Layer::setInputInfo(const InputWindowInfo& info) { setTransactionFlags(eTransactionNeeded); } void Layer::writeToProto(LayersProto& layersProto, uint32_t traceFlags) const { LayerProto* layerProto = layersProto.add_layers(); writeToProtoDrawingState(layerProto, traceFlags); writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); for (const sp<Layer>& layer : mDrawingChildren) { layer->writeToProto(layersProto, traceFlags); } } void Layer::writeToProtoDrawingState(LayerProto* layerInfo, uint32_t traceFlags) const { ui::Transform transform = getTransform(); Loading Loading @@ -2014,6 +2024,8 @@ void Layer::writeToProtoCommonState(LayerProto* layerInfo, LayerVector::StateSet } else { layerInfo->set_z_order_relative_of(-1); } layerInfo->set_is_relative_of(state.isRelativeOf); } if (traceFlags & SurfaceTracing::TRACE_INPUT) { Loading
services/surfaceflinger/Layer.h +3 −0 Original line number Diff line number Diff line Loading @@ -454,6 +454,9 @@ public: bool isRemovedFromCurrentState() const; void 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 // thread. Loading
services/surfaceflinger/SurfaceFlinger.cpp +4 −15 Original line number Diff line number Diff line Loading @@ -4257,12 +4257,9 @@ void SurfaceFlinger::dumpWideColorInfo(std::string& result) const { LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const { LayersProto layersProto; mDrawingState.traverseInZOrder([&](Layer* layer) { LayerProto* layerProto = layersProto.add_layers(); layer->writeToProtoDrawingState(layerProto, traceFlags); layer->writeToProtoCommonState(layerProto, LayerVector::StateSet::Drawing, traceFlags); }); for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) { layer->writeToProto(layersProto, traceFlags); } return layersProto; } Loading @@ -4286,15 +4283,7 @@ void SurfaceFlinger::dumpOffscreenLayersProto(LayersProto& layersProto, uint32_t traceFlags); layerProto->set_parent(offscreenRootLayerId); // Add children offscreenLayer->traverseInZOrder(LayerVector::StateSet::Drawing, [&](Layer* layer) { if (layer == offscreenLayer) { return; } LayerProto* childProto = layersProto.add_layers(); layer->writeToProtoDrawingState(childProto, traceFlags); layer->writeToProtoCommonState(childProto, LayerVector::StateSet::Drawing, traceFlags); }); offscreenLayer->writeToProto(layersProto, traceFlags); } } Loading
services/surfaceflinger/layerproto/layers.proto +2 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,8 @@ message LayerProto { // layer or set by a parent layer. float shadow_radius = 49; ColorTransformProto color_transform = 50; bool is_relative_of = 51; } message PositionProto { Loading