#include "drape_frontend/engine_context.hpp" #include "drape_frontend/message_subclasses.hpp" #include "drape/texture_manager.hpp" #include "std/algorithm.hpp" namespace df { EngineContext::EngineContext(TileKey tileKey, ref_ptr commutator, ref_ptr texMng) : m_tileKey(tileKey) , m_commutator(commutator) , m_texMng(texMng) {} ref_ptr EngineContext::GetTextureManager() const { return m_texMng; } void EngineContext::BeginReadTile() { PostMessage(make_unique_dp(m_tileKey)); } void EngineContext::Flush(TMapShapes && shapes) { PostMessage(make_unique_dp(m_tileKey, move(shapes))); } void EngineContext::FlushOverlays(TMapShapes && shapes) { PostMessage(make_unique_dp(m_tileKey, move(shapes))); } void EngineContext::FlushTrafficGeometry(TrafficSegmentsGeometry && geometry) { m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread, make_unique_dp(m_tileKey, move(geometry)), MessagePriority::Low); } void EngineContext::EndReadTile() { PostMessage(make_unique_dp(m_tileKey)); } void EngineContext::PostMessage(drape_ptr && message) { m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread, move(message), MessagePriority::Normal); } } // namespace df