Commit Graph

2904 Commits

Author SHA1 Message Date
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
ea4c0b77c3 [core] Replace FeatureIndex::collisionTile with a method parameter
This reduces state and simplifies the test added in the prior commit.
2017-01-10 10:15:22 -08:00
John Firebaugh
40051fb68e [core] Keep symbol and non-symbol buckets segregated
Discard prior symbol buckets only when new symbol buckets became available, in order to eliminate flickering when tiles are refreshed.
2017-01-10 10:15:22 -08:00
John Firebaugh
b6894dd4fc [core] Unify update and render into a single step
Update only when, and just prior to, rendering, giving no opportunity to interleave unexpected state changes. This means that every time anything about the state is changed, we'll have to attempt a render to reflect that change. In the case of continuous rendering this has happened before this change as well, but it leaves no room for time to pass between an update and a render. In the case of still image rendering, a render call will only actually paint something to the view when all resources have been loaded.
2017-01-06 12:03:48 -08:00
Chris Loer
d5b878a553 Small line breaking improvements based on testing with Chinese data:
- Put "breakable" punctuation (such as a hyphen) on the line that starts the break, not the line after the break.
- Process all characters with the line breaking algorithm, even if we don't have glyphs for them. Some fonts have glyph-less breakable characters (we end up treating them similarly to a "zero-width space").
- Don't include trailing white space in raggedness calculations
- Make the "favor short final lines" rule more aggressive (unlike the other changes, this one is purely an aesthetic choice)
2017-01-05 10:22:53 -08:00
Chris Loer
12a9932ebc Port raggedness-minimizing line breaking from gl-js. 2017-01-05 10:22:53 -08:00
Chris Loer
35ccb01dbd Render newlines in labels even if there's nothing else on the line. 2017-01-05 10:22:53 -08:00
Chris Loer
f68449aeb8 Cleaning up line breaking code.
* Don't include trailing spacing (as opposed to whitespace) in lineLength
* Modify BiDi interface to require initial bidi layout and linebreaking to happen in one call.
* Code style changes suggested by @kkaefer
2017-01-05 10:22:53 -08:00
John Firebaugh
0c0064c050 [core] Get rid of user-specified refs 2017-01-04 17:38:33 -08:00
John Firebaugh
4d6c5b2d3b [core] Remove constexpr from Color
GCC can't cope with it.
2017-01-04 12:10:27 -08:00
John Firebaugh
65c28deefe [core] Update gl-js for shader change 2016-12-23 10:49:51 -08:00
John Firebaugh
083cee8956 [core] Correct boolean function interpolation 2016-12-22 18:14:00 -08:00
Ansis Brammanis
2cf238f74e [core] fix matrix z range and remove hack
ported from -js: 0b5520fa5ab2a4659d80dcffa8b035a0d84fe1ca

This should fix the issue behind #2270 and remove the need for the hack
added in #3740.
2016-12-21 15:46:36 -08:00
Ansis Brammanis
29099399a9 [core] clearer pitched line antialiasing
ported from -js: ef5582dd3bc5c15a3112e875ed66494dab8e9d0b

Project the extrusion and compare it's projected pixel length with the
actual pixel length and adjust antialiasing accordingly.

The previous approach calculated the adjustment much more indirectly and
had no intuitive explanation.
2016-12-21 15:46:36 -08:00
Ansis Brammanis
38b5cb0c77 [core, ios] replace altitude with fov
ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19

`altitude` was a terribly-named variable that was used to indirectly
control the fov. This should eliminate some confusion.

`altitude` was equivalent to `cameraToCenterDistance / height`
2016-12-21 15:46:36 -08:00
Ansis Brammanis
ebd241363d [core] fix text blurriness at different FOVs
ported from -js: c52a09639ceeeb809cd837360993df9c45b45420

This replaces a hardcoded shader approximation with a more correct,
FOV-dependent one.

`gl_Position.w - 0.5`
is replaced with
`gl_Position.w / tan(fov)`

The `/ tan(fov)` is handled by multiplying `1 / tan(fov)` into `u_gamma`
outside the shader.

