summaryrefslogtreecommitdiff
path: root/src/mbgl/tile
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-01-25 23:57:47 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-02-25 13:47:56 +0200
commite800f3754758489e09c55e38bebd00c2203e4886 (patch)
tree8eeb7642f569ddbe0b8e00e4a025f2c4e91b5706 /src/mbgl/tile
parentfee22273be2d33049311de72ff6bf973b6b05164 (diff)
downloadqtlocation-mapboxgl-e800f3754758489e09c55e38bebd00c2203e4886.tar.gz
[core] Layer manager is responsible for buckets and layouts creation
This is a step to stop using of render layers in tile worker thread.
Diffstat (limited to 'src/mbgl/tile')
-rw-r--r--src/mbgl/tile/geometry_tile_worker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mbgl/tile/geometry_tile_worker.cpp b/src/mbgl/tile/geometry_tile_worker.cpp
index 854bfcf1a4..943e782af1 100644
--- a/src/mbgl/tile/geometry_tile_worker.cpp
+++ b/src/mbgl/tile/geometry_tile_worker.cpp
@@ -2,6 +2,7 @@
#include <mbgl/tile/geometry_tile_data.hpp>
#include <mbgl/tile/geometry_tile.hpp>
#include <mbgl/layermanager/layer_manager.hpp>
+#include <mbgl/layout/layout.hpp>
#include <mbgl/layout/symbol_layout.hpp>
#include <mbgl/layout/pattern_layout.hpp>
#include <mbgl/renderer/bucket_parameters.hpp>
@@ -340,7 +341,6 @@ void GeometryTileWorker::parse() {
layouts.clear();
featureIndex = std::make_unique<FeatureIndex>(*data ? (*data)->clone() : nullptr);
- BucketParameters parameters { id, mode, pixelRatio };
GlyphDependencies glyphDependencies;
ImageDependencies imageDependencies;
@@ -359,6 +359,7 @@ void GeometryTileWorker::parse() {
}
const RenderLayer& leader = *group.at(0);
+ BucketParameters parameters { id, mode, pixelRatio, leader.baseImpl->getTypeInfo() };
auto geometryLayer = (*data)->getLayer(leader.baseImpl->sourceLayer);
if (!geometryLayer) {
@@ -377,7 +378,7 @@ void GeometryTileWorker::parse() {
// and either immediately create a bucket if no images/glyphs are used, or the Layout is stored until
// the images/glyphs are available to add the features to the buckets.
if (leader.baseImpl->getTypeInfo()->layout == LayerTypeInfo::Layout::Required) {
- auto layout = leader.createLayout(parameters, group, std::move(geometryLayer), glyphDependencies, imageDependencies);
+ auto layout = LayerManager::get()->createLayout({parameters, glyphDependencies, imageDependencies}, std::move(geometryLayer), group);
if (layout->hasDependencies()) {
layouts.push_back(std::move(layout));
} else {
@@ -386,7 +387,7 @@ void GeometryTileWorker::parse() {
} else {
const Filter& filter = leader.baseImpl->filter;
const std::string& sourceLayerID = leader.baseImpl->sourceLayer;
- std::shared_ptr<Bucket> bucket = leader.createBucket(parameters, group);
+ std::shared_ptr<Bucket> bucket = LayerManager::get()->createBucket(parameters, group);
for (std::size_t i = 0; !obsolete && i < geometryLayer->featureCount(); i++) {
std::unique_ptr<GeometryTileFeature> feature = geometryLayer->getFeature(i);