From 8f75a40346060388c42f74cf36356c8e78c63140 Mon Sep 17 00:00:00 2001 From: vng Date: Thu, 25 Oct 2012 20:17:15 +0300 Subject: [PATCH] Revert "fully caching location::State in DisplayList's." This reverts commit 8d0d040fb2d07aa0c1a8685841d77b90f3c1b70e. --- map/location_state.cpp | 59 +++++++----------------------------------- map/location_state.hpp | 5 ---- 2 files changed, 10 insertions(+), 54 deletions(-) diff --git a/map/location_state.cpp b/map/location_state.cpp index 3ef1302462..8f1a291f57 100644 --- a/map/location_state.cpp +++ b/map/location_state.cpp @@ -26,8 +26,6 @@ namespace location { - double const State::s_cacheRadius = 500; - State::Params::Params() {} @@ -288,44 +286,12 @@ namespace location cacheScreen->endFrame(); } - void State::cacheLocationMark() - { - yg::gl::Screen * cacheScreen = m_controller->GetCacheScreen(); - - m_locationMarkDL.reset(); - m_locationMarkDL.reset(cacheScreen->createDisplayList()); - - m_positionMarkDL.reset(); - m_positionMarkDL.reset(cacheScreen->createDisplayList()); - - cacheScreen->beginFrame(); - cacheScreen->setDisplayList(m_locationMarkDL.get()); - - cacheScreen->fillSector(m2::PointD(0, 0), - 0, 2.0 * math::pi, - s_cacheRadius, - m_locationAreaColor, - depth() - 3); - - cacheScreen->setDisplayList(m_positionMarkDL.get()); - - cacheScreen->drawSymbol(m2::PointD(0, 0), - "current-position", - yg::EPosCenter, - depth() - 1); - - cacheScreen->setDisplayList(0); - - cacheScreen->endFrame(); - } - void State::cache() { cacheArrowBody(EActive); cacheArrowBorder(EActive); cacheArrowBody(EPressed); cacheArrowBorder(EPressed); - cacheLocationMark(); m_controller->GetCacheScreen()->completeCommands(); } @@ -375,7 +341,6 @@ namespace location { double screenAngle = m_framework->GetNavigator().Screen().GetAngle(); math::Matrix compassDrawM; - math::Matrix locationDrawM; /// drawing arrow body first if (m_hasCompass) @@ -407,25 +372,21 @@ namespace location double const pxErrorRadius = pxPosition.Length( m_framework->GetNavigator().GtoP(Position() + m2::PointD(m_errorRadius, 0.0))); - double const drawScale = pxErrorRadius / s_cacheRadius; - - locationDrawM = - math::Shift( - math::Scale( - math::Identity(), - drawScale, - drawScale), - pivot()); - - math::Matrix const drawM = locationDrawM * m; if (!m_hasCompass) - m_positionMarkDL->draw(drawM); + r->drawSymbol(pxPosition, + "current-position", + yg::EPosCenter, + depth() - 1); - m_locationMarkDL->draw(drawM); + r->fillSector(pxPosition, + 0, 2.0 * math::pi, + pxErrorRadius, + m_locationAreaColor, + depth() - 3); /// and then arrow border - if (m_hasCompass) + if (m_hasCompass) { map >::const_iterator it; it = m_arrowBorderLists.find(state()); diff --git a/map/location_state.hpp b/map/location_state.hpp index 8899fc3232..3bffa15741 100644 --- a/map/location_state.hpp +++ b/map/location_state.hpp @@ -56,8 +56,6 @@ namespace location private: - static const double s_cacheRadius; - double m_errorRadius; //< error radius in mercator m2::PointD m_position; //< position in mercator @@ -93,14 +91,11 @@ namespace location map > m_arrowBodyLists; map > m_arrowBorderLists; - shared_ptr m_locationMarkDL; - shared_ptr m_positionMarkDL; /// @} void cacheArrowBorder(EState state); void cacheArrowBody(EState state); - void cacheLocationMark(); void cache(); void purge();