@@ -479,7 +479,8 @@ void EasyGraphicsView::setTree(const ::profiler::thread_blocks_tree_t& _blocksTr
479
479
480
480
if (!t.children .empty ())
481
481
{
482
- children_duration = setTree (item, t.children , h, y, 0 );
482
+ uint32_t dummy = 0 ;
483
+ children_duration = setTree (item, t.children , h, dummy, y, 0 );
483
484
}
484
485
else
485
486
{
@@ -551,7 +552,7 @@ const EasyGraphicsView::Items &EasyGraphicsView::getItems() const
551
552
return m_items;
552
553
}
553
554
554
- qreal EasyGraphicsView::setTree (EasyGraphicsItem* _item, const ::profiler::BlocksTree::children_t & _children, qreal& _height, qreal _y, short _level)
555
+ qreal EasyGraphicsView::setTree (EasyGraphicsItem* _item, const ::profiler::BlocksTree::children_t & _children, qreal& _height, uint32_t & _maxDepthChild, qreal _y, short _level)
555
556
{
556
557
if (_children.empty ())
557
558
{
@@ -562,6 +563,8 @@ qreal EasyGraphicsView::setTree(EasyGraphicsItem* _item, const ::profiler::Block
562
563
const auto n = static_cast <unsigned int >(_children.size ());
563
564
_item->reserve (level, n);
564
565
566
+ _maxDepthChild = 0 ;
567
+ uint16_t maxDepth = 0 ;
565
568
const short next_level = _level + 1 ;
566
569
bool warned = false ;
567
570
qreal total_duration = 0 , prev_end = 0 , maxh = 0 ;
@@ -571,6 +574,11 @@ qreal EasyGraphicsView::setTree(EasyGraphicsItem* _item, const ::profiler::Block
571
574
{
572
575
auto & gui_block = easyBlock (child_index);
573
576
const auto & child = gui_block.tree ;
577
+ if (child.depth > maxDepth)
578
+ {
579
+ maxDepth = child.depth ;
580
+ _maxDepthChild = j;
581
+ }
574
582
575
583
auto xbegin = time2position (child.node ->begin ());
576
584
if (start_time < 0 )
@@ -609,10 +617,11 @@ qreal EasyGraphicsView::setTree(EasyGraphicsItem* _item, const ::profiler::Block
609
617
610
618
qreal h = 0 ;
611
619
qreal children_duration = 0 ;
620
+ uint32_t maxDepthChild = 0 ;
612
621
613
622
if (next_level < 256 )
614
623
{
615
- children_duration = setTree (_item, child.children , h, _y + ::profiler_gui::GRAPHICS_ROW_SIZE_FULL, next_level);
624
+ children_duration = setTree (_item, child.children , h, maxDepthChild, _y + ::profiler_gui::GRAPHICS_ROW_SIZE_FULL, next_level);
616
625
}
617
626
else if (!child.children .empty () && !warned)
618
627
{
@@ -631,10 +640,16 @@ qreal EasyGraphicsView::setTree(EasyGraphicsItem* _item, const ::profiler::Block
631
640
}
632
641
633
642
b.block = child_index;// &child;
643
+
644
+ #ifndef EASY_GRAPHICS_ITEM_RECURSIVE_PAINT
634
645
b.neighbours = n;
646
+ b.state = j > 0 || level == 0 ? 0 : -1 ;
647
+ #else
648
+ b.max_depth_child = maxDepthChild;
649
+ #endif
650
+
635
651
b.setPos (xbegin, duration);
636
652
// b.totalHeight = ::profiler_gui::GRAPHICS_ROW_SIZE + h;
637
- b.state = j > 0 || level == 0 ? 0 : -1 ;
638
653
639
654
prev_end = xbegin + duration;
640
655
total_duration = prev_end - start_time;
0 commit comments