Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mbgl/layer/symbol_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ bool SymbolLayer::recalculate(const StyleCalculationParameters& parameters) {

std::unique_ptr<Bucket> SymbolLayer::createBucket(StyleBucketParameters& parameters) const {
auto bucket = std::make_unique<SymbolBucket>(parameters.tileID.overscaling,
parameters.tileID.z);
parameters.tileID.z,
parameters.mode);

bucket->layout = layout;

Expand Down
1 change: 1 addition & 0 deletions src/mbgl/map/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ TileData::State Source::addTile(const TileID& id, const StyleUpdateParameters& p
std::move(monitor),
info.source_id,
parameters.style,
parameters.mode,
callback);
}

Expand Down
9 changes: 6 additions & 3 deletions src/mbgl/map/tile_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ TileWorker::TileWorker(TileID id_,
SpriteStore& spriteStore_,
GlyphAtlas& glyphAtlas_,
GlyphStore& glyphStore_,
const std::atomic<TileData::State>& state_)
const std::atomic<TileData::State>& state_,
const MapMode mode_)
: id(id_),
sourceID(std::move(sourceID_)),
spriteStore(spriteStore_),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
state(state_) {
state(state_),
mode(mode_) {
}

TileWorker::~TileWorker() {
Expand Down Expand Up @@ -140,7 +142,8 @@ void TileWorker::parseLayer(const StyleLayer* layer, const GeometryTile& geometr
spriteStore,
glyphAtlas,
glyphStore,
*collisionTile);
*collisionTile,
mode);

std::unique_ptr<Bucket> bucket = layer->createBucket(parameters);

Expand Down
5 changes: 4 additions & 1 deletion src/mbgl/map/tile_worker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <mapbox/variant.hpp>

#include <mbgl/map/mode.hpp>
#include <mbgl/map/tile_data.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/ptr.hpp>
Expand Down Expand Up @@ -44,7 +45,8 @@ class TileWorker : public util::noncopyable {
SpriteStore&,
GlyphAtlas&,
GlyphStore&,
const std::atomic<TileData::State>&);
const std::atomic<TileData::State>&,
const MapMode);
~TileWorker();

