Mikhail Pozdnyakov
dea1063319
[core] Encapsulate placement code handling symbols sort ranges
2020-03-03 16:13:48 +02:00
Ansis Brammanis
4f18d5fa92
[core] sort symbols using symbol-sort-key before placement ( #16023 )
...
fix #15964
partially port mapbox/mapbox-gl-js#9054
2020-02-11 11:24:14 -05:00
Mikhail Pozdnyakov
1f5c6beb64
[tile mode] Improvements in symbol placement on tile borders
...
This change fixes the following problems:
1) Before this change, when multiple symbols were grouped close to the
tile borders, different tiles could place different symbols, because each
tile arbitrary assigned feature ids, and these ids defined the placement
order being applied. This caused artifacts at the tile boundaries.
With this change, in tile mode the placement order of two symbols crossing
a tile border is defined by their anchor `y` values. It means that the
symbols are being placed the same order across all the tiles.
2) Before this change, the engine did not place with priority the symbols
crossing the borders between two neighboring tiles. Now it does, and it
improves a lot symbol placement stability in the tile map mode.
2020-02-03 21:26:35 +02:00
Mikhail Pozdnyakov
951b90c778
[tile mode] Fix variable symbols placement
...
This commit allows the variable symbols to cross the tile border only
if their anchor is the first anchor from the `text-variable-anchor` list.
2020-01-27 17:51:07 +02:00
Mikhail Pozdnyakov
a9d04d7b1a
[core] Do not index and place the off-screen symbols for overscaled tiles
...
For overscaled tiles the viewport might be showing only a small part of the
tile, so we filter out the off-screen symbols to improve the performance.
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
4dac2f61c2
[core] Simplify Placement::addLayer()
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
e6ddcf9beb
[core] Simplify CrossTileSymbolIndex::addLayer()
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
5a4568b2ac
[core] Avoid repeated calculations in symbol placement
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
f70cadf2e0
[core] Cache showCollisionBoxes in Placement
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
769a822fec
[core] Pass UpdateParameters to Placement constructor
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
5af128f205
[core] Pass placement commit parameters in constructor
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
4735845a6e
[core] Consider symbol bucket leader id in cross-tile symbol indexing
...
Only buckets with the same leader id participate in `TileLayerIndex::findMatches()`
in order to improve its performace.
`TileLayerIndex` constness is fixed.
2020-01-22 14:30:26 +02:00
Konstantin Käfer
5a1e4c6b81
[core] implement stretchable icons for icon-text-fit
2020-01-15 15:02:11 +02:00
Konstantin Käfer
027e803b72
[core] move icon rotation from shaping to quad generation to mirror JS
2020-01-15 15:02:11 +02:00
Konstantin Käfer
1342cb44b3
[core] Remove unused WritingMode from getIconQuads
2020-01-15 15:02:11 +02:00
Konstantin Käfer
7d8d13ce04
[core] Change ImagePosition from storing non-padded rect to padded rect to mirror the JS implementation
2020-01-15 15:02:11 +02:00
Konstantin Käfer
4b171cccf1
[core] getGlyphQuad -> getGlyphQuads
2020-01-15 15:02:11 +02:00
Konstantin Käfer
d8d336160c
[core] add pixelOffset and minFontScale to SymbolQuads
2020-01-15 15:02:11 +02:00
Alexander Shalamov
879c44f661
[core] Modularize FileSource codebase ( #15768 )
...
* [core] Introduce FileSourceManager and use it for default platform impl
- Add `FileSourceManager` interface that provides access to `FileSource`
instances and means of registering / unregistering `FileSource` factories
- Split `DefaultFileSource` into smaller parts
- Add `DatabaseFileSource` interface and it's default implementation
- Remove inter-dependencies between concrete `FileSource` classes
* [build] Add files to next build system
* [core] Add generic property setters / getters
* [core] Remove setOnlineStatus from OnlineFileSource interface
* [core] Hide threading implementation details from DatabaseFileSource interface
* [core] Make DB file source methods virtual
* [core] Add documentation for DatabaseFileSource and rename one method
* [core] Use simple callback instead of ActorRef
* [core] Remove ActorRef from OnlineFileSource public header
* [core] Add callback to FileSource::forward async API
* [core] Pass OfflineRegionDefinition by value
* [core] Update tests to use modular file sources
* [core] Update unit tests
* [core] Update unit tests after rebase
* [core] Backport low prio fix for cached requests
* [core] Backport pack database
* [core] Return removed factory from unRegisterFileSourceFactory
* [core] Rename shadowed args in onlinefilesource
* [core] Remove simple std::function callback aliases
* [core] Expose online file source property keys in public header file
* [test-runner] Add proxy file source test runner
* [cache] Update mbgl-cache utility to use new file source
* [metrics] Rebaseline binary size metrics
* [offline] Update offline utility
* [core] Update changelog
2020-01-13 10:57:23 +02:00
Mikhail Pozdnyakov
0379615388
[core] Introduce CollisionIndex::getProjectedCollisionBoundaries()
...
In order to remove the repeated code.
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
141e4e7935
[core] Introduce CollisionBoundaries and use it in CollisionIndex
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
cf2946c8ff
[core] Use only the first variable anchor for the symbols intersecting tile borders
...
Do not try the following variable anchors, if the first variable anchor placement failed.
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
1debf4e05b
[core] Fix CollisionIndex::featureIntersectsTileBorders() implementation
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
c25fbe9a94
[core] Performance fix for placement in tile mode
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
2040d4d6f5
[core] In tile mode, place labels from tile borders first
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
7e5dc5608a
[core] Pre-defined variable anchor at tile borders
...
In tile mode, stick to the first variable anchor if the label intersects tile borders.
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
07194f7fa5
[core] Add CollisionIndex::featureIntersectsTileBorders()
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
2125548a6e
[core] Consolidate more logic in calculateVariableLayoutOffset()
2020-01-08 12:43:26 +02:00
Mikhail Pozdnyakov
1829fb5e40
[core] Placement::commit() handles absence of previuos placement
2019-12-09 17:32:49 +02:00
Mikhail Pozdnyakov
ffd378c68e
[core] Simplify placement code path for still and tile modes
2019-12-09 17:32:49 +02:00
Alexander Shalamov
d36958997b
[core] Add unit test for getAnchors and remove unused field
2019-12-09 17:26:13 +02:00
Alexander Shalamov
b6b077d73a
[core] Don't use signed int type for anchor segment
2019-12-09 17:26:13 +02:00
Ansis Brammanis
cdee5b8249
[core] increase padding in CollisionIndex for MapMode::Tile ( #15880 )
...
* [core] fix cutoff cross-tile labels in MapMode::Tile
Increase the CollisionIndex's padding so that more of a tile's data gets
considered when checking for collisions. This should fix clipped
variable placement text labels.
2019-12-06 18:11:25 -05:00
Alexander Shalamov
614000256b
[core] Shape images in labels at bucket zoom level
2019-12-02 17:11:49 +02:00
Alexander Shalamov
26bf566f53
[core] Use new 'SymbolTextAndIcon' program to draw icons in text
2019-12-02 17:11:49 +02:00
Alexander Shalamov
2c49c4374c
[core] Store 'sdf' flag in vertex attribute
2019-12-02 17:11:49 +02:00
Alexander Shalamov
2bb2a40b6d
[core] Shape images in labels and create image quads
2019-12-02 17:11:49 +02:00
Alexander Shalamov
f4f652063d
[core] Calculate line width and line breaks for images
2019-12-02 17:11:49 +02:00
Alexander Shalamov
34a9bc08ce
[core] Pass images and evaluated layout text size to shaping
2019-12-02 17:11:49 +02:00
Alexander Shalamov
a9c3b5a389
[core] Add evaluated images to styled text sections
2019-12-02 17:11:49 +02:00
Ansis Brammanis
4fb75ba32c
[core] avoid edges for labels that use text-variable-anchors
...
to prevent clipped labels in rendered image tiles.
2019-10-24 15:39:10 +03:00
Ansis Brammanis
99feb9bb30
[core] fix collisions with icon-text-fit and variable placement ( #15828 )
...
port 61a61a1982cb8c637d467f91da5b0817a61a9de6
2019-10-22 20:30:55 -04:00
Konstantin Käfer
2187980a87
[core] fix icon-text-fit
...
This fixes rendering by account for the 1px texture padding around icons that were stretched with icon-text-fit. We've added the 1px padding before, but didn't scale it accordingly when we are resizing the icon when it is stretched to fit the text. Adjusts the code to match the logic in GL JS.
2019-10-14 18:46:12 +02:00
Konstantin Käfer
9cac122c5c
[core] map image type to string until we have a dedicated implementation
2019-10-14 18:46:12 +02:00
Thiago Marcos P. Santos
c7bbd5bbef
[core] Fix performance-move-const-arg
2019-09-25 18:59:07 +03:00
Mikhail Pozdnyakov
097cf5fc39
[core] Clang format fix
2019-09-19 14:51:32 +03:00
Mikhail Pozdnyakov
f04efb69c0
[core] Immutable/Mutable pattern for Placement
2019-09-19 14:51:32 +03:00
Mikhail Pozdnyakov
870f306f68
[core] Update buckets in Renderer
2019-09-19 14:51:32 +03:00
Mikhail Pozdnyakov
f997ae00ae
[core] Fix Placement constness
...
Update buckets methods do not mutate placement, placement methods do not mutate buckets.
2019-09-19 14:51:32 +03:00
Mikhail Pozdnyakov
0d9e4afd20
[core] Coalesce buckets updates from several tiles
2019-09-13 13:45:48 +03:00