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

Commit a834dd6d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SurfaceFlinger: clear LayerHistory on touch" into qt-r1-dev

parents d9dbaba2 a9bf4cad
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -173,5 +173,18 @@ void LayerHistory::removeIrrelevantLayers() {
    }
}

void LayerHistory::clearHistory() {
    std::lock_guard lock(mLock);

    auto it = mActiveLayerInfos.begin();
    while (it != mActiveLayerInfos.end()) {
        auto id = it->first;
        auto layerInfo = it->second;
        layerInfo->clearHistory();
        mInactiveLayerInfos.insert({id, layerInfo});
        it = mActiveLayerInfos.erase(it);
    }
}

} // namespace scheduler
} // namespace android
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -64,6 +64,9 @@ public:
    // layers. See go/content-fps-detection-in-scheduler for more information.
    std::pair<float, bool> getDesiredRefreshRateAndHDR();

    // Clears all layer history.
    void clearHistory();

    // Removes the handle and the object from the map.
    void destroyLayer(const int64_t id);

+4 −0
Original line number Diff line number Diff line
@@ -407,6 +407,10 @@ void Scheduler::notifyTouchEvent() {
    if (mSupportKernelTimer) {
        resetIdleTimer();
    }

    // Touch event will boost the refresh rate to performance.
    // Clear Layer History to get fresh FPS detection
    mLayerHistory.clearHistory();
}

void Scheduler::resetTimerCallback() {