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

Commit e387960d authored by Su Hong Koo's avatar Su Hong Koo Committed by Android (Google) Code Review
Browse files

Merge "SF: Invoke DisplayDevice::animate*Overlay() on all displays" into main

parents a8299895 5a4fce8f
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -475,11 +475,17 @@ void DisplayDevice::onVrrIdle(bool idle) {
    }
}

void DisplayDevice::animateOverlay() {
void DisplayDevice::animateRefreshRateOverlay() {
    if (mRefreshRateOverlay) {
        mRefreshRateOverlay->animate();
    }
    if (mHdrSdrRatioOverlay) {
}

void DisplayDevice::animateHdrSdrRatioOverlay() {
    if (!mHdrSdrRatioOverlay) {
        return;
    }

    // hdr sdr ratio is designed to be on the top right of the screen,
    // therefore, we need to re-calculate the display's width and height
    if (mIsOrientationChanged) {
@@ -492,7 +498,6 @@ void DisplayDevice::animateOverlay() {
    }
    mHdrSdrRatioOverlay->animate();
}
}

void DisplayDevice::adjustRefreshRate(Fps pacesetterDisplayRefreshRate) {
    using fps_approx_ops::operator<=;
+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ public:
            REQUIRES(kMainThreadContext);
    void updateRefreshRateOverlayRate(Fps refreshRate, Fps renderFps, bool setByHwc = false);
    bool isRefreshRateOverlayEnabled() const { return mRefreshRateOverlay != nullptr; }
    void animateOverlay();
    void animateRefreshRateOverlay();
    void animateHdrSdrRatioOverlay();
    bool onKernelTimerChanged(std::optional<DisplayModeId>, bool timerExpired);
    void onVrrIdle(bool idle);

+9 −3
Original line number Diff line number Diff line
@@ -2778,10 +2778,16 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId,
        mPowerAdvisor->updateTargetWorkDuration(idealVsyncPeriod);
    }

    if (mRefreshRateOverlaySpinner || mHdrSdrRatioOverlay) {
    if (mRefreshRateOverlaySpinner) {
        Mutex::Autolock lock(mStateLock);
        if (const auto display = getDefaultDisplayDeviceLocked()) {
            display->animateOverlay();
        for (const auto& [_, display] : mDisplays) {
            display->animateRefreshRateOverlay();
        }
    }
    if (mHdrSdrRatioOverlay) {
        Mutex::Autolock lock(mStateLock);
        for (const auto& [_, display] : mDisplays) {
            display->animateHdrSdrRatioOverlay();
        }
    }