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

Commit 525f29a3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Support skipping layer dump on virtual displays"

parents 4e8e9b96 63b3c872
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -5031,8 +5031,22 @@ void SurfaceFlinger::dumpWideColorInfo(std::string& result) const {
}

LayersProto SurfaceFlinger::dumpDrawingStateProto(uint32_t traceFlags) const {
    std::unordered_set<uint64_t> stackIdsToSkip;

    // Determine if virtual layers display should be skipped
    if ((traceFlags & LayerTracing::TRACE_VIRTUAL_DISPLAYS) == 0) {
        for (const auto& [_, display] : FTL_FAKE_GUARD(mStateLock, mDisplays)) {
            if (display->isVirtual()) {
                stackIdsToSkip.insert(display->getLayerStack().id);
            }
        }
    }

    LayersProto layersProto;
    for (const sp<Layer>& layer : mDrawingState.layersSortedByZ) {
        if (stackIdsToSkip.find(layer->getLayerStack().id) != stackIdsToSkip.end()) {
            continue;
        }
        layer->writeToProto(layersProto, traceFlags);
    }

+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ public:
        TRACE_EXTRA = 1 << 3,
        TRACE_HWC = 1 << 4,
        TRACE_BUFFERS = 1 << 5,
        TRACE_VIRTUAL_DISPLAYS = 1 << 6,
        TRACE_ALL = TRACE_INPUT | TRACE_COMPOSITION | TRACE_EXTRA,
    };
    void setTraceFlags(uint32_t flags);