I think `- 0.5` was just chosen as something that looked right for the
default fov.lease enter the commit message for your changes. Lines starting
2016-12-21 15:46:36 -08:00
John Firebaugh
029805f729 [core] Replace magic number with constant-based calculation 2016-12-21 13:42:30 -08:00
John Firebaugh
bcf2c3ff9e [core] Polylabel-based "pole of inaccessibility" symbol placement 2016-12-21 13:42:30 -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
77db372123 [core] refactor URL parsing 2016-12-21 13:00:32 +01:00
Minh Nguyễn
a6b1773a44 Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.5-master
Also reran make style-code and manually discarded anything related to fill extrusion layers.
2016-12-20 12:41:40 -08:00
John Firebaugh
dad57df38e [core] Fix symbol rendering for multipoints
Ports https://github.com/mapbox/mapbox-gl-js/pull/3763 and https://github.com/mapbox/mapbox-gl-js/pull/3806.
2016-12-20 08:30:39 -08:00
John Firebaugh
3dcff6c3e1 [core] const correctness 2016-12-20 08:30:39 -08:00
John Firebaugh
f74de67315 [core] Mark tile as incomplete while redoing placement 2016-12-14 12:15:29 -08:00
John Firebaugh
34fbd565b8 [core] Remove unused 2016-12-14 12:15:29 -08:00
Jesse Bounds
e88f904464 [core] Port ensure a non-zero source tile cache size (#7438)
This ports https://github.com/mapbox/mapbox-gl-native/pull/7242/
commits/2d323211af54499d5c822b8e45d7415bf92112f0 to the iOS 3.4.0
release branch.
2016-12-14 11:39:33 -08:00
Ivo van Dongen
b221b6c5fb [core] Swap order of Style::recalculate and Style::relayout
Style::relayout uses source.baseImpl->loaded, a flag which is updated by Style::recalculate. So recalculate first, then relayout.
2016-12-13 12:56:08 -08:00
Ivo van Dongen
bb6973ae90 [core] guard against duplicate layer ids 2016-12-13 10:03:05 -08:00
Ivo van Dongen
18730d598d [core] use raii to guard backend deactivation 2016-12-13 10:03:05 -08:00
John Firebaugh
c12b52c6a7 [core] Fix debug rendering
* Off-by-one in DebugBucket indexing
* Must unbind VAO before binding index buffer in Context::createIndexBuffer
2016-12-13 09:42:46 -08:00
Ivo van Dongen
28be37fcbe [core] Swap order of Style::recalculate and Style::relayout
Style::relayout uses source.baseImpl->loaded, a flag which is updated by Style::recalculate. So recalculate first, then relayout.
2016-12-12 16:49:02 -08:00
John Firebaugh
b0a928dcbc [core] Ensure a non-zero source tile cache size
Previously, for viewport sizes less than 512 pixels in either direction, the computed size was 0.
2016-12-12 16:49:02 -08:00
Bruno de Oliveira Abinader
c0e18ad80c [core] Added BidiImpl to avoid ICU types exposure 2016-12-12 22:34:52 +02:00
Bruno de Oliveira Abinader
ce5ed9e649 [build] ICU is now configured per platform 2016-12-12 22:34:52 +02:00
Ivo van Dongen
028db7feba [core] guard against duplicate layer ids 2016-12-12 09:05:23 -05:00
Ivo van Dongen
c76a933514 [core] use raii to guard backend deactivation 2016-12-12 09:05:23 -05:00
John Firebaugh
3b2a4216a2 [core] Implement circle-stroke properties
Also includes stubs for fill-extrusion layer, because most of the code was auto-generated.
2016-12-09 09:35:21 -08:00
Konstantin Käfer
dc1bda435f [core] add util::isURL() for checking whether a string starts with a URL scheme 2016-12-07 10:46:43 +01:00
John Firebaugh
cc6e5c9df9 [core] Move CrossFadedPropertyEvaluator to its own file 2016-12-06 15:05:45 -08:00
John Firebaugh
05b0dcd0f8 [core] Move evaluation algorithm to Function 2016-12-06 15:05:45 -08:00
Roman Blum
1045934d5e [core, ios, macos] Add image accessor to MGLStyle (#7096)
* [core] Add interface to get image from sprite atlas

* [tests] Add tests for Map::getImage

* [ios, macos] WIP: get MGLImage for name from style

* [ios, macos] Fixed -imageForName:

Convert from sprite images to platform images using the existing encodePNG() function, which is also used for printing. Allow -imageForName: to return nil without an assertion failure. Added a basic test.
2016-12-05 17:16:13 -08:00
Minh Nguyễn
3503c0e767 Merge branch 'release-ios-v3.4.0' into 1ec5-release-ios-v3.4.0-beta.4-master 2016-12-03 15:36:42 -08:00
Ivo van Dongen
2c4e7ae70f [core] guard against duplicate source id’s 2016-12-02 11:25:30 -08:00
John Firebaugh
7d16824fda [core] Functions must have at least one stop
This is already enforced by the style validator in mapbox-gl-style-spec. Enforce it here too.
2016-12-01 09:00:06 -08:00
John Firebaugh
54c557d982 [core] Use indexed rendering everywhere 2016-12-01 08:57:11 -08:00
Chris Loer
5f29c3ba26 [core] Full support for line breaking bidirectional text using ICU bidi functionality.
- Trim whitespace from labels before determining their max-width for alignment.
 - Fix crash on labels that contain lines with only a single character of whitespace.
2016-11-30 11:54:08 -08:00
Ivo van Dongen
60e451174f [core] guard against duplicate source id’s 2016-11-30 19:35:29 +02:00
Aki Koskinen
5e79077491 Always use a dot as a decimal point in string, independent of locale
std::to_string() potentially uses a decimal point character different
than a dot (.), depending on the environment's locale. But since this
generated string will be part of GLSL code, there needs to be a dot and
nothing else.
2016-11-29 16:54:28 -02:00
Minh Nguyễn
850b70ff91 [core, ios, macos] Added layers and sources properties to MGLStyle
Added new layers and sources properties to MGLStyle that contain all the style’s layers and sources, respectively. These properties are KVC-compliant with all the mutable to-many methods. Layers are ordered from topmost to bottommost, for consistency with Cocoa APIs where front/first means top and back/last means bottom.

Also added storage for mbgl::style::Source in MGLSource proper for wrapping AnnotationSource. Until the style finishes loading, its name property is set to nil.

Fixes #6003.
2016-11-28 15:45:37 -08:00