summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2022-03-08 11:08:28 -0500
committer Leon Scroggins III <scroggo@google.com> 2022-03-08 16:23:48 -0500
commitc030118cf98355d460775d09ff16ea7e030d6d29 (patch)
treec05539e20dde4ab0e4fc63e0fccc56074db88d35
parent757c9f21446094fb8dfd07de21f0c8ac688cbb1e (diff)
CachedSet: name the hole punch layer
When creating the LayerSettings for the hole punch layer, include the name of the layer. In dump(), print the name in addition to the pointer. These changes are useful for debugging. Bug: 221224727 Test: mskp capture, dumpsys Change-Id: I47498135a6c57be592b59066abde80c62955a925
-rw-r--r--services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp b/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp
index 2203f22263..42c126382e 100644
--- a/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/planner/CachedSet.cpp
@@ -20,6 +20,7 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <android-base/properties.h>
+#include <android-base/stringprintf.h>
#include <compositionengine/impl/OutputCompositionState.h>
#include <compositionengine/impl/planner/CachedSet.h>
#include <math/HashCombine.h>
@@ -216,9 +217,8 @@ void CachedSet::render(renderengine::RenderEngine& renderEngine, TexturePool& te
renderengine::LayerSettings holePunchSettings;
renderengine::LayerSettings holePunchBackgroundSettings;
if (mHolePunchLayer) {
- auto clientCompositionList =
- mHolePunchLayer->getOutputLayer()->getLayerFE().prepareClientCompositionList(
- targetSettings);
+ auto& layerFE = mHolePunchLayer->getOutputLayer()->getLayerFE();
+ auto clientCompositionList = layerFE.prepareClientCompositionList(targetSettings);
// Assume that the final layer contains the buffer that we want to
// replace with a hole punch.
holePunchSettings = clientCompositionList.back();
@@ -227,7 +227,8 @@ void CachedSet::render(renderengine::RenderEngine& renderEngine, TexturePool& te
holePunchSettings.source.solidColor = half3(0.0f, 0.0f, 0.0f);
holePunchSettings.disableBlending = true;
holePunchSettings.alpha = 0.0f;
- holePunchSettings.name = std::string("hole punch layer");
+ holePunchSettings.name =
+ android::base::StringPrintf("hole punch layer for %s", layerFE.getDebugName());
layerSettings.push_back(holePunchSettings);
// Add a solid background as the first layer in case there is no opaque
@@ -390,7 +391,10 @@ void CachedSet::dump(std::string& result) const {
const auto b = mTexture ? mTexture->get()->getBuffer().get() : nullptr;
base::StringAppendF(&result, " Override buffer: %p\n", b);
}
- base::StringAppendF(&result, " HolePunchLayer: %p\n", mHolePunchLayer);
+ base::StringAppendF(&result, " HolePunchLayer: %p\t%s\n", mHolePunchLayer,
+ mHolePunchLayer
+ ? mHolePunchLayer->getOutputLayer()->getLayerFE().getDebugName()
+ : "");
if (mLayers.size() == 1) {
base::StringAppendF(&result, " Layer [%s]\n", mLayers[0].getName().c_str());