From 466aa717ade04f7abcbb3e4e02c548039fb3d237 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 19 Feb 2022 19:40:19 +0300 Subject: [PATCH] Log max batch count in ui painter --- libs/ui/source/painter_impl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/ui/source/painter_impl.cpp b/libs/ui/source/painter_impl.cpp index b233d829..17896fba 100644 --- a/libs/ui/source/painter_impl.cpp +++ b/libs/ui/source/painter_impl.cpp @@ -4,6 +4,7 @@ #include #include +#include #include @@ -223,6 +224,8 @@ void main() std::vector> batches; + std::size_t max_batch_count = 0; + template Batch & batch(Batch && n) { @@ -259,7 +262,10 @@ void main() : pimpl_{make_impl()} {} - painter_impl::~painter_impl() = default; + painter_impl::~painter_impl() + { + log::debug() << "UI painter max batch count: " << impl().max_batch_count; + } void painter_impl::draw_rect(geom::box const & rect, gfx::color_rgba const & color) { @@ -518,6 +524,9 @@ void main() for (auto const & b : impl().batches) std::visit(batch_visitor, b); + + impl().max_batch_count = std::max(impl().max_batch_count, impl().batches.size()); + impl().depth = 0; impl().batches.clear(); impl().stencil_level = 0;