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

Commit 9d4c996b authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge "Don't add offscreen layer twice to proto."

parents 31ba2a96 6d89e2de
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
@@ -454,7 +454,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
@@ -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);
    }
}