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

Commit 081ed306 authored by Shuangxi Xiang's avatar Shuangxi Xiang
Browse files

Remove the extra parameters in onCommitNotComposited

The PhysicalDisplayId parameter of the onCommitNotComposited function is passed by value. PhysicalDisplayId is a structure, but the parameter value is never used inside the onCommitNotComposited function, which will cause a certain amount of memory waste. You can remove this parameter first, or change it to reference passing. (But reference passing here should not be necessary).

Signed-off-by:
Shuangxi Xiang <xiangshuangxi@xiaomi.corp-partner.google.com>

Change-Id: I996351c8224c286f204975955e5fbbbb52d44e61
parent b9bbaadf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ struct ISchedulerCallback {
    virtual void onChoreographerAttached() = 0;
    virtual void onExpectedPresentTimePosted(TimePoint, ftl::NonNull<DisplayModePtr>,
                                             Fps renderRate) = 0;
    virtual void onCommitNotComposited(PhysicalDisplayId pacesetterDisplayId) = 0;
    virtual void onCommitNotComposited() = 0;
    virtual void vrrDisplayIdle(bool idle) = 0;

protected:
+1 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ void Scheduler::onFrameSignal(ICompositor& compositor, VsyncId vsyncId,
            if (FlagManager::getInstance().vrr_config()) {
                compositor.sendNotifyExpectedPresentHint(pacesetterPtr->displayId);
            }
            mSchedulerCallback.onCommitNotComposited(pacesetterPtr->displayId);
            mSchedulerCallback.onCommitNotComposited();
            return;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -4472,7 +4472,7 @@ void SurfaceFlinger::sendNotifyExpectedPresentHint(PhysicalDisplayId displayId)
    scheduleNotifyExpectedPresentHint(displayId);
}

void SurfaceFlinger::onCommitNotComposited(PhysicalDisplayId pacesetterDisplayId) {
void SurfaceFlinger::onCommitNotComposited() {
    if (FlagManager::getInstance().commit_not_composited()) {
        mFrameTimeline->onCommitNotComposited();
    }
+1 −1
Original line number Diff line number Diff line
@@ -701,7 +701,7 @@ private:
    void onChoreographerAttached() override;
    void onExpectedPresentTimePosted(TimePoint expectedPresentTime, ftl::NonNull<DisplayModePtr>,
                                     Fps renderRate) override;
    void onCommitNotComposited(PhysicalDisplayId pacesetterDisplayId) override
    void onCommitNotComposited() override
            REQUIRES(kMainThreadContext);
    void vrrDisplayIdle(bool idle) override;

+2 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ struct SchedulerCallback final : ISchedulerCallback {
    MOCK_METHOD(void, onChoreographerAttached, (), (override));
    MOCK_METHOD(void, onExpectedPresentTimePosted, (TimePoint, ftl::NonNull<DisplayModePtr>, Fps),
                (override));
    MOCK_METHOD(void, onCommitNotComposited, (PhysicalDisplayId), (override));
    MOCK_METHOD(void, onCommitNotComposited, (), (override));
    MOCK_METHOD(void, vrrDisplayIdle, (bool), (override));
};

@@ -41,7 +41,7 @@ struct NoOpSchedulerCallback final : ISchedulerCallback {
    void triggerOnFrameRateOverridesChanged() override {}
    void onChoreographerAttached() override {}
    void onExpectedPresentTimePosted(TimePoint, ftl::NonNull<DisplayModePtr>, Fps) override {}
    void onCommitNotComposited(PhysicalDisplayId) override {}
    void onCommitNotComposited() override {}
    void vrrDisplayIdle(bool) override {}
};