forked from organicmaps/organicmaps
Fixed updating maps style
This commit is contained in:
parent
743f9990a8
commit
985a07f1b5
4 changed files with 12 additions and 18 deletions
|
@ -148,8 +148,8 @@ void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
|
|||
case Message::GuiRecache:
|
||||
{
|
||||
ref_ptr<GuiRecacheMessage> msg = message;
|
||||
RecacheGui(msg->GetInitInfo(), msg->NeedResetOldGui());
|
||||
|
||||
m_lastWidgetsInfo = msg->GetInitInfo();
|
||||
RecacheGui(m_lastWidgetsInfo, msg->NeedResetOldGui());
|
||||
#ifdef RENDER_DEBUG_INFO_LABELS
|
||||
RecacheDebugLabels();
|
||||
#endif
|
||||
|
@ -335,6 +335,10 @@ void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
|
|||
{
|
||||
m_texMng->OnSwitchMapStyle();
|
||||
RecacheMapShapes();
|
||||
RecacheGui(m_lastWidgetsInfo, false /* needResetOldGui */);
|
||||
#ifdef RENDER_DEBUG_INFO_LABELS
|
||||
RecacheDebugLabels();
|
||||
#endif
|
||||
m_trafficGenerator->InvalidateTexturesCache();
|
||||
m_transitBuilder->RebuildSchemes(m_texMng);
|
||||
break;
|
||||
|
|
|
@ -124,6 +124,8 @@ private:
|
|||
|
||||
drape_ptr<MetalineManager> m_metalineManager;
|
||||
|
||||
gui::TWidgetsInitInfo m_lastWidgetsInfo;
|
||||
|
||||
#ifdef DEBUG
|
||||
bool m_isTeardowned;
|
||||
#endif
|
||||
|
|
|
@ -369,17 +369,9 @@ void DrapeEngine::InvalidateRect(m2::RectD const & rect)
|
|||
|
||||
void DrapeEngine::UpdateMapStyle()
|
||||
{
|
||||
// Update map style.
|
||||
{
|
||||
UpdateMapStyleMessage::Blocker blocker;
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||
make_unique_dp<UpdateMapStyleMessage>(blocker),
|
||||
MessagePriority::High);
|
||||
blocker.Wait();
|
||||
}
|
||||
|
||||
// Recache gui after updating of style.
|
||||
RecacheGui(false);
|
||||
m_threadCommutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||
make_unique_dp<UpdateMapStyleMessage>(),
|
||||
MessagePriority::High);
|
||||
}
|
||||
|
||||
void DrapeEngine::RecacheMapShapes()
|
||||
|
|
|
@ -673,13 +673,9 @@ private:
|
|||
bool m_isVisible;
|
||||
};
|
||||
|
||||
class UpdateMapStyleMessage : public BaseBlockingMessage
|
||||
class UpdateMapStyleMessage : public Message
|
||||
{
|
||||
public:
|
||||
UpdateMapStyleMessage(Blocker & blocker)
|
||||
: BaseBlockingMessage(blocker)
|
||||
{}
|
||||
|
||||
Type GetType() const override { return Message::UpdateMapStyle; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue