Inline updateTiles and recalculateStyle

This commit is contained in:
John Firebaugh
2015-06-24 18:44:30 -07:00
parent dca42018d2
commit 874aa69efb
2 changed files with 2 additions and 14 deletions

View File

@@ -127,12 +127,6 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
}
}
void MapContext::updateTiles() {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
style->update(data, transformState, *texturePool);
}
void MapContext::updateAnnotationTiles(const std::unordered_set<TileID, TileID::Hash>& ids) {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
@@ -230,10 +224,6 @@ void MapContext::cascadeClasses() {
style->cascade(data.getClasses());
}
void MapContext::recalculateStyle(TimePoint now) {
style->recalculate(transformState.getNormalizedZoom(), now);
}
void MapContext::update() {
assert(util::ThreadContext::currentlyOn(util::ThreadType::Map));
@@ -254,10 +244,10 @@ void MapContext::update() {
if (updated & static_cast<UpdateType>(Update::Classes) ||
updated & static_cast<UpdateType>(Update::Zoom)) {
recalculateStyle(now);
style->recalculate(transformState.getNormalizedZoom(), now);
}
updateTiles();
style->update(data, transformState, *texturePool);
if (style->isLoaded()) {
if (!data.getFullyLoaded()) {

View File

@@ -61,12 +61,10 @@ public:
void onResourceLoadingFailed(std::exception_ptr error) override;
private:
void updateTiles();
void render();
// Style-related updates.
void cascadeClasses();
void recalculateStyle(TimePoint);
// Update the state indicated by the accumulated Update flags, then render.
void update();