| 333 | } |
| 334 | |
| 335 | void OverlayTree::EndOverlayPlacing() |
| 336 | { |
| 337 | ASSERT(IsNeedUpdate(), ()); |
| 338 | |
| 339 | m_displacers.clear(); |
| 340 | |
| 341 | #ifdef DEBUG_OVERLAYS_OUTPUT |
| 342 | LOG(LINFO, ("- BEGIN OVERLAYS PLACING")); |
| 343 | #endif |
| 344 | |
| 345 | HandleComparator comparator(false /* enableMask */); |
| 346 | |
| 347 | for (int rank = 0; rank < dp::OverlayRanksCount; rank++) |
| 348 | { |
| 349 | std::sort(m_handles[rank].begin(), m_handles[rank].end(), comparator); |
| 350 | |
| 351 | for (auto const & handle : m_handles[rank]) |
| 352 | { |
| 353 | ref_ptr<OverlayHandle> parentOverlay; |
| 354 | if (CheckHandle(handle, rank, parentOverlay)) |
| 355 | InsertHandle(handle, rank, parentOverlay); |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | for (int rank = 0; rank < dp::OverlayRanksCount; rank++) |
| 360 | { |
| 361 | for (auto const & handle : m_handles[rank]) |
| 362 | handle->SetDisplayFlag(false); |
| 363 | m_handles[rank].clear(); |
| 364 | } |
| 365 | |
| 366 | for (auto const & handle : m_handlesCache) |
| 367 | { |
| 368 | handle->SetDisplayFlag(true); |
| 369 | handle->SetIsVisible(true); |
| 370 | handle->EnableCaching(false); |
| 371 | } |
| 372 | |
| 373 | m_frameCounter = 0; |
| 374 | |
| 375 | #ifdef DEBUG_OVERLAYS_OUTPUT |
| 376 | LOG(LINFO, ("- END OVERLAYS PLACING")); |
| 377 | #endif |
| 378 | } |
| 379 | |
| 380 | bool OverlayTree::CheckHandle(ref_ptr<OverlayHandle> handle, int currentRank, |
| 381 | ref_ptr<OverlayHandle> & parentOverlay) const |
no test coverage detected