diff options
author | Ady Abraham <adyabr@google.com> | 2019-08-12 09:41:46 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-08-12 09:41:46 -0700 |
commit | 549ea7ebb29e5bd24896de32802c7c23f9a0d359 (patch) | |
tree | 01058a995df930c740f6837622768eb107836dc0 | |
parent | e560a35f22e5bebb21adf1c34675e866c8604b17 (diff) | |
parent | cdd0f9d88e8dec40629f60726212e26397a76475 (diff) | |
download | native-549ea7ebb29e5bd24896de32802c7c23f9a0d359.tar.gz |
SurfaceFlinger: clamp frame refresh duration to min refresh duration
am: cdd0f9d88e
Change-Id: If41bf13911c9d8c9411ba87a7766cf8bc450926b
-rw-r--r-- | services/surfaceflinger/Scheduler/LayerInfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/surfaceflinger/Scheduler/LayerInfo.cpp b/services/surfaceflinger/Scheduler/LayerInfo.cpp index e782dd5361..723d71ff39 100644 --- a/services/surfaceflinger/Scheduler/LayerInfo.cpp +++ b/services/surfaceflinger/Scheduler/LayerInfo.cpp @@ -49,7 +49,7 @@ void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime) { mLastPresentTime = lastPresentTime; // Ignore time diff that are too high - those are stale values if (timeDiff > OBSOLETE_TIME_EPSILON_NS.count()) return; - const nsecs_t refreshDuration = (timeDiff > 0) ? timeDiff : mMinRefreshDuration; + const nsecs_t refreshDuration = std::max(timeDiff, mMinRefreshDuration); const int fps = 1e9f / refreshDuration; mRefreshRateHistory.insertRefreshRate(fps); } |