Commit 6f985973 authored by Wojciech Bielawski's avatar Wojciech Bielawski Committed by Commit Bot

Handle empty records in records_manager_'s queue properly

Update ImagePaintTimingDetector's last_registered_frame_index_ acordingly when empty records are removed from the records_manager_'s queue.

Bug: 1062974
Change-Id: I2e5923eb070249d6c561a4bac4defbf9345e5f72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108732Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756840}
parent 7a8c1223
...@@ -1004,6 +1004,7 @@ Vitaliy Kharin <kvserr@gmail.com> ...@@ -1004,6 +1004,7 @@ Vitaliy Kharin <kvserr@gmail.com>
Vivek Galatage <vivek.vg@samsung.com> Vivek Galatage <vivek.vg@samsung.com>
Volker Sorge <volker.sorge@gmail.com> Volker Sorge <volker.sorge@gmail.com>
Waihung Fu <fufranci@amazon.com> Waihung Fu <fufranci@amazon.com>
Wojciech Bielawski <wojciech.bielawski@gmail.com>
Wanming Lin <wanming.lin@intel.com> Wanming Lin <wanming.lin@intel.com>
Wei Li <wei.c.li@intel.com> Wei Li <wei.c.li@intel.com>
Wenxiang Qian <leonwxqian@gmail.com> Wenxiang Qian <leonwxqian@gmail.com>
......
...@@ -142,11 +142,11 @@ void ImagePaintTimingDetector::OnPaintFinished() { ...@@ -142,11 +142,11 @@ void ImagePaintTimingDetector::OnPaintFinished() {
.UpdateLargestContentfulPaintCandidate(); .UpdateLargestContentfulPaintCandidate();
} }
if (!records_manager_.HasUnregisteredRecordsInQueued( if (!records_manager_.HasUnregisteredRecordsInQueue(
last_registered_frame_index_)) last_registered_frame_index_))
return; return;
last_registered_frame_index_ = records_manager_.LastQueuedFrameIndex(); last_registered_frame_index_ = frame_index_ - 1;
RegisterNotifySwapTime(); RegisterNotifySwapTime();
} }
......
...@@ -122,7 +122,7 @@ class CORE_EXPORT ImageRecordsManager { ...@@ -122,7 +122,7 @@ class CORE_EXPORT ImageRecordsManager {
// Compare the last frame index in queue with the last frame index that has // Compare the last frame index in queue with the last frame index that has
// registered for assigning paint time. // registered for assigning paint time.
inline bool HasUnregisteredRecordsInQueued( inline bool HasUnregisteredRecordsInQueue(
unsigned last_registered_frame_index) { unsigned last_registered_frame_index) {
while (!images_queued_for_paint_time_.IsEmpty() && while (!images_queued_for_paint_time_.IsEmpty() &&
!images_queued_for_paint_time_.back()) { !images_queued_for_paint_time_.back()) {
...@@ -130,7 +130,6 @@ class CORE_EXPORT ImageRecordsManager { ...@@ -130,7 +130,6 @@ class CORE_EXPORT ImageRecordsManager {
} }
if (images_queued_for_paint_time_.IsEmpty()) if (images_queued_for_paint_time_.IsEmpty())
return false; return false;
DCHECK(last_registered_frame_index <= LastQueuedFrameIndex());
return last_registered_frame_index < LastQueuedFrameIndex(); return last_registered_frame_index < LastQueuedFrameIndex();
} }
void AssignPaintTimeToRegisteredQueuedRecords( void AssignPaintTimeToRegisteredQueuedRecords(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment