compositor_wayland: count rendering time for all steps of compositing

Otherwise, prePaintPass, postPaintPass and possible future overhead like overlay
plane matching aren't accounted for, which can cause frames to be dropped.

CCBUG: 488782
This commit is contained in:
Xaver Hugl 2024-07-17 23:06:13 +02:00
parent 7b486e215d
commit c3d202b0d2

View file

@ -293,6 +293,7 @@ void WaylandCompositor::composite(RenderLoop *renderLoop)
auto frame = std::make_shared<OutputFrame>(renderLoop, std::chrono::nanoseconds(1'000'000'000'000 / output->refreshRate()));
if (primaryLayer->needsRepaint() || superLayer->needsRepaint()) {
auto totalTimeQuery = std::make_unique<CpuRenderTimeQuery>();
renderLoop->beginPaint();
QRegion surfaceDamage = primaryLayer->repaints();
@ -340,6 +341,8 @@ void WaylandCompositor::composite(RenderLoop *renderLoop)
}
postPaintPass(superLayer);
totalTimeQuery->end();
frame->addRenderTimeQuery(std::move(totalTimeQuery));
}
m_backend->present(output, frame);