Decreased maximum time unsorted components can take to draw before forcing a cache rebuild

This commit is contained in:
Yousef Khadadeh 2025-08-08 10:52:58 +03:00
parent c8b6ed58e7
commit 65b28732d8

View file

@ -591,7 +591,9 @@ void DrawingProgram::draw(SkCanvas* canvas, const DrawData& drawData) {
drawTool->draw(canvas, drawData);
if(timeToDrawUnsortedComponents >= std::chrono::microseconds(16000))
// 10ms is an arbitrary value. If drawing only the unsorted components takes more than that amount of time,
// they're definitely causing lag and must be sorted so that they can be cached
if(timeToDrawUnsortedComponents >= std::chrono::microseconds(10000))
force_rebuild_cache();
}