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;