Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr.kuznetsov <r.kuznetsov@corp.mail.ru>2018-07-11 12:38:39 +0300
committerVlad Mihaylenko <vxmihaylenko@gmail.com>2018-07-20 14:51:41 +0300
commit62342ae55153faa726593c6efa3b0e201206e126 (patch)
tree05dd330dbe9ea6f6da630707aa2d5cea117b5ab4 /drape_frontend
parentee1d147007661b6b79ac5511779031d86d62a50e (diff)
Fixed fast frames rendering
Diffstat (limited to 'drape_frontend')
-rw-r--r--drape_frontend/animation_system.cpp11
-rw-r--r--drape_frontend/animation_system.hpp2
-rwxr-xr-xdrape_frontend/frontend_renderer.cpp27
3 files changed, 22 insertions, 18 deletions
diff --git a/drape_frontend/animation_system.cpp b/drape_frontend/animation_system.cpp
index 2c0b2aa1cd..bf8ed2e3cc 100644
--- a/drape_frontend/animation_system.cpp
+++ b/drape_frontend/animation_system.cpp
@@ -156,18 +156,15 @@ bool AnimationSystem::HasAnimations() const
return !m_animationChain.empty();
}
-bool AnimationSystem::HasOnlyArrowAnimations() const
+bool AnimationSystem::HasMapAnimations() const
{
- if (!HasAnimations())
- return false;
-
if (AnimationExists(Animation::Object::MapPlane))
- return false;
+ return true;
if (AnimationExists(Animation::Object::Selection))
- return false;
+ return true;
- return true;
+ return false;
}
AnimationSystem & AnimationSystem::Instance()
diff --git a/drape_frontend/animation_system.hpp b/drape_frontend/animation_system.hpp
index a7d42e857a..6ececf98ad 100644
--- a/drape_frontend/animation_system.hpp
+++ b/drape_frontend/animation_system.hpp
@@ -33,7 +33,7 @@ public:
bool AnimationExists(Animation::Object object) const;
bool HasAnimations() const;
- bool HasOnlyArrowAnimations() const;
+ bool HasMapAnimations() const;
void CombineAnimation(drape_ptr<Animation> && animation);
void PushAnimation(drape_ptr<Animation> && animation);
diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp
index 8a93ac4934..a00c406a9f 100755
--- a/drape_frontend/frontend_renderer.cpp
+++ b/drape_frontend/frontend_renderer.cpp
@@ -2000,6 +2000,7 @@ void FrontendRenderer::Routine::Do()
bool viewportChanged = true;
bool invalidContext = false;
uint32_t inactiveFramesCounter = 0;
+ bool forceFullRedrawNextFrame = false;
uint32_t constexpr kMaxInactiveFrames = 2;
dp::OGLContext * context = m_renderer.m_contextFactory->getDrawContext();
@@ -2009,17 +2010,18 @@ void FrontendRenderer::Routine::Do()
scaleFpsHelper.SetVisible(true);
#endif
+ m_renderer.ScheduleOverlayCollecting();
+
+#ifdef SHOW_FRAMES_STATS
uint64_t framesOverall = 0;
uint64_t framesFast = 0;
- m_renderer.ScheduleOverlayCollecting();
-
- // Uncomment only for debug purposes!
-// m_renderer.m_notifier->Notify(ThreadsCommutator::RenderThread, std::chrono::seconds(5),
-// true /* repeating */, [&framesOverall, &framesFast](uint64_t)
-// {
-// LOG(LINFO, ("framesOverall =", framesOverall, "framesFast =", framesFast));
-// });
+ m_renderer.m_notifier->Notify(ThreadsCommutator::RenderThread, std::chrono::seconds(5),
+ true /* repeating */, [&framesOverall, &framesFast](uint64_t)
+ {
+ LOG(LINFO, ("framesOverall =", framesOverall, "framesFast =", framesFast));
+ });
+#endif
while (!IsCancelled())
{
@@ -2042,17 +2044,19 @@ void FrontendRenderer::Routine::Do()
isActiveFrame |= m_renderer.m_userEventStream.IsWaitingForActionCompletion();
isActiveFrame |= InterpolationHolder::Instance().IsActive();
- bool isActiveFrameForScene = isActiveFrame;
+ bool isActiveFrameForScene = isActiveFrame || forceFullRedrawNextFrame;
if (AnimationSystem::Instance().HasAnimations())
{
- isActiveFrameForScene |= !AnimationSystem::Instance().HasOnlyArrowAnimations();
+ isActiveFrameForScene |= AnimationSystem::Instance().HasMapAnimations();
isActiveFrame = true;
}
m_renderer.m_routeRenderer->UpdatePreview(modelView);
+#ifdef SHOW_FRAMES_STATS
framesOverall += static_cast<uint64_t>(isActiveFrame);
framesFast += static_cast<uint64_t>(!isActiveFrameForScene);
+#endif
m_renderer.RenderScene(modelView, isActiveFrameForScene);
@@ -2078,12 +2082,14 @@ void FrontendRenderer::Routine::Do()
}
bool const canSuspend = inactiveFramesCounter > kMaxInactiveFrames;
+ forceFullRedrawNextFrame = m_renderer.m_overlayTree->IsNeedUpdate();
if (canSuspend)
{
// Process a message or wait for a message.
// IsRenderingEnabled() can return false in case of rendering disabling and we must prevent
// possibility of infinity waiting in ProcessSingleMessage.
m_renderer.ProcessSingleMessage(m_renderer.IsRenderingEnabled());
+ forceFullRedrawNextFrame = true;
timer.Reset();
inactiveFramesCounter = 0;
}
@@ -2094,6 +2100,7 @@ void FrontendRenderer::Routine::Do()
{
if (!m_renderer.ProcessSingleMessage(false /* waitForMessage */))
break;
+ forceFullRedrawNextFrame = true;
inactiveFramesCounter = 0;
availableTime = kVSyncInterval - timer.ElapsedSeconds();
}