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

Commit 69600966 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Trace drawing state"

parents 7957b72d 8e0af367
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1795,7 +1795,7 @@ void Layer::writeToProto(LayerProto* layerInfo, LayerVector::StateSet stateSet)
    LayerProtoHelper::writeToProto(transform, layerInfo->mutable_transform());
    LayerProtoHelper::writeToProto(requestedTransform, layerInfo->mutable_requested_transform());

    auto parent = getParent();
    auto parent = useDrawing ? mDrawingParent.promote() : mCurrentParent.promote();
    if (parent != nullptr) {
        layerInfo->set_parent(parent->sequence);
    }
+8 −6
Original line number Diff line number Diff line
@@ -1585,7 +1585,7 @@ void SurfaceFlinger::doTracing(const char* where) {
    ATRACE_CALL();
    ATRACE_NAME(where);
    if (CC_UNLIKELY(mTracing.isEnabled())) {
        mTracing.traceLayers(where, dumpProtoInfo());
        mTracing.traceLayers(where, dumpProtoInfo(LayerVector::StateSet::Drawing));
    }
}

@@ -3540,7 +3540,7 @@ status_t SurfaceFlinger::doDump(int fd, const Vector<String16>& args, bool asPro
        size_t numArgs = args.size();

        if (asProto) {
            LayersProto layersProto = dumpProtoInfo();
            LayersProto layersProto = dumpProtoInfo(LayerVector::StateSet::Current);
            result.append(layersProto.SerializeAsString().c_str(), layersProto.ByteSize());
            dumpAll = false;
        }
@@ -3789,11 +3789,13 @@ void SurfaceFlinger::dumpWideColorInfo(String8& result) const {
    result.append("\n");
}

LayersProto SurfaceFlinger::dumpProtoInfo() const {
LayersProto SurfaceFlinger::dumpProtoInfo(LayerVector::StateSet stateSet) const {
    LayersProto layersProto;
    mCurrentState.traverseInZOrder([&](Layer* layer) {
    const bool useDrawing = stateSet == LayerVector::StateSet::Drawing;
    const State& state = useDrawing ? mDrawingState : mCurrentState;
    state.traverseInZOrder([&](Layer* layer) {
        LayerProto* layerProto = layersProto.add_layers();
        layer->writeToProto(layerProto, LayerVector::StateSet::Current);
        layer->writeToProto(layerProto, stateSet);
    });

    return layersProto;
@@ -3864,7 +3866,7 @@ void SurfaceFlinger::dumpAllLocked(const Vector<String16>& args, size_t& index,
    result.appendFormat("Visible layers (count = %zu)\n", mNumLayers);
    colorizer.reset(result);

    LayersProto layersProto = dumpProtoInfo();
    LayersProto layersProto = dumpProtoInfo(LayerVector::StateSet::Current);
    auto layerTree = LayerProtoParser::generateLayerTree(layersProto);
    result.append(LayerProtoParser::layersToString(layerTree).c_str());

+1 −1
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ private:
            std::vector<OccupancyTracker::Segment>&& history);
    void dumpBufferingStats(String8& result) const;
    void dumpWideColorInfo(String8& result) const;
    LayersProto dumpProtoInfo() const;
    LayersProto dumpProtoInfo(LayerVector::StateSet stateSet) const;

    bool isLayerTripleBufferingDisabled() const {
        return this->mLayerTripleBufferingDisabled;