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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user