From ed489e764971b40b01e33e8505f2d31a72a0075e Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 14 Apr 2016 16:15:43 -0700 Subject: [PATCH] [core] Remove MapData dependency from Style --- src/mbgl/map/map.cpp | 25 +++++++++++++++++++------ src/mbgl/style/style.cpp | 31 +++++++++---------------------- src/mbgl/style/style.hpp | 18 +++++++----------- test/style/source.cpp | 8 ++++---- test/style/style.cpp | 18 ++++++++---------- 5 files changed, 47 insertions(+), 53 deletions(-) diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 55f0197dc..8be4f1ebc 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -209,14 +210,26 @@ void Map::Impl::update() { } if (updateFlags & Update::Classes) { - style->cascade(frameData.timePoint); + style->cascade(frameData.timePoint, data.mode); } if (updateFlags & Update::Classes || updateFlags & Update::RecalculateStyle) { - style->recalculate(transformState.getZoom(), frameData.timePoint); + style->recalculate(transformState.getZoom(), frameData.timePoint, data.mode); } - style->update(transformState, frameData.timePoint, *texturePool); + StyleUpdateParameters parameters(data.pixelRatio, + data.getDebug(), + frameData.timePoint, + transformState, + style->workers, + fileSource, + *texturePool, + style->shouldReparsePartialTiles, + data.mode, + *data.getAnnotationManager(), + *style); + + style->update(parameters); if (data.mode == MapMode::Continuous) { view.invalidate(); @@ -269,7 +282,7 @@ void Map::setStyleURL(const std::string& url) { impl->styleURL = url; impl->styleJSON.clear(); - impl->style = std::make_unique