summaryrefslogtreecommitdiff
path: root/src/mbgl/map/vector_tile_data.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-06-18 18:23:03 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-07-01 15:21:08 -0700
commit4eff674c1d4caaf0ce624fe5db086f0d79d0d31f (patch)
treea6bef058da89bb8bba0047620b0e43a55c0385f7 /src/mbgl/map/vector_tile_data.cpp
parent424629d7fc777d274541629eecd252e404eadf2b (diff)
downloadqtlocation-mapboxgl-4eff674c1d4caaf0ce624fe5db086f0d79d0d31f.tar.gz
Revert "Do not hold a reference to the Style at the [Live|Vector]TileData"
This reverts commit 044454417b61bdd102a376c1125ad6ee3a5eacd4.
Diffstat (limited to 'src/mbgl/map/vector_tile_data.cpp')
-rw-r--r--src/mbgl/map/vector_tile_data.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp
index 017d3ecb7c..6dc6e8e9b3 100644
--- a/src/mbgl/map/vector_tile_data.cpp
+++ b/src/mbgl/map/vector_tile_data.cpp
@@ -9,12 +9,12 @@
#include <mbgl/util/pbf.hpp>
#include <mbgl/util/worker.hpp>
#include <mbgl/util/work_request.hpp>
+#include <mbgl/style/style.hpp>
using namespace mbgl;
VectorTileData::VectorTileData(const TileID& id_,
- const std::vector<util::ptr<StyleLayer>>& layers_,
- Worker& workers_,
+ Style& style_,
GlyphAtlas& glyphAtlas_,
GlyphStore& glyphStore_,
SpriteAtlas& spriteAtlas_,
@@ -23,12 +23,11 @@ VectorTileData::VectorTileData(const TileID& id_,
float angle,
bool collisionDebug)
: TileData(id_, source_),
- layers(layers_),
- workers(workers_),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
spriteAtlas(spriteAtlas_),
sprite(sprite_),
+ style(style_),
collision(std::make_unique<CollisionTile>(id_.z, 4096, source_.tile_size * id.overscaling, angle, collisionDebug)),
lastAngle(angle),
currentAngle(angle) {
@@ -52,7 +51,7 @@ void VectorTileData::parse() {
// is going to be discarded afterwards.
VectorTile vectorTile(pbf((const uint8_t *)data.data(), data.size()));
const VectorTile* vt = &vectorTile;
- TileParser parser(*vt, *this, layers, glyphAtlas, glyphStore, spriteAtlas, sprite);
+ TileParser parser(*vt, *this, style, glyphAtlas, glyphStore, spriteAtlas, sprite);
parser.parse();
if (getState() == State::obsolete) {
@@ -129,14 +128,15 @@ void VectorTileData::redoPlacement(float angle, bool collisionDebug) {
currentCollisionDebug = collisionDebug;
auto callback = std::bind(&VectorTileData::endRedoPlacement, this);
- workRequest = workers.send([this, angle, collisionDebug] { workerRedoPlacement(angle, collisionDebug); }, callback);
+ workRequest = style.workers.send([this, angle, collisionDebug] { workerRedoPlacement(angle, collisionDebug); }, callback);
+
}
}
void VectorTileData::workerRedoPlacement(float angle, bool collisionDebug) {
collision->reset(angle, 0);
collision->setDebug(collisionDebug);
- for (const auto& layer_desc : layers) {
+ for (const auto& layer_desc : style.layers) {
auto bucket = getBucket(*layer_desc);
if (bucket) {
bucket->placeFeatures();
@@ -145,7 +145,7 @@ void VectorTileData::workerRedoPlacement(float angle, bool collisionDebug) {
}
void VectorTileData::endRedoPlacement() {
- for (const auto& layer_desc : layers) {
+ for (const auto& layer_desc : style.layers) {
auto bucket = getBucket(*layer_desc);
if (bucket) {
bucket->swapRenderData();