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

Commit 5b581496 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

SF: Rename postComposition and related for clarity

The "post" in "postComposition" (and related "onPostComposition") can be
read as a preposition or a verb, making the name less easy to understand.

We believe "postComposition" is intended to mean "after composition".
More precisely, it is called after calling `present`, so rename to
"onCompositionPresented". Rename the related "postComposition" on other
classes (Layer, Scheduler) to match.

Splitting out from original motivating discussion in
Ib9d074671e32c95875ef7e0791dd95d6e595e47a.

Bug: 241285491
Bug: 259132483
Test: No new behavior; no new tests

Change-Id: I7f62728ea35aee47ebeac10dc7de82258080690e
parent fdf6ab9e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1341,7 +1341,7 @@ protected:
                newFrame->mRefreshes[0].mGpuCompositionDone.mFenceTime :
                FenceTime::NO_FENCE;
        // HWC2 releases the previous buffer after a new latch just before
        // calling postComposition.
        // calling onCompositionPresented.
        if (oldFrame != nullptr) {
            mCfeh->addRelease(nOldFrame, oldFrame->kDequeueReadyTime,
                    std::shared_ptr<FenceTime>(oldFrame->mRelease.mFenceTime));
+4 −4
Original line number Diff line number Diff line
@@ -4024,7 +4024,7 @@ bool Layer::isVisible() const {
    return getAlpha() > 0.0f || hasBlur();
}

void Layer::onPostComposition(const DisplayDevice* display,
void Layer::onCompositionPresented(const DisplayDevice* display,
                                   const std::shared_ptr<FenceTime>& glDoneFence,
                                   const std::shared_ptr<FenceTime>& presentFence,
                                   const CompositorTiming& compositorTiming) {
+4 −7
Original line number Diff line number Diff line
@@ -433,11 +433,8 @@ public:
    void updateCloneBufferInfo();
    uint64_t mPreviousFrameNumber = 0;

    /*
     * called after composition.
     * returns true if the layer latched a new buffer this frame.
     */
    void onPostComposition(const DisplayDevice*, const std::shared_ptr<FenceTime>& /*glDoneFence*/,
    void onCompositionPresented(const DisplayDevice*,
                                const std::shared_ptr<FenceTime>& /*glDoneFence*/,
                                const std::shared_ptr<FenceTime>& /*presentFence*/,
                                const CompositorTiming&);

+1 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,7 @@ void Scheduler::onNewVsyncPeriodChangeTimeline(const hal::VsyncPeriodChangeTimel
    }
}

bool Scheduler::onPostComposition(nsecs_t presentTime) {
bool Scheduler::onCompositionPresented(nsecs_t presentTime) {
    std::lock_guard<std::mutex> lock(mVsyncTimelineLock);
    if (mLastVsyncPeriodChangeTimeline && mLastVsyncPeriodChangeTimeline->refreshRequired) {
        if (presentTime < mLastVsyncPeriodChangeTimeline->refreshTimeNanos) {
+2 −2
Original line number Diff line number Diff line
@@ -281,8 +281,8 @@ public:
    // Notifies the scheduler about a refresh rate timeline change.
    void onNewVsyncPeriodChangeTimeline(const hal::VsyncPeriodChangeTimeline& timeline);

    // Notifies the scheduler post composition. Returns if recomposite is needed.
    bool onPostComposition(nsecs_t presentTime);
    // Notifies the scheduler once the composition is presented. Returns if recomposite is needed.
    bool onCompositionPresented(nsecs_t presentTime);

    // Notifies the scheduler when the display size has changed. Called from SF's main thread
    void onActiveDisplayAreaChanged(uint32_t displayArea);
Loading