| 1714 | } |
| 1715 | |
| 1716 | void FrontendRenderer::RenderFrame() |
| 1717 | { |
| 1718 | TRACE_SECTION("[drape] RenderFrame"); |
| 1719 | DrapeMeasurerGuard drapeMeasurerGuard; |
| 1720 | |
| 1721 | CHECK(m_context != nullptr, ()); |
| 1722 | if (!m_context->Validate()) |
| 1723 | { |
| 1724 | m_frameData.m_forceFullRedrawNextFrame = true; |
| 1725 | m_frameData.m_inactiveFramesCounter = 0; |
| 1726 | return; |
| 1727 | } |
| 1728 | |
| 1729 | auto & scaleFpsHelper = gui::DrapeGui::Instance().GetScaleFpsHelper(); |
| 1730 | m_frameData.m_timer.Reset(); |
| 1731 | |
| 1732 | bool modelViewChanged, viewportChanged, needActiveFrame; |
| 1733 | ScreenBase const & modelView = ProcessEvents(modelViewChanged, viewportChanged, needActiveFrame); |
| 1734 | if (viewportChanged || m_needRestoreSize) |
| 1735 | OnResize(modelView); |
| 1736 | |
| 1737 | if (!m_context->BeginRendering()) |
| 1738 | return; |
| 1739 | |
| 1740 | // Check for a frame is active. |
| 1741 | bool isActiveFrame = modelViewChanged || viewportChanged || needActiveFrame; |
| 1742 | |
| 1743 | if (isActiveFrame) |
| 1744 | PrepareScene(modelView); |
| 1745 | |
| 1746 | bool const needUpdateDynamicTextures = m_texMng->UpdateDynamicTextures(m_context); |
| 1747 | isActiveFrame |= needUpdateDynamicTextures; |
| 1748 | isActiveFrame |= m_userEventStream.IsWaitingForActionCompletion(); |
| 1749 | isActiveFrame |= InterpolationHolder::Instance().IsActive(); |
| 1750 | |
| 1751 | bool isActiveFrameForScene = isActiveFrame || m_frameData.m_forceFullRedrawNextFrame; |
| 1752 | if (AnimationSystem::Instance().HasAnimations()) |
| 1753 | { |
| 1754 | isActiveFrameForScene |= AnimationSystem::Instance().HasMapAnimations(); |
| 1755 | isActiveFrame = true; |
| 1756 | } |
| 1757 | |
| 1758 | m_routeRenderer->UpdatePreview(modelView); |
| 1759 | |
| 1760 | #ifdef SHOW_FRAMES_STATS |
| 1761 | m_frameData.m_framesOverall += static_cast<uint64_t>(isActiveFrame); |
| 1762 | m_frameData.m_framesFast += static_cast<uint64_t>(!isActiveFrameForScene); |
| 1763 | #endif |
| 1764 | |
| 1765 | RenderScene(modelView, isActiveFrameForScene); |
| 1766 | |
| 1767 | if (m_renderInjectionHandler) |
| 1768 | m_renderInjectionHandler(m_context, m_texMng, make_ref(m_gpuProgramManager), false); |
| 1769 | |
| 1770 | m_context->EndRendering(); |
| 1771 | |
| 1772 | auto const hasForceUpdate = m_forceUpdateScene || m_forceUpdateUserMarks; |
| 1773 | isActiveFrame |= hasForceUpdate; |
nothing calls this directly
no test coverage detected