From 23fc0090eeb3498748a464da109c2e843aeea79c Mon Sep 17 00:00:00 2001 From: vng Date: Tue, 12 Apr 2016 19:44:53 +0300 Subject: [PATCH] Call FeatureType::GetLimitRect after all minor checks. --- drape_frontend/rule_drawer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drape_frontend/rule_drawer.cpp b/drape_frontend/rule_drawer.cpp index fe2677a749..d402650bb5 100644 --- a/drape_frontend/rule_drawer.cpp +++ b/drape_frontend/rule_drawer.cpp @@ -84,19 +84,14 @@ void RuleDrawer::operator()(FeatureType const & f) if (CheckCancelled()) return; - int const zoomLevel = m_context->GetTileKey().m_zoomLevel; - - m2::RectD const limitRect = f.GetLimitRect(zoomLevel); - - if (!m_globalRect.IsIntersect(limitRect)) - return; - Stylist s; m_callback(f, s); if (s.IsEmpty()) return; + int const zoomLevel = m_context->GetTileKey().m_zoomLevel; + if (s.IsCoastLine() && zoomLevel > scales::GetUpperWorldScale() && f.GetID().m_mwmId.GetInfo()->GetType() == MwmInfo::COASTS) @@ -115,6 +110,12 @@ void RuleDrawer::operator()(FeatureType const & f) } } + // FeatureType::GetLimitRect call invokes full geometry reading and decoding. + // That's why this code follows after all lightweight return options. + m2::RectD const limitRect = f.GetLimitRect(zoomLevel); + if (!m_globalRect.IsIntersect(limitRect)) + return; + #ifdef DEBUG // Validate on feature styles if (s.AreaStyleExists() == false)