Commit Graph

2894 Commits

Author SHA1 Message Date
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
Konstantin Käfer
4fe071b518 [build] upgrade to variant 1.1.4 and dependencies 2016-11-28 18:02:00 +01:00
Bruno de Oliveira Abinader
5ae92de618 [core] Use double in TransformState::zoomScale 2016-11-27 18:50:24 +02:00
Konstantin Käfer
e76de05402 [build] move logging to util 2016-11-22 20:58:51 +01:00
Konstantin Käfer
9353fcbf4c [build] move default_styles to platform/default 2016-11-22 20:58:51 +01:00
Konstantin Käfer
8fa078c086 [core] cache raster tiles 2016-11-22 08:32:02 -08:00
Konstantin Käfer
6c91c3e519 [core] replace <regex> usage with plain string code to reduce binary size 2016-11-18 10:38:49 +01:00
Bruno de Oliveira Abinader
e9f849e4d0 [core] Sort symbol render tiles prior to rendering 2016-11-18 09:13:53 +01:00
Bruno de Oliveira Abinader
ce14037b55 [core] Cleanup symbol clipping 2016-11-18 09:13:53 +01:00
John Firebaugh
38fcbe21d4 [core] Convert style properties to a tuple-based approach
This converts the style property classes (CirclePaintProperties and so on) to the same tuple-based approach as gl::Attribute and gl::Uniform. The approach is outlined in https://github.com/mapbox/cpp/blob/master/C%2B%2B%20Structural%20Metaprogramming.md.

The main advantage of this approach is it allows writing algorithms that work on sets of style properties, without resorting to code generation or manually repetitive code. This lets us iterate on approaches to data-driven properties more easily.

Another advantage is that the cascading, unevaluated, and evaluated states of a set of properties exist as independent structures, instead of individual properties holding their own state. This is a more functional approach that makes data flow clearer and reduces state.
2016-11-17 15:13:38 -08:00
Chris Loer
d4fc66af39 [core] Add minimal line breaking support for RTL text. 2016-11-17 14:33:03 -08:00