Commit Graph

2873 Commits

Author SHA1 Message Date
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
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
Chris Loer
bceeba29a3 [core] Add ICU package for Bidirectional text support and arabic text shaping.
Apply bidi and shaping in symbol_layout.
Add utility functions for converting to and from UTF-16.
2016-11-17 14:33:03 -08:00
Chris Loer
40b0c8d076 [core] Use UTF-16 instead of UTF-32 for label features to avoid extra conversions and reduce in-memory size.
Continue to use uint32 as glyph ID to maintain Glyph PBF, even though we're only using 16 bits of that uint32.
Use std::codecvt instead of boost::unicode_iterator for UTF8->UTF16 conversions.
2016-11-17 14:33:03 -08:00
Konstantin Käfer
117062acc1 [core] cache raster tiles 2016-11-17 11:09:30 +01:00
Molly Lloyd
3380f0803a [core] update native for line property function shaders changes (#6658)
* [core] update shaders for line property functions

update deps, define device pixel ratio for all shaders

[core] create ShaderParameter struct to store pixel ratio and overdraw param

repair rebase errs

update shaders to include pixel ratio

make sure collision_box never overdraws

update test suite, move shaders to Painter::render so the correct pixel ratio is applied

move shader compiling back to the Painter constructor

rebase from shader --> program refactor

re-factor parameters for collisionBox and debug programs

remove unused vars from line-program, move blur math to shader

update core files

remove unecessary files

update shaders PR, remove comments

bump test suite sha

fix formatting, incorporate feedback

refactor program.hpp

* [core] remove line transformations that were moved to the shaders, bump shader sha

* [core] shorten ProgramParameter instantiation

* [core] bump shader+test suite shas
2016-11-16 17:34:33 -08:00
John Firebaugh
9d2be04461 [core] Return to static, per-segment approach to VAOs
This is safer now -- it can be an implementation detail of Segment/Context. And the typing of SegmentVector now ensures that the attributes and program match.
2016-11-15 13:55:08 -08:00
John Firebaugh
377d0fb0d2 [core] Introduce SegmentVector 2016-11-15 13:55:08 -08:00
John Firebaugh
58877d1b3d [core] Assign attribute locations sequentially
Two reasons to prefer explicit sequential location assignment, rather than relying on the GLSL linker to assign locations:

* For data-driven properties, we want to have the option to use glDisableVertexAttribArray plus glVertexAttrib*. In order to use glDisableVertexAttribArray, we must avoid using attribute location 0, which cannot be disabled.
* We want to use the same VAO in cases where, say, a fill layer might be rendered with FillProgram at first, and then FillPatternProgram later. VAOs do not store the program binding, only the attribute bindings, so as long as the two programs have the same attributes and attribute locations, only a single VAO (per segment) is needed.
2016-11-15 13:55:08 -08:00
John Firebaugh
bcad3b6d4b [core] Use indexed rendering for collision boxes 2016-11-15 12:39:49 -08:00
Minh Nguyễn
dbd2235744 [core] Line-break ideographic text by character (#6828)
* [core] Line-break ideographic text by character

Allow a line break to be inserted after any supported Chinese, Japanese, or Yi character in a point-placed label. Balance the lines unless non-ideographic text such as Latin letters are present.

Fixes #1223.

* [core] Moved more character classing into util::i18n

* [core] Detect character properties by Unicode block

* [test] Reenabled ideographic breaking tests
2016-11-14 14:53:21 -08:00
Konstantin Käfer
f968ede11b [core] don't run symbol placement more often than necessary 2016-11-14 10:33:21 -08:00
Konstantin Käfer
a7fa97e8a3 [core] don't run symbol placement more often than necessary 2016-11-14 10:35:15 +01:00
Konstantin Käfer
35a66eb2bd [core] don't show OpenGL debug information on startup 2016-11-14 10:25:48 +01:00
Jesse Bounds
96a7a4402e [core] Return source and layer ownership (#7014)
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that 
removing a CustomLayer triggers deinitialization.  Deinitialize all 
custom layers when a style is destroyed in case those layers are not 
explicitly removed.
2016-11-13 19:56:29 -08:00
Ivo van Dongen
13a118e3bd [core] symbol layer - recalculate style on icon/text size changes 2016-11-13 16:53:11 -08:00
Bruno de Oliveira Abinader
b7818f2019 [core] Fix render tile ordering when querying sources 2016-11-13 16:10:36 -08:00
John Firebaugh
870d432f34 [core] Separate pathway for notifying workers of new images/glyphs 2016-11-13 15:32:00 -08:00
Jesse Bounds
edf40bb6d9 [core] Return source and layer ownership (#7014)
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that 
removing a CustomLayer triggers deinitialization.  Deinitialize all 
custom layers when a style is destroyed in case those layers are not 
explicitly removed.
2016-11-11 14:40:04 -08:00
Ivo van Dongen
39b0bc0a40 [core] symbol layer - recalculate style on icon/text size changes 2016-11-11 20:18:16 +01:00
Tobrun
720a0256f5 Default Style Camera on Android (#7019)
* [core] - do not set camera mutated to true when calling Map::getLatLng

* [android] - correctly check if a Map is created without a camera position
2016-11-11 18:13:25 +01:00
John Firebaugh
31047b6cb5 [core] Default camera position to that specified by the style 2016-11-09 17:27:35 -08:00
John Firebaugh
9edda03157 [core] Ensure correct GL context in Map::onLowMemory() 2016-11-09 14:36:44 -08:00