From c3d202b0d251de46cce2ff1c8274e7b843b9abcf Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 17 Jul 2024 23:06:13 +0200 Subject: [PATCH] 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 --- src/compositor_wayland.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compositor_wayland.cpp b/src/compositor_wayland.cpp index 6b193f0912..6120700470 100644 --- a/src/compositor_wayland.cpp +++ b/src/compositor_wayland.cpp @@ -293,6 +293,7 @@ void WaylandCompositor::composite(RenderLoop *renderLoop) auto frame = std::make_shared(renderLoop, std::chrono::nanoseconds(1'000'000'000'000 / output->refreshRate())); if (primaryLayer->needsRepaint() || superLayer->needsRepaint()) { + auto totalTimeQuery = std::make_unique(); 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);