diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index eb2faf734d..c49710f161 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -527,7 +527,7 @@ void FrontendRenderer::Routine::Do() timer.Reset(); double frameTime = 0.0; - bool isInactiveLastFrame = false; + int inactiveFrameCount = 0; bool viewChanged = true; ScreenBase modelView = m_renderer.UpdateScene(viewChanged); while (!IsCancelled()) @@ -538,13 +538,16 @@ void FrontendRenderer::Routine::Do() bool const animActive = InterpolationHolder::Instance().Advance(frameTime); modelView = m_renderer.UpdateScene(viewChanged); - bool const isInactiveCurrentFrame = (!viewChanged && m_renderer.IsQueueEmpty() && !animActive); + if (!viewChanged && m_renderer.IsQueueEmpty() && !animActive) + ++inactiveFrameCount; + else + inactiveFrameCount = 0; - if (isInactiveLastFrame && isInactiveCurrentFrame) + if (inactiveFrameCount > 60) { // process a message or wait for a message m_renderer.ProcessSingleMessage(); - isInactiveLastFrame = false; + inactiveFrameCount = 0; } else { @@ -561,7 +564,6 @@ void FrontendRenderer::Routine::Do() } //processingTime = (timer.ElapsedSeconds() - processingTime) / messageCount; - isInactiveLastFrame = isInactiveCurrentFrame; } context->present(); diff --git a/drape_gui/ruler.cpp b/drape_gui/ruler.cpp index 1b99b590fa..48599074fb 100644 --- a/drape_gui/ruler.cpp +++ b/drape_gui/ruler.cpp @@ -85,17 +85,24 @@ class RulerTextHandle : public MutableLabelHandle public: RulerTextHandle(dp::Anchor anchor, m2::PointF const & pivot) : MutableLabelHandle(anchor, pivot) + , m_firstUpdate(true) { } void Update(ScreenBase const & screen) override { SetIsVisible(DrapeGui::GetRulerHelper().IsVisible(screen)); - if (IsVisible() && DrapeGui::GetRulerHelper().IsTextDirty()) + if ((IsVisible() && DrapeGui::GetRulerHelper().IsTextDirty()) || m_firstUpdate) + { SetContent(DrapeGui::GetRulerHelper().GetRulerText()); + m_firstUpdate = false; + } TBase::Update(screen); } + +private: + bool m_firstUpdate; }; }