LibWeb: Skip queuing a rendering task if task queue already contains it

If, by the time we need to schedule rendering of the next frame, the
previous one is still not processed, we could skip it instead of growing
task queue.

Should help with https://github.com/LadybirdBrowser/ladybird/issues/1647
This commit is contained in:
Aliaksandr Kalenik 2024-10-06 15:16:35 +02:00 committed by Alexander Kalenik
parent ea971792b5
commit 908455ab06
Notes: github-actions[bot] 2024-10-06 14:26:28 +00:00
3 changed files with 15 additions and 0 deletions

View file

@ -88,4 +88,13 @@ Task const* TaskQueue::last_added_task() const
return m_tasks.last();
}
bool TaskQueue::has_rendering_tasks() const
{
for (auto const& task : m_tasks) {
if (task->source() == Task::Source::Rendering)
return true;
}
return false;
}
}