Commit Graph

3576 Commits

Author SHA1 Message Date
Chris Loer
27b21363e6 [core] Only run placement for first layer per SymbolBucket
Native version of mapbox/mapbox-gl-js#6548.
Port of mapbox/mapbox-gl-js#6550.
Prevents symbols that share the same layout properties from colliding against each other.

Bump GL JS pin to get regression test.
Rename "bucketName" -> "bucketLeaderID" to make it clearer what it represents.
2018-05-03 14:17:25 -07:00
Chris Loer
a6d70c2db7 [core] Don't copy TileLayerIndexes on every frame.
Fixes issue #11811 (too much CPU time spent in CrossTileSymbolIndex).
2018-05-01 15:25:26 -07:00
Chris Loer
b820ca4686 [core] Remove unused 'Throttler' class.
Throttler was previously used to control how frequently background placement ran.
2018-04-30 17:08:09 -07:00
Chris Loer
65a4ee2373 [core] Port is-supported-script to native.
Native port is much simpler because RTL text support is always enabled.
2018-04-27 16:05:14 -07:00
Ansis Brammanis
0ca53ea5a8 [core] only index features within tile boundaries
Previously we relied on tile buffers for querying features who's
rendered representations cross tile boundaries. Now we query multiple
tiles making it unnecessary to index features that are completely
outside a tile's boundaries.
2018-04-26 18:03:17 -04:00
Chris Loer
f86fe44dbd [core] fix circle querying for scale and alignment
This fixes circle querying for cases where either
    circle-pitch-alignment=map
or
    circle-pitch-scaling=viewport
2018-04-26 18:03:17 -04:00
Chris Loer
f7d20a5871 [core] fix querying circles across tile boundaries 2018-04-26 18:03:17 -04:00
Asheem Mamoowala
4344812ef5 [core] Streaming TileCover for polygonal regions (#11267)
A per-tile streaming algorithm for tile cover on points, lines, and polygons. Works for individual zoom levels, and not zoom ranges.
2018-04-26 07:43:38 -07:00
Chris Loer
c04cf57a74 Review changes:
- assert symbol layer tiles must be geometry tiles, instead of dynamically checking
- re-use retainedBucketQuery iterator instead of calling find twice.
2018-04-25 14:39:03 -07:00
Chris Loer
60cce56d46 Bump GL JS pin to get tests for global symbol querying.
- Pulls over an update to line.vertex.glsl (looks like a no-op?)
 - Add test ignores for collator, is-supported-script, line-gradient
 - Exclude collator, is-supported-script, line-gradient from code generation.
2018-04-25 14:39:03 -07:00
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
Fabian Guerra
e08b6fe87f Merge branch 'release-boba' into master
# Conflicts:
#	circle.yml
#	include/mbgl/style/expression/let.hpp
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/LatLngBounds.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapKeyListener.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Projection.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java
#	platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/geometry/LatLngBoundsTest.java
#	platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml
#	platform/android/gradle/dependencies.gradle
#	platform/android/src/example_custom_layer.cpp
#	platform/android/src/geojson/point.cpp
#	platform/darwin/src/NSPredicate+MGLAdditions.mm
#	platform/darwin/test/MGLExpressionTests.mm
#	platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
#	platform/ios/Mapbox-iOS-SDK-symbols.podspec
#	platform/ios/Mapbox-iOS-SDK.podspec
#	platform/ios/app/MBXViewController.m
#	src/mbgl/renderer/layers/render_custom_layer.cpp
#	src/mbgl/style/conversion/filter.cpp
#	src/mbgl/style/expression/interpolate.cpp
#	src/mbgl/style/expression/value.cpp
#	test/style/filter.test.cpp
2018-04-23 10:44:02 -04:00
Chris Loer
b414c607c3 Don't crash on placing symbols with 0 renderable glyphs
Fixes issue #11729. Close relative of issue #10956.
It is possible for us to receive Glyphs from the server that are valid, but have an invalid bitmap. In that case, the glyphs will be present in the `GlyphMap` used for shaping, but not present in the `GlyphPositions` used in `getGlyphQuads`. `SymbolInstance::hasText` looked at the shaping instead of the actual quads.
`symbol_projection.cpp` should never try to project a label without any quads, but we'll also try to make it so that it doesn't crash if it does.
2018-04-19 10:47:51 -07:00
Anand Thakker
352d63d2ce Don't enforce ["zoom"] constraints for filters (#11672)
* Don't enforce ["zoom"] constraints for filters

Fixes #11594

* Add a couple of comments

* Fix ambiguous constructor call

* ParsingContext(optional<Type>) => ParsingContext(Type)
2018-04-12 16:02:48 -04:00
Łukasz Paczos
22b4ef1f4b Update layer immediately when changing its max/min zoom level (#11399)
* [android][core] update layer immediately when changing it's max/min zoom

* [core] node bindings for layer zoom range
2018-04-12 10:42:14 +02:00
Anand Thakker
f0f67b4788 Add abs, round, floor, ceil operators (#11653)
* Add abs, round, floor, ceil operators

Port of https://github.com/mapbox/mapbox-gl-js/pull/6496

* [ios, macos] Simplified abs, ceiling, floor expressions

* [ios, macos] Added rounding expression function

* [android] - binding integration for round, ceil, floor and abs expressions

* Update mapbox-gl-js to include non-integer rounding test

* Drop extra braces

* mapbox-gl-js -> master

* Update style-spec docs -> PropertyFactory.java
2018-04-11 12:03:56 -04:00
Anand Thakker
8d26f74091 Fix style parsing bug for constant expressions (#11606)
* Fix style parsing bug for constant expressions

Closes #10849

* Ignore tests for unported GL JS change

Refs https://github.com/mapbox/mapbox-gl-js/pull/6429

* Fuller fix

* Update mapbox-gl-js
2018-04-09 17:59:18 -04:00
Łukasz Paczos
6f639dba20 [core] re-bind uniform locations after re-linking program (#11618)
- On some gl implementations the uniform locations are shifted after linking the program a second time, resulting in errors when using any uniform. On some implementations they are actually doubled. Re-binding the uniforms after selectively binding the vertex attributes prevents this.

(cherry picked from commit 4a0e025)
2018-04-06 16:28:36 +02:00
Asheem Mamoowala
dc495e1c9d [core] Add Projection matrix to CustomLayerRenderParameters to transform web mercator world coordinates to GL coordinates. 2018-04-05 18:04:25 -07:00
Ivo van Dongen
4a0e025134 [core] re-bind uniform locations after re-linking program
- On some gl implementations the uniform locations are shifted after linking the program a second time, resulting in errors when using any uniform. On some implementations they are actually doubled. Re-binding the uniforms after selectively binding the vertex attributes prevents this.
2018-04-05 10:21:59 +03:00
Asheem Mamoowala
099fcc3b3c Use a host interface for CustomLayer instead of function pointers (#11553)
Use a host interface for CustomLayer instead of function pointers

Co-authored-by: Julian Rex <julian.rex@mapbox.com>
2018-04-02 16:15:25 -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
Minh Nguyễn
d066e94103 [core] Fixed to-rgba with zero opacity 2018-03-30 15:36:32 -07:00
Minh Nguyễn
f4d9fb816d [core] Round-trip linear interpolators 2018-03-30 15:36:30 -07:00
Chris Loer
e5a3a7a451 [core] Fix potential race condition crash in symbol querying..
Second half of fix for issue #11538.

If a global placement took place between the time a tile's non-symbol layout updated and the time new symbol buckets arrived, the tile's new FeatureIndex would be committed, but the global CollisionIndex would be generated against the old symbolBuckets. The mismatch could cause the CollisionIndex to contain indices that didn't exist in the new FeatureIndex, and attempting to access them would generate an out-of-bounds exception.
2018-03-29 09:04:23 -07:00
Chris Loer
f9b6d5f09c [core] Fix potential race condition crash in symbol querying..
First half of fix for issue #11538.

Testing `if (pendingData)` didn't work if there _was_ a data update, but the update was "the data for this tile is now null". In that case, the tile's FeatureIndex would be updated, but the tile's data member would remain unchanged.

In the case of a tile's data being deleted, the matching FeatureIndex would have an empty set of bucketLayerIDs, but the _old_ data would still be in place for querying, and the symbolBuckets might not be updated yet (pending onPlacement). In this case `bucketLayerIDs.at(indexedFeature.bucketName)` could throw an out-of-range exception.
2018-03-29 09:04:23 -07:00
John Firebaugh
9499a2bda7 [core] Don't resolve tokens after evaluating a text-field or icon-image expression (#11509) 2018-03-22 16:44:12 -07:00
Chris Loer
673f9e3648 [core] Double maximum label width by reducing glyph precision.
Fixes issue #11507.
Port of GL JS PR #6375.
2018-03-22 13:24:26 -07:00
Chris Loer
4dc191b8da [core] Avoid flashing on pitched overzoomed tiles.
Clamps perspective ratios in shaders.
Fixes issue #11487.
Port of GL JS PR #6365.
2018-03-21 13:26:30 -07:00
Ansis Brammanis
ef1dcc0d5b [core] don't hide icons if text is an empty string 2018-03-19 15:31:38 -07:00
John Firebaugh
449c68e329 [core] Update mapbox-gl-js 2018-03-14 15:26:28 -07:00
John Firebaugh
2912a1423d [core] Stringify expression syntax, not function syntax 2018-03-14 15:26:28 -07:00
Jason Wray
11d506f803 Merge tag 'ios-v3.7.6' into master 2018-03-14 12:48:30 -04:00
Ivo van Dongen
d7bc36db6f [core] prevent render thread from waking up unneeded on still rendering
- No longer sends a update message to the render frontend when rendering in still mode only to shortcut it in the renderer. This prevents unneeded render passes in qt.
2018-03-14 16:39:58 +02:00
Asheem Mamoowala
a57be420b0 [core] TileJSON conversion clamps bounds longitude to [-180,180], per spec 2018-03-09 12:00:12 -08: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
Lucas Wojciechowski
5b3ebc4a24 [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-08 15:48:08 -08:00
Asheem Mamoowala
c54035afb1 [core] Support a range of zooms in TileRange. Accounts for TilePyramid requesting parent tiles of ideal zoom tiles. 2018-03-08 13:49:56 -08:00
Łukasz Paczos
dfdfbc0990 [android] calculating camera's LatLng for bounds without map padding (#11410) 2018-03-08 15:55:47 +01:00
Thiago Marcos P. Santos
eeadec3e06 [qt] Fix Qt build on MinGW 2018-03-07 14:18:07 +01:00
Anand Thakker
8ed540ea7b Port fix for "at" expression off-by-1 error (#11375)
* Port fix for "at" expression off-by-1 error

Refs https://github.com/mapbox/mapbox-gl-js/pull/6269

* Consistency

* Add ignores for symbol positiong differences in real-world tests
2018-03-02 16:38:46 -05:00
John Firebaugh
54f3dc961e Relax type checking for "length" 2018-03-01 17:02:26 -08:00
John Firebaugh
15ba70b5ff Infer type assertions for object
Cross-ports https://github.com/mapbox/mapbox-gl-js/pull/6243.
2018-03-01 17:02:26 -08:00
Ivo van Dongen
1f73c9999e [core] blacklist vao usage on mali t720 (sapphire 650)
Avoids problems on (amongst others) Samsung Galaxy J3
2018-03-01 12:21:32 +01:00
Ivo van Dongen
fdd9890461 [core] check opengl error state after custom layer invocations 2018-03-01 12:21:32 +01:00
Ivo van Dongen
eec0db49e4 [core] blacklist vao usage on mali t720 (sapphire 650)
Avoids problems on (amongst others) Samsung Galaxy J3
2018-03-01 11:46:04 +01:00
Ivo van Dongen
b00e92fa94 [core] check opengl error state after custom layer invocations 2018-03-01 11:46:04 +01:00
Chris Loer
75feda12f1 [core] Implement Expression::serialize()
Issue #10714
- Each expression stores its operator as a string, and default serialization is [operator, serialize(child1), ...]
- Custom implementations of `serialize` for Expression types that don't follow the pattern
- expression::Value -> mbgl::Value converter
- node_expression bindings to expose `serialize`
2018-02-28 16:09:09 -08:00