fix layer minZoom being ignored if not less than source maxZoom
This condition led to layers with high minzoom like oneway street arrows (z15) get parsed and placed regardless of minzoom (e.g. z11+), wasting a lot of worker CPU time. It became unnecessary after we added reparsing tiles when overscaling, and even before that it should have probably been <= rather than <.
This commit is contained in:
@@ -20,7 +20,6 @@ LiveTileData::LiveTileData(const TileID& id_,
|
||||
worker(style_.workers),
|
||||
tileWorker(id_,
|
||||
source_.source_id,
|
||||
source_.max_zoom,
|
||||
style_,
|
||||
style_.layers,
|
||||
state,
|
||||
|
||||
@@ -14,7 +14,6 @@ using namespace mbgl;
|
||||
|
||||
TileWorker::TileWorker(TileID id_,
|
||||
std::string sourceID_,
|
||||
const uint16_t maxZoom_,
|
||||
Style& style_,
|
||||
std::vector<util::ptr<StyleLayer>> layers_,
|
||||
const std::atomic<TileData::State>& state_,
|
||||
@@ -22,7 +21,6 @@ TileWorker::TileWorker(TileID id_,
|
||||
: layers(std::move(layers_)),
|
||||
id(id_),
|
||||
sourceID(sourceID_),
|
||||
maxZoom(maxZoom_),
|
||||
style(style_),
|
||||
state(state_),
|
||||
collisionTile(std::move(collision_)) {
|
||||
@@ -120,7 +118,7 @@ void TileWorker::parseLayer(const StyleLayer& layer, const GeometryTile& geometr
|
||||
// Skip this bucket if we are to not render this
|
||||
if (styleBucket.source != sourceID)
|
||||
return;
|
||||
if (id.z < std::floor(styleBucket.min_zoom) && std::floor(styleBucket.min_zoom) < maxZoom)
|
||||
if (id.z < std::floor(styleBucket.min_zoom))
|
||||
return;
|
||||
if (id.z >= std::ceil(styleBucket.max_zoom))
|
||||
return;
|
||||
|
||||
@@ -31,7 +31,6 @@ class TileWorker : public util::noncopyable {
|
||||
public:
|
||||
TileWorker(TileID,
|
||||
std::string sourceID,
|
||||
uint16_t maxZoom,
|
||||
Style&,
|
||||
std::vector<util::ptr<StyleLayer>>,
|
||||
const std::atomic<TileData::State>&,
|
||||
@@ -58,7 +57,6 @@ private:
|
||||
|
||||
const TileID id;
|
||||
const std::string sourceID;
|
||||
const uint16_t maxZoom;
|
||||
|
||||
Style& style;
|
||||
const std::atomic<TileData::State>& state;
|
||||
|
||||
@@ -22,7 +22,6 @@ VectorTileData::VectorTileData(const TileID& id_,
|
||||
worker(style_.workers),
|
||||
tileWorker(id_,
|
||||
source_.source_id,
|
||||
source_.max_zoom,
|
||||
style_,
|
||||
style_.layers,
|
||||
state,
|
||||
|
||||
Reference in New Issue
Block a user