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

Commit c030118c authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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
parent 757c9f21
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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());