!11335 切帧时计算的nextVsyncTime时间戳不能提前

Merge pull request !11335 from shegangbin/fix_vsync_0522
This commit is contained in:
openharmony_ci 2024-05-23 11:19:21 +00:00 committed by Gitee
commit eb4e94facb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -361,9 +361,7 @@ int64_t VSyncGenerator::ComputeListenerNextVSyncTimeStamp(const Listener& listen
now -= phase;
if (now < 0) {
if (vsyncMode_ == VSYNC_MODE_LTPO) {
if (expectTimeFlag_) { // Ensure that nextTime is not earlier than referenceTime.
auto num = ((-now) / periodRecord_) * periodRecord_;
ScopedBytrace trace("sgb num:" + std::to_string(num) + ", now:" + std::to_string(now));
if (expectTimeFlag_ || refreshRateIsChanged_) { // Ensure that nextTime is not earlier than referenceTime.
now += ((-now) / periodRecord_) * periodRecord_;
}
now -= periodRecord_;