mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
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:
parent
ea971792b5
commit
908455ab06
Notes:
github-actions[bot]
2024-10-06 14:26:28 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 908455ab06
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1649
Reviewed-by: https://github.com/awesomekling ✅
3 changed files with 15 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue