Commit Graph

42 Commits

Author SHA1 Message Date
Chris Loer
a62745edf9 Port global symbol query from GL JS:
- Symbol querying is now global instead of per-tile
 - Symbols that bleed over tile boundaries no longer missed in queries
 - Symbol results now sorted based on rendering order (ie overlapping symbols change their sort order when a bearing change causes their render order to change)
 - Placement::retainedQueryData now responsible for maintaining symbol querying data for buckets that may no longer be in the TilePyramid.
2018-04-25 14:39:03 -07:00
Chris Loer
a2399a57a2 [core] Make FeatureIndex own GeometryTileData.
Prevents querying a FeatureIndex built against a separate set of data, which can lead to invalid index exceptions.
The GeometryTileWorker 'data' member can still change independently of the data in the feature index, at the time 'setData' is called. The GeometryTileWorker maintains ownership of its local data (which may be used to re-parse) and clones the data for use by the FeatureIndex in the foreground.
2018-04-02 10:39:22 -07:00
Chris Loer
11961d5c31 [core] Consolidate GeometryTile symbol/nonSymbolBuckets
Conversion to one-phase tile loading removed any need to track them separately.
2018-04-02 10:39:22 -07:00
Chris Loer
7f42e3970e [core] Convert GeometryTileWorker to "one-phase" loading
Modest simplification refactoring (issue #10457).
Also, fixes issue #11538, which was caused in part by a hole in the vestigial two-phase loading.
2018-04-02 10:39:22 -07:00
Lucas Wojciechowski
8a3deab733 [core] Add expression filter support (#11251)
* WIP

* WIP

* WIP

* Remove Filter::operator()(const Feature&)

* WIP

* WIP

* WIP

* WIP

* Hook up expression filter evaluator

* Replace `shared_ptr` with &reference

* Fill in implementation of `void operator()(const ExpressionFilter&)`

* Fix failing tests

* Switch back to a shared_ptr per chat with @anandthakker

* Fix benchmark compilation

* Shot in the dark to fix CI

* Shot in the dark to fix CI (part 2)

* Shot in the dark to fix CI (part 3)

* In src/mbgl/style/conversion/filter.cpp, add a port of isExpressionFilter and use it to decide in Converter<Filter>::operator() whether to parse the incoming JSON as an ExpressionFilter or one of the legacy filter types

* Remove bool Filter::operator()(const GeometryTileFeature&) const

*  Ensure the map zoom is passed into filtering operations wherever applicable

* Add expression filter tests

* Addressed PR feedback

* Implement `NSPredicate *operator()(mbgl::style::ExpressionFilter filter)`

* Fix formatting& nit
2018-03-09 11:12:14 +01:00
Ansis Brammanis
6782d7af37 [core] fix symbol flickering after data updates 2018-01-11 14:07:00 -05:00
Chris Loer
c39232a89f [core] Cleanup in response to review comments. 2017-11-17 10:05:15 -08:00
Chris Loer
c0cb210ddc [core] Switch from background to foreground placement
- Background placement code now just generates static symbol buffers
 - Don't render GeometryTiles until their symbols are loaded. This is necessary for the CrossTileSymbolIndex to successfully prevent flicker.
 - SymbolInstances are transferred to SymbolBucket for use on foreground during collision detection
 - Symbols are sorted on foreground by sorting their index buffer but leaving vertex buffers intact (only works within one segment)
 - Vertical glyphs are generated at same time as horizontal glyphs. `reprojectLineLabels` chooses which one to use at render time and hides the other.
 - Icons are now always represented with a single collision box, even if they're placed along a line (this means their rotation alignment may be wrong, but the approach of representing them with multiple collision boxes wasn't very accurate either).
 - Generate vertices for new debug collision boxes and collision circles
 - Only add symbols within tile boundaries (reduces work, avoids double-draw)
 - Update symbol_projection.cpp to support line label projection calls from CollisionIndex.
2017-11-17 10:05:15 -08:00
Konstantin Käfer
f659aa4eda [core] make sure tiles are not treated as complete until all worker operations completed
Previously, when we started a worker operation that eventually throws an exception (e.g. due to the tile not being parseable), and then enqueue another worker operation while the first one is processing, we treated the worker as idle once the first operation's error callback fired, even though the second operation was still in progress. Due to our use of coalescing, I was unable to come up with a reliable test since we'd need to reproduce the behavior described above, which is timing dependent.
2017-09-21 12:20:54 +02:00
Bruno de Oliveira Abinader
fe8cbc78d3 [core] Added GeometryTileWorker-owned image correlation ID 2017-08-25 23:41:52 +03:00
Bruno de Oliveira Abinader
8b45d64efc Revert "[core] Ensure image dependencies in GeometryTileWorker::onImagesAvailable"
This reverts commit cd8eb13ba2.
2017-08-25 23:41:52 +03:00
Bruno de Oliveira Abinader
cd8eb13ba2 [core] Ensure image dependencies in GeometryTileWorker::onImagesAvailable 2017-08-14 18:23:03 +03:00
John Firebaugh
754d2f377a [core] make{Glyph,Image}Atlas only once for any number of symbol layers 2017-07-06 05:28:37 -07:00
Konstantin Käfer
244484ca6c [core] retain GeometryTileLayer in SymbolLayout
We're storing GeometryTileFeature objects in SymbolLayout, but they may reference data in GeometryTileLayer, which could go away if we don't retain it.
2017-06-21 17:18:08 -07:00
John Firebaugh
3270440f23 [core] Per-tile glyph/icon atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
0b68731207 [core] Per-bucket icon atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
92252849c1 [core] Per-bucket glyph atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
1759603e12 [core] Simplify and fix sprite atlas coordinate calculations
* Always return image metrics exclusive of padding
* Work with integer coordinates whenever possible
* Eliminate redundant SpriteAtlasElement members
* Fix asymmetric re-padding in getIconQuad when pixelRatio != 1
* Add explanatory comments
2017-05-23 12:59:27 -07:00
John Firebaugh
9eba2a66d1 [core, node, darwin, qt] Remove support for paint classes 2017-05-15 09:45:55 -07:00
John Firebaugh
e473f2dcce [core] cascade ⇢ transition / cascading ⇢ transitionable 2017-05-15 09:45:55 -07:00
Asheem Mamoowala
84e39611a0 [core] Move renderer/* files into sub-folders (#8983)
Move renderer/* files into sub-folders
2017-05-12 17:07:48 -07:00
John Firebaugh
095dc7b167 [core] Replace createRender{Source,Layer} with Render{Source,Layer}::create
* Eliminates the need for EnableImmutableFromThis
* Eliminates the dependency of {Source,Layer}::Impl on corresponding Render class (circular dependency)
2017-05-12 11:26:27 -07:00
John Firebaugh
c2a5894f2d [core] Immutable Impls 2017-05-12 11:26:27 -07:00
Bruno de Oliveira Abinader
1e1da36123 [tidy] modernize-use-equals-default 2017-05-12 18:07:36 +03:00
John Firebaugh
e7d2796762 [core] Omnibus Style::update method
Combine Style::cascade, recalculate, relayout, and updateTiles into a single method. This allows multiple loops over sources and layers to be consolidated and prepares for additional Style-Map decoupling: rather than tracking pending updates via a set of Update flags held by the Map and passed to the Style, the Style can use its own data to determine what to update.
2017-05-04 09:59:56 -07:00
John Firebaugh
d5f4d0f05f [core] Move render-related sources out of style directory/namespace
Moves the following to the renderer directory and out of the style namespace:

* CascadeParameters
* PropertyEvaluationParameters
* UpdateParameters
* PropertyEvaluator
* DataDrivenPropertyEvaluator
* CrossFadedPropertyEvaluator
* PaintPropertyBinder
* PaintProperyStatistics
* PossiblyEvaluatedPropertyValue
* TransitioningLight
* EvaluatedLight
2017-05-03 08:30:17 -07:00
John Firebaugh
1c42daa152 [core] Tweak handling of annotation special case SpriteAtlas
* Simplify SymbolLayout; it never needs to care about more than one SpriteAtlas.
* Move the reference from SymbolLayer::Impl to SymbolBucket. This is a prerequisite for making layer Impls immutable.
2017-04-26 16:29:44 -07:00
Ivo van Dongen
3c175adf30 [core] split off render layers 2017-04-25 17:23:54 -07:00
John Firebaugh
a50d7a331b [core] Replace GlyphRangeSet in onGlyphsAvailable with optionals in the map
GlyphRangeSet isn't keyed by FontStack, so using it to indicate that a particular range was loaded could have produced false positives.
2017-04-14 15:39:31 -07:00
Chris Loer
5cdf838a38 [core] De-mutex GlyphAtlas and SpriteAtlas
- Expose glyph and icon information to workers via message interface.
 - Glyph/SpriteAtlas track which tiles have outstanding requests
    and send messages to them when glyphs/icons become available.
 - Remove obsolete "updateSymbolDependentTiles" pathway
 - Symbol preparation for a tile now depends on all glyphs becoming
    available before it can start.
 - Start tracking individual icons needed for a tile, although we don't
    do anything with the information yet.
 - Introduce typedef for GlyphID
2017-04-04 11:33:12 -07:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
John Firebaugh
e7778509c5 [core] Fix flickering caused by regression in #7586
It should be safe to invoke GeometryTileWorker::setData multiple times without invoking GeometryTileWorker::setLayers. Therefore GeometryTileWorker::redoLayout() must not consume the layers.
2017-01-10 10:15:22 -08:00
John Firebaugh
0c0064c050 [core] Get rid of user-specified refs 2017-01-04 17:38:33 -08:00
John Firebaugh
8a0dee6ebd [core] Remove unused BucketParameter members 2016-12-21 08:45:08 -08:00
John Firebaugh
f6985cf6ff [core] Convert BucketParameters#layer to a separate parameter
This parameter varies between Buckets, while the others are constant. It makes more sense as an individual parameter.
2016-12-21 08:45:08 -08:00
Konstantin Käfer
e76de05402 [build] move logging to util 2016-11-22 20:58:51 +01:00
Konstantin Käfer
a7fa97e8a3 [core] don't run symbol placement more often than necessary 2016-11-14 10:35:15 +01:00
John Firebaugh
aa08796767 [core] Separate pathway for notifying workers of new images/glyphs 2016-11-07 10:16:35 -08:00
John Firebaugh
31be5d3c3a [core] Tiles that error on load are not renderable 2016-10-05 10:26:04 -07:00
John Firebaugh
dc1861f6d5 [core] Merge GlyphStore and GlyphAtlas 2016-09-19 09:40:43 -07:00
John Firebaugh
940124ff71 [core] Merge SpriteStore and SpriteAtlas 2016-09-19 09:40:43 -07:00
John Firebaugh
41bbd4e4f7 [core] Use an actor model for tile worker concurrency 2016-09-16 12:01:06 -07:00