summaryrefslogtreecommitdiff
path: root/services/surfaceflinger
diff options
context:
space:
mode:
authorChavi Weingarten <chaviw@google.com>2020-01-15 18:05:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-01-15 18:05:54 +0000
commit9d4c996b9cd8fd0a978d4b6c60293d638def5cd7 (patch)
treeb9e71464cf0ca049206829b3667c13c8d2f230dc /services/surfaceflinger
parent31ba2a9632596b7e1de701722e76e24908b2bc0a (diff)
parent6d89e2de826c74957851552ad8d465ccf6d421b2 (diff)
downloadnative-9d4c996b9cd8fd0a978d4b6c60293d638def5cd7.tar.gz
Merge "Don't add offscreen layer twice to proto."
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/Layer.cpp4
-rw-r--r--services/surfaceflinger/Layer.h4
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp7
3 files changed, 6 insertions, 9 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 37714f55c1..2593681b6b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -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 {
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 76edfa5fcb..174ac8da1e 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -454,8 +454,8 @@ public:
bool isRemovedFromCurrentState() const;
- void writeToProto(LayersProto& layersProto,
- uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const;
+ LayerProto* writeToProto(LayersProto& layersProto,
+ uint32_t traceFlags = SurfaceTracing::TRACE_ALL) const;
// Write states that are modified by the main thread. This includes drawing
// state as well as buffer data. This should be called in the main or tracing
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 65d02adeef..b7a2c760e6 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -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);
}
}