diff options
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 2 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 14 | ||||
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index aa3100eb1d..f5fb109ae6 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1786,7 +1786,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); } diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 96ba5fb766..9e7563c594 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -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)); } } @@ -3534,7 +3534,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; } @@ -3783,11 +3783,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; @@ -3858,7 +3860,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()); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 67e4607012..386d42bef1 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -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; |