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

Commit 7d410016 authored by Melody Hsu's avatar Melody Hsu
Browse files

[legacy layer cleanup] Misc dead code in Layer

Remove unused methods in legacy layer code.

Flag: EXEMPT flag removal
Bug: 330785038
Test: presubmit
Change-Id: I463f4a0c0a64a059babd5608ba4a4311ff6e2354
parent 29f7d5c9
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1459,10 +1459,6 @@ void Layer::onCompositionPresented(const DisplayDevice* display,
    mBufferInfo.mFrameLatencyNeeded = false;
}

bool Layer::willReleaseBufferOnLatch() const {
    return !mDrawingState.buffer && mBufferInfo.mBuffer;
}

bool Layer::latchBufferImpl(bool& recomputeVisibleRegions, nsecs_t latchTime, bool bgColorOnly) {
    SFTRACE_FORMAT_INSTANT("latchBuffer %s - %" PRIu64, getDebugName(),
                           getDrawingState().frameNumber);
@@ -1523,11 +1519,6 @@ bool Layer::latchBufferImpl(bool& recomputeVisibleRegions, nsecs_t latchTime, bo
    return true;
}

bool Layer::isProtected() const {
    return (mBufferInfo.mBuffer != nullptr) &&
            (mBufferInfo.mBuffer->getUsage() & GRALLOC_USAGE_PROTECTED);
}

bool Layer::getTransformToDisplayInverse() const {
    return mBufferInfo.mTransformToDisplayInverse;
}
+0 −32
Original line number Diff line number Diff line
@@ -165,9 +165,6 @@ public:
    static bool isLayerFocusedBasedOnPriority(int32_t priority);
    static void miniDumpHeader(std::string& result);

    // Provide unique string for each class type in the Layer hierarchy
    const char* getType() const { return "Layer"; }

    // This second set of geometry attributes are controlled by
    // setGeometryAppliesWithResize, and their default mode is to be
    // immediate. If setGeometryAppliesWithResize is specified
@@ -194,7 +191,6 @@ public:
                                          bool willPresent);

    sp<LayerFE> getCompositionEngineLayerFE(const frontend::LayerHierarchy::TraversalPath&);
    sp<LayerFE> getOrCreateCompositionEngineLayerFE(const frontend::LayerHierarchy::TraversalPath&);

    // If we have received a new buffer this frame, we will pass its surface
    // damage down to hardware composer. Otherwise, we must send a region with
@@ -202,14 +198,7 @@ public:
    Region getVisibleRegion(const DisplayDevice*) const;
    void updateLastLatchTime(nsecs_t latchtime);

    /*
     * isProtected - true if the layer may contain protected contents in the
     * GRALLOC_USAGE_PROTECTED sense.
     */
    bool isProtected() const;

    Rect getCrop(const Layer::State& s) const { return s.crop; }
    bool needsFiltering(const DisplayDevice*) const;

    // from graphics API
    static ui::Dataspace translateDataspace(ui::Dataspace dataspace);
@@ -232,12 +221,6 @@ public:
    bool latchBufferImpl(bool& /*recomputeVisibleRegions*/, nsecs_t /*latchTime*/,
                         bool bgColorOnly);

    /*
     * Returns true if the currently presented buffer will be released when this layer state
     * is latched. This will return false if there is no buffer currently presented.
     */
    bool willReleaseBufferOnLatch() const;

    sp<GraphicBuffer> getBuffer() const;
    /**
     * Returns active buffer size in the correct orientation. Buffer size is determined by undoing
@@ -322,8 +305,6 @@ public:
    void writeCompositionStateToProto(perfetto::protos::LayerProto* layerProto,
                                      ui::LayerStack layerStack);

    gui::WindowInfo::Type getWindowType() const { return mWindowType; }

    inline const State& getDrawingState() const { return mDrawingState; }
    inline State& getDrawingState() { return mDrawingState; }

@@ -334,11 +315,6 @@ public:
    void getFrameStats(FrameStats* outStats) const;
    void onDisconnect();

    half4 getColor() const;
    int32_t getBackgroundBlurRadius() const;
    bool drawShadows() const { return mEffectiveShadowRadius > 0.f; };

    bool isHandleAlive() const { return mHandleAlive; }
    bool onHandleDestroyed() { return mHandleAlive = false; }

    /**
@@ -349,7 +325,6 @@ public:
     */
    Rect getCroppedBufferSize(const Layer::State& s) const;

    void setFrameTimelineInfoForBuffer(const FrameTimelineInfo& /*info*/) {}
    void setFrameTimelineVsyncForBufferTransaction(const FrameTimelineInfo& info, nsecs_t postTime,
                                                   gui::GameMode gameMode);
    void setFrameTimelineVsyncForBufferlessTransaction(const FrameTimelineInfo& info,
@@ -378,14 +353,9 @@ public:
    // this to be called once.
    sp<IBinder> getHandle();
    const std::string& getName() const { return mName; }
    void setInputInfo(const gui::WindowInfo& info);

    virtual uid_t getOwnerUid() const { return mOwnerUid; }

    pid_t getOwnerPid() { return mOwnerPid; }

    int32_t getOwnerAppId() { return mOwnerAppId; }

    // Used to check if mUsedVsyncIdForRefreshRateSelection should be expired when it stop updating.
    nsecs_t mMaxTimeForUseVsyncId = 0;
    // True when DrawState.useVsyncIdForRefreshRateSelection previously set to true during updating
@@ -397,8 +367,6 @@ public:
    // the same.
    const int32_t sequence;

    bool mPendingHWCDestroy{false};

    // See mPendingBufferTransactions
    void decrementPendingBufferCount();
    std::atomic<int32_t>* getPendingBufferCounter() { return &mPendingBufferTransactions; }