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

Commit cc823882 authored by Vishnu Nair's avatar Vishnu Nair Committed by Automerger Merge Worker
Browse files

Merge "Call Layer::getLayerDebugInfo from the main thread" into rvc-dev am: 32ca5feb

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

Change-Id: Ie0d34c57cec865bbfa9e12af967b503d019bfad3
parents c7d44fdf 32ca5feb
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -691,8 +691,7 @@ public:
        return result;
        return result;
    }
    }


    virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const
    virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) {
    {
        if (!outLayers) {
        if (!outLayers) {
            return UNEXPECTED_NULL;
            return UNEXPECTED_NULL;
        }
        }
+1 −1
Original line number Original line Diff line number Diff line
@@ -354,7 +354,7 @@ public:
     *
     *
     * Requires the ACCESS_SURFACE_FLINGER permission.
     * Requires the ACCESS_SURFACE_FLINGER permission.
     */
     */
    virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const = 0;
    virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) = 0;


    virtual status_t getColorManagement(bool* outGetColorManagement) const = 0;
    virtual status_t getColorManagement(bool* outGetColorManagement) const = 0;


+1 −1
Original line number Original line Diff line number Diff line
@@ -785,7 +785,7 @@ public:
        return NO_ERROR;
        return NO_ERROR;
    }
    }
    status_t injectVSync(nsecs_t /*when*/) override { return NO_ERROR; }
    status_t injectVSync(nsecs_t /*when*/) override { return NO_ERROR; }
    status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* /*layers*/) const override {
    status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* /*layers*/) override {
        return NO_ERROR;
        return NO_ERROR;
    }
    }
    status_t getCompositionPreference(
    status_t getCompositionPreference(
+1 −1
Original line number Original line Diff line number Diff line
@@ -1501,7 +1501,7 @@ LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const {
    LayerDebugInfo info;
    LayerDebugInfo info;
    const State& ds = getDrawingState();
    const State& ds = getDrawingState();
    info.mName = getName();
    info.mName = getName();
    sp<Layer> parent = getParent();
    sp<Layer> parent = mDrawingParent.promote();
    info.mParentName = parent ? parent->getName() : "none"s;
    info.mParentName = parent ? parent->getName() : "none"s;
    info.mType = getType();
    info.mType = getType();
    info.mTransparentRegion = ds.activeTransparentRegion_legacy;
    info.mTransparentRegion = ds.activeTransparentRegion_legacy;
+7 −10
Original line number Original line Diff line number Diff line
@@ -1449,17 +1449,14 @@ status_t SurfaceFlinger::injectVSync(nsecs_t when) {
    return mScheduler->injectVSync(when, calculateExpectedPresentTime(when)) ? NO_ERROR : BAD_VALUE;
    return mScheduler->injectVSync(when, calculateExpectedPresentTime(when)) ? NO_ERROR : BAD_VALUE;
}
}


status_t SurfaceFlinger::getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const {
status_t SurfaceFlinger::getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) {
    TimedLock lock(mStateLock, s2ns(1), __FUNCTION__);
    if (!lock.locked()) {
        return TIMED_OUT;
    }

    const auto display = getDefaultDisplayDeviceLocked();
    outLayers->clear();
    outLayers->clear();
    mCurrentState.traverseInZOrder(
    schedule([=] {
            [&](Layer* layer) { outLayers->push_back(layer->getLayerDebugInfo(display.get())); });
        const auto display = ON_MAIN_THREAD(getDefaultDisplayDeviceLocked());

        mDrawingState.traverseInZOrder([&](Layer* layer) {
            outLayers->push_back(layer->getLayerDebugInfo(display.get()));
        });
    }).wait();
    return NO_ERROR;
    return NO_ERROR;
}
}


Loading