diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-26 15:27:11 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-30 19:04:41 +0300 |
commit | c3277e28e97e94e9556be64d312c104c31c39732 (patch) | |
tree | 67cbaf42e8f462fe6b27bcb7aa9703af8b2b45b9 /drape_frontend/requested_tiles.cpp | |
parent | ba0fea3aafbe888453e1fddca6299ceb1fc34e42 (diff) |
Added some rendering optimizations
Diffstat (limited to 'drape_frontend/requested_tiles.cpp')
-rwxr-xr-x | drape_frontend/requested_tiles.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drape_frontend/requested_tiles.cpp b/drape_frontend/requested_tiles.cpp new file mode 100755 index 0000000000..76d0cf4bfe --- /dev/null +++ b/drape_frontend/requested_tiles.cpp @@ -0,0 +1,38 @@ +#include "drape_frontend/requested_tiles.hpp" + +namespace df +{ + +void RequestedTiles::Set(ScreenBase const & screen, TTilesCollection && tiles) +{ + lock_guard<mutex> lock(m_mutex); + m_tiles = move(tiles); + m_screen = screen; +} + +TTilesCollection RequestedTiles::GetTiles() +{ + TTilesCollection tiles; + { + lock_guard<mutex> lock(m_mutex); + m_tiles.swap(tiles); + } + return tiles; +} + +ScreenBase RequestedTiles::GetScreen() +{ + lock_guard<mutex> lock(m_mutex); + return m_screen; +} + +bool RequestedTiles::CheckTileKey(TileKey const & tileKey) const +{ + lock_guard<mutex> lock(m_mutex); + if (m_tiles.empty()) + return true; + + return m_tiles.find(tileKey) != m_tiles.end(); +} + +} //namespace df |