From bc514eaa3210a5dd22707cfdf0eaa89774cb6790 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Thu, 11 Feb 2016 18:54:04 +0300 Subject: Overlay tree optimization --- drape/overlay_tree.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'drape/overlay_tree.hpp') diff --git a/drape/overlay_tree.hpp b/drape/overlay_tree.hpp index d56ef3b43f..878bd1938b 100644 --- a/drape/overlay_tree.hpp +++ b/drape/overlay_tree.hpp @@ -9,6 +9,7 @@ #include "std/array.hpp" #include "std/vector.hpp" +#include "std/unordered_map.hpp" namespace dp { @@ -39,12 +40,12 @@ class OverlayTree : public m4::Tree, detail::OverlayTrait public: OverlayTree(); - bool Frame(bool is3d); + bool Frame(); bool IsNeedUpdate() const; - void ForceUpdate(); void StartOverlayPlacing(ScreenBase const & screen); void Add(ref_ptr handle); + void Remove(ref_ptr handle); void EndOverlayPlacing(); void Select(m2::RectD const & rect, TOverlayContainer & result) const; @@ -72,11 +73,16 @@ private: ref_ptr const & parentOverlay); bool CheckHandle(ref_ptr handle, int currentRank, ref_ptr & parentOverlay) const; - void AddHandleToDelete(ref_ptr const & handle); + void DeleteHandle(ref_ptr const & handle); + + uint64_t GetHandleKey(ref_ptr const & handle) const; int m_frameCounter; array>, dp::OverlayRanksCount> m_handles; vector> m_handlesToDelete; + + unordered_map> m_handlesCache; + bool m_followingMode; #ifdef COLLECT_DISPLACEMENT_INFO -- cgit v1.2.3