| 615 | } |
| 616 | |
| 617 | void RouteRenderer::AddSubrouteData(ref_ptr<dp::GraphicsContext> context, drape_ptr<SubrouteData> && subrouteData, |
| 618 | ref_ptr<gpu::ProgramManager> mng) |
| 619 | { |
| 620 | auto const it = FindSubroute(m_subroutes, subrouteData->m_subrouteId); |
| 621 | if (it != m_subroutes.end()) |
| 622 | { |
| 623 | if (!it->m_subrouteData.empty()) |
| 624 | { |
| 625 | int const recacheId = it->m_subrouteData.front()->m_recacheId; |
| 626 | if (recacheId < subrouteData->m_recacheId) |
| 627 | { |
| 628 | // Remove obsolete subroute data. |
| 629 | it->m_subrouteData.clear(); |
| 630 | it->m_markersData.reset(); |
| 631 | it->m_arrowsData.reset(); |
| 632 | it->m_arrowBorders.clear(); |
| 633 | |
| 634 | it->m_subroute = subrouteData->m_subroute; |
| 635 | it->m_subrouteId = subrouteData->m_subrouteId; |
| 636 | it->m_length = subrouteData->m_subroute->m_polyline.GetLength(); |
| 637 | } |
| 638 | else if (recacheId > subrouteData->m_recacheId) |
| 639 | { |
| 640 | return; |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | it->m_subrouteData.push_back(std::move(subrouteData)); |
| 645 | BuildBuckets(context, it->m_subrouteData.back()->m_renderProperty, mng); |
| 646 | } |
| 647 | else |
| 648 | { |
| 649 | // Add new subroute. |
| 650 | SubrouteInfo info; |
| 651 | info.m_subroute = subrouteData->m_subroute; |
| 652 | info.m_subrouteId = subrouteData->m_subrouteId; |
| 653 | info.m_length = subrouteData->m_subroute->m_polyline.GetLength(); |
| 654 | info.m_subrouteData.push_back(std::move(subrouteData)); |
| 655 | BuildBuckets(context, info.m_subrouteData.back()->m_renderProperty, mng); |
| 656 | m_subroutes.push_back(std::move(info)); |
| 657 | |
| 658 | std::sort(m_subroutes.begin(), m_subroutes.end(), [](SubrouteInfo const & info1, SubrouteInfo const & info2) |
| 659 | { return info1.m_subroute->m_baseDistance > info2.m_subroute->m_baseDistance; }); |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | void RouteRenderer::AddSubrouteArrowsData(ref_ptr<dp::GraphicsContext> context, |
| 664 | drape_ptr<SubrouteArrowsData> && routeArrowsData, |
no test coverage detected