diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 340be008e2..26114579aa 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -1005,7 +1005,7 @@ void FrontendRenderer::MergeBuckets() dp::GLState state = group->GetState(); if (state.GetDepthLayer() == dp::GLState::GeometryLayer && !group->IsPendingOnDelete()) { - MergedGroupKey const key = MergedGroupKey(state, group->GetTileKey()); + MergedGroupKey const key(state, group->GetTileKey()); forMerge[key].push_back(move(m_renderGroups[i])); } else diff --git a/drape_frontend/tile_key.hpp b/drape_frontend/tile_key.hpp index 57d1ad0e7c..6738f3f40d 100755 --- a/drape_frontend/tile_key.hpp +++ b/drape_frontend/tile_key.hpp @@ -23,9 +23,17 @@ struct TileKey TileKey(int x, int y, int zoomLevel); TileKey(TileKey const & key, uint64_t generation); + // Operators < and == do not consider parameters m_styleZoomLevel and m_generation. + // m_styleZoomLevel is used to work around FeaturesFetcher::ForEachFeatureID which is + // not able to return correct rects on 18,19 zoom levels. So m_zoomLevel can not be + // more than 17 for all subsystems except of styling. + // m_generation is used to determine a generation of geometry for this tile key. + // Geometry with different generations must be able to group by (x, y, zoomlevel). bool operator < (TileKey const & other) const; bool operator == (TileKey const & other) const; + // This method implements strict comparison of tile keys. It's necessary to merger of + // batches which must not merge batches with different m_styleZoomLevel and m_generation. bool LessStrict(TileKey const & other) const; m2::RectD GetGlobalRect(bool considerStyleZoom = false) const; @@ -33,6 +41,7 @@ struct TileKey int m_x; int m_y; int m_zoomLevel; + int m_styleZoomLevel; uint64_t m_generation; };