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

Commit d7b09f67 authored by Leon Scroggins's avatar Leon Scroggins Committed by Automerger Merge Worker
Browse files

Merge "CachedSet: name the hole punch layer" into tm-dev am: 9dec9306

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/17123768

Change-Id: Ibf15f307c5536718addff1c45355b065eeca0cf5
parents 4e29ef57 9dec9306
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());