diff --git a/drape_frontend/gps_track_renderer.cpp b/drape_frontend/gps_track_renderer.cpp index 97059f50d1..b50adc2de0 100644 --- a/drape_frontend/gps_track_renderer.cpp +++ b/drape_frontend/gps_track_renderer.cpp @@ -130,11 +130,9 @@ void GpsTrackRenderer::UpdatePoints(vector const & toAdd, vector< if (wasChanged) { - vector path; - path.reserve(m_points.size()); + m_pointsSpline = m2::Spline(m_points.size()); for (size_t i = 0; i < m_points.size(); i++) - path.push_back(m_points[i].m_point); - m_pointsSpline = m2::Spline(path); + m_pointsSpline.AddPoint(m_points[i].m_point); } m_needUpdate = true; @@ -272,7 +270,7 @@ void GpsTrackRenderer::RenderTrack(ScreenBase const & screen, int zoomLevel, pt.x + radiusMercator, pt.y + radiusMercator); if (screen.ClipRect().IsIntersect(pointRect)) { - dp::Color color = CalculatePointColor(static_cast(it.GetIndex()), pt, it.GetLength(), it.GetFullLength()); + dp::Color const color = CalculatePointColor(static_cast(it.GetIndex()), pt, it.GetLength(), it.GetFullLength()); m_handlesCache[cacheIndex].first->SetPoint(m_handlesCache[cacheIndex].second, pt, m_radius, color); m_handlesCache[cacheIndex].second++; if (m_handlesCache[cacheIndex].second >= m_handlesCache[cacheIndex].first->GetPointsCount()) diff --git a/drape_frontend/gps_track_shape.cpp b/drape_frontend/gps_track_shape.cpp index 8a83cbee06..96bccd7bf9 100644 --- a/drape_frontend/gps_track_shape.cpp +++ b/drape_frontend/gps_track_shape.cpp @@ -170,6 +170,8 @@ void GpsTrackShape::Draw(ref_ptr texMng, GpsTrackRenderData provider.InitStream(0 /* stream index */, GetGpsTrackStaticBindingInfo(), make_ref(staticVertexData.data())); provider.InitStream(1 /* stream index */, GetGpsTrackDynamicBindingInfo(), make_ref(dynamicVertexData.data())); batcher.InsertListOfStrip(GetGpsTrackState(texMng), make_ref(&provider), move(handle), kVerticesInPoint); + + GLFunctions::glFlush(); } } // namespace df