Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d89e2de authored by chaviw's avatar chaviw
Browse files

Don't add offscreen layer twice to proto.

Fixes: 147691800
Test: Only one offscreen layer per id in dump
Change-Id: I9c741e87531ec0ed166dd1cdafc0961e243d1c96
parent 08f3cb2b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 {
+2 −2
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ public:

    bool isRemovedFromCurrentState() const;

    void writeToProto(LayersProto& layersProto,
    LayerProto* writeToProto(LayersProto& layersProto,
                             uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const;

    // Write states that are modified by the main thread. This includes drawing
+1 −6
Original line number Diff line number Diff line
@@ -4290,13 +4290,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);
    }
}