TileParseResult parseAllLayers(std::vector<std::unique_ptr<StyleLayer>>,
Expand All @@ -67,6 +69,7 @@ class TileWorker : public util::noncopyable {
GlyphAtlas& glyphAtlas;
GlyphStore& glyphStore;
const std::atomic<TileData::State>& state;
const MapMode mode;

bool partialParse = false;

Expand Down
4 changes: 3 additions & 1 deletion src/mbgl/map/vector_tile_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ VectorTileData::VectorTileData(const TileID& id_,
std::unique_ptr<GeometryTileMonitor> monitor_,
std::string sourceID,
Style& style_,
const MapMode mode_,
const std::function<void()>& callback)
: TileData(id_),
style(style_),
Expand All @@ -21,7 +22,8 @@ VectorTileData::VectorTileData(const TileID& id_,
*style_.spriteStore,
*style_.glyphAtlas,
*style_.glyphStore,
state),
state,
mode_),
monitor(std::move(monitor_))
{
state = State::loading;
Expand Down
1 change: 1 addition & 0 deletions src/mbgl/map/vector_tile_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class VectorTileData : public TileData {
std::unique_ptr<GeometryTileMonitor> monitor,
std::string sourceID,
Style&,
const MapMode,
const std::function<void()>& callback);

~VectorTileData();
Expand Down
4 changes: 2 additions & 2 deletions src/mbgl/renderer/painter_symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
}

// TODO remove the `true ||` when #1673 is implemented
const bool drawAcrossEdges = true || !(layout.text.allowOverlap || layout.icon.allowOverlap ||
layout.text.ignorePlacement || layout.icon.ignorePlacement);
const bool drawAcrossEdges = (data.mode == MapMode::Continuous) && (true || !(layout.text.allowOverlap || layout.icon.allowOverlap ||
layout.text.ignorePlacement || layout.icon.ignorePlacement));

// Disable the stencil test so that labels aren't clipped to tile boundaries.
//
Expand Down
6 changes: 3 additions & 3 deletions src/mbgl/renderer/symbol_bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ SymbolInstance::SymbolInstance(Anchor& anchor, const std::vector<Coordinate>& li
iconCollisionFeature(line, anchor, shapedIcon, iconBoxScale, iconPadding, iconAlongLine) {};


SymbolBucket::SymbolBucket(float overscaling_, float zoom_)
: overscaling(overscaling_), zoom(zoom_), tileSize(512 * overscaling_), tilePixelRatio(tileExtent / tileSize) {
SymbolBucket::SymbolBucket(float overscaling_, float zoom_, const MapMode mode_)
: overscaling(overscaling_), zoom(zoom_), tileSize(512 * overscaling_), tilePixelRatio(tileExtent / tileSize), mode(mode_) {
}

SymbolBucket::~SymbolBucket() {
Expand Down Expand Up @@ -329,7 +329,7 @@ void SymbolBucket::addFeature(const std::vector<std::vector<Coordinate>> &lines,
// the buffers for both tiles and clipped to tile boundaries at draw time.
//
// TODO remove the `&& false` when is #1673 implemented
const bool addToBuffers = inside || (mayOverlap && false);
const bool addToBuffers = (mode == MapMode::Still) || inside || (mayOverlap && false);

symbolInstances.emplace_back(anchor, line, shapedText, shapedIcon, layout, addToBuffers,
textBoxScale, textPadding, textAlongLine,
Expand Down
4 changes: 3 additions & 1 deletion src/mbgl/renderer/symbol_bucket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <mbgl/renderer/bucket.hpp>
#include <mbgl/map/geometry_tile.hpp>
#include <mbgl/map/mode.hpp>
#include <mbgl/geometry/vao.hpp>
#include <mbgl/geometry/elements_buffer.hpp>
#include <mbgl/geometry/text_buffer.hpp>
Expand Down Expand Up @@ -65,7 +66,7 @@ class SymbolBucket : public Bucket {
typedef ElementGroup<1> CollisionBoxElementGroup;

public:
SymbolBucket(float overscaling, float zoom);
SymbolBucket(float overscaling, float zoom, const MapMode);
~SymbolBucket() override;

void upload() override;
Expand Down Expand Up @@ -119,6 +120,7 @@ class SymbolBucket : public Bucket {
const float tileSize;
const float tileExtent = 4096.0f;
const float tilePixelRatio;
const MapMode mode;

std::set<GlyphRange> ranges;
std::vector<SymbolInstance> symbolInstances;
Expand Down
1 change: 1 addition & 0 deletions src/mbgl/style/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ void Style::update(const TransformState& transform,
workers,
texturePool,
shouldReparsePartialTiles,
data.mode,
data,
*this);

Expand Down
8 changes: 6 additions & 2 deletions src/mbgl/style/style_bucket_parameters.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef STYLE_BUCKET_PARAMETERS
#define STYLE_BUCKET_PARAMETERS

#include <mbgl/map/mode.hpp>
#include <mbgl/style/filter_expression.hpp>
#include <mbgl/map/tile_data.hpp>

Expand All @@ -26,7 +27,8 @@ class StyleBucketParameters {
SpriteStore& spriteStore_,
GlyphAtlas& glyphAtlas_,
GlyphStore& glyphStore_,
CollisionTile& collisionTile_)
CollisionTile& collisionTile_,
const MapMode mode_)
: tileID(tileID_),
layer(layer_),
state(state_),
Expand All @@ -35,7 +37,8 @@ class StyleBucketParameters {
spriteStore(spriteStore_),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
collisionTile(collisionTile_) {}
collisionTile(collisionTile_),
mode(mode_) {}

bool cancelled() const {
return state == TileData::State::obsolete;
Expand All @@ -52,6 +55,7 @@ class StyleBucketParameters {
GlyphAtlas& glyphAtlas;
GlyphStore& glyphStore;
CollisionTile& collisionTile;
const MapMode mode;
};

} // namespace mbgl
Expand Down
3 changes: 3 additions & 0 deletions src/mbgl/style/style_update_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class StyleUpdateParameters {
Worker& worker_,
TexturePool& texturePool_,
bool shouldReparsePartialTiles_,
const MapMode mode_,
MapData& data_,
Style& style_)
: pixelRatio(pixelRatio_),
Expand All @@ -29,6 +30,7 @@ class StyleUpdateParameters {
worker(worker_),
texturePool(texturePool_),
shouldReparsePartialTiles(shouldReparsePartialTiles_),
mode(mode_),
data(data_),
style(style_) {}

Expand All @@ -39,6 +41,7 @@ class StyleUpdateParameters {
Worker& worker;
TexturePool& texturePool;
bool shouldReparsePartialTiles;
const MapMode mode;

// TODO: remove
MapData& data;
Expand Down