blob: 3f6ac8cc9710fdc5c0d6dba111c480f3861649b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#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<ThreadsCommutator> commutator,
ref_ptr<dp::TextureManager> texMng)
: m_tileKey(tileKey)
, m_commutator(commutator)
, m_texMng(texMng)
{}
ref_ptr<dp::TextureManager> EngineContext::GetTextureManager() const
{
return m_texMng;
}
void EngineContext::BeginReadTile()
{
PostMessage(make_unique_dp<TileReadStartMessage>(m_tileKey));
}
void EngineContext::Flush(TMapShapes && shapes)
{
PostMessage(make_unique_dp<MapShapeReadedMessage>(m_tileKey, move(shapes)));
}
void EngineContext::FlushOverlays(TMapShapes && shapes)
{
PostMessage(make_unique_dp<OverlayMapShapeReadedMessage>(m_tileKey, move(shapes)));
}
void EngineContext::EndReadTile()
{
PostMessage(make_unique_dp<TileReadEndMessage>(m_tileKey));
}
void EngineContext::PostMessage(drape_ptr<Message> && message)
{
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread, move(message),
MessagePriority::Normal);
}
} // namespace df
|