Commit Graph

118 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
48ddfef89f [core] Make sure ThreadLocal will not own the pointer it is managing
ThreadLocal should not own the pointer it is managing because
the use case in Mapbox GL is to keep a pointer to a stack allocated
object, like:

```
MyObject foo;
threadLocal.set(&foo);
```

To keep consistency, it is required that we clear the managed
object before ThreadLocal gets destroyed by setting it to `nullptr`.
2017-07-14 15:18:54 +03:00
Bruno de Oliveira Abinader
4014aa6721 [core] GCC 4.9 bracket initialization issues 2017-07-12 20:42:29 +03:00
Thiago Marcos P. Santos
32bef80eec [test] Add utest to assert our dtoa implementation precision 2017-07-12 15:13:33 +03:00
Thiago Marcos P. Santos
7c117281bc [core] Isolate pthread-based tls implementation 2017-07-07 18:10:06 +03:00
Bruno de Oliveira Abinader
0395271b9d [test] Reuse StubGeometryTileFeature in MergeLines 2017-07-06 16:17:58 +03:00
John Firebaugh
40e4755621 [core] Move setStyleJSON/URL to Style; add Map::setStyle 2017-06-22 08:04:39 -07:00
Konstantin Käfer
6ec406b6af [core] add MBGL_CHECK_ERROR to some locations where it was missing 2017-06-21 15:53:51 -07:00
Thiago Marcos P. Santos
7e8bdadb91 [core] Rename ThreadedObject to Thread
Now that the old Thread class is gone, we can give ThreadedObject
a better name.
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
1427628c56 [core] Remove util::Thread
Fixes #6425
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
bfdc4ef646 [tests] Port the ThreadLocalStorage test to the actor model 2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
1178256ae9 [tests] Port the AsyncTask test to the actor model 2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
c34d1cfaa7 [tests] Added tests for ThreadedObject 2017-06-21 14:30:09 +03:00
John Firebaugh
3270440f23 [core] Per-tile glyph/icon atlases 2017-06-13 10:18:43 -07:00
Bruno de Oliveira Abinader
a05f060153 [core] Added Backend::{assume,set}ScissorTest 2017-06-13 13:37:41 +03:00
John Firebaugh
6cf9d5cfbf [test] Lower memory ceiling
We gained a lot of overhead by reducing the initial SpriteAtlas size.
2017-05-26 11:21:56 -07:00
Konstantin Käfer
d664a3e05e [core] leave Image objects in a valid state after premultiply/unpremultiply 2017-05-19 14:13:07 +02:00
John Firebaugh
4c26759b69 [core] Remove WorkQueue
No longer used as of 5cdf838a38.
2017-05-17 09:28:26 -07:00
Bruno de Oliveira Abinader
c6eb4afe0e [tidy] modernize-deprecated-headers 2017-05-12 18:07:36 +03:00
Bruno de Oliveira Abinader
870067360f [tidy] modernize-pass-by-value 2017-05-12 18:07:36 +03:00
Minh Nguyễn
ed54849e99 [core, android, ios, macos, qt] v10 default styles
Upgraded from v9 default styles to v10 wherever the developer expects to get the latest and greatest, as well as in a couple tests where it may be beneficial to ensure that we can handle a two-digit version number in the style URL.
2017-05-11 18:57:39 -07:00
John Firebaugh
baaae99a03 [core, android] Factor JSON string conversions
This adds a `convertJSON` template, to be used like:

   Error error
   optional<Foo> foo = convertJSON<Foo>(string, error);

Internally, it parses the string with RapidJSON and then calls `convert<Foo>(parsed, error)`.

While here, rationalize GeoJSON converters and fix error handling for Tileset conversion in OfflineDownload.
2017-05-08 13:48:57 -07:00
Asheem Mamoowala
5c52401d55 [core] Make Map.addImage tests pass (#8843)
Fix Node tests suite implementation to parse pixelRatio from style json
Premultiply images in the node binding before sending to mbgl core
2017-05-02 09:54:06 -07:00
Lauren Budorick
f6e79d7073 [core] Render fill-extrusion layers (#8431) 2017-04-27 15:56:55 -07:00
John Firebaugh
ddecdeca94 [core] Move ProjectedMeters to projection.hpp 2017-04-18 14:43:31 +03:00
Bruno de Oliveira Abinader
2f4d162deb [core] Tighten geo.hpp ctors 2017-04-14 12:33:13 -07:00
John Firebaugh
16a2839e23 [all] Make LatLng coordinates read-only 2017-04-06 09:22:51 -07:00
John Firebaugh
0314a46ee4 [core] Tighten LatLng and other geo.hpp classes
* Remove LatLng::null and enforce invariants
* Remove unnecessary operator bool()
2017-04-06 09:22:51 -07:00
Konstantin Käfer
68e032e505 [core] Remove private header includes from CLI utilities 2017-03-28 13:53:19 +02:00
Konstantin Käfer
8e5214144e [core] Ensure that a BackendScope exists when doing GL calls 2017-03-23 14:50:11 -07:00
John Firebaugh
84aac92b4e [test] Increase memory test ceiling slightly 2017-03-08 13:10:38 -08:00
Anand Thakker
f901e776b3 [core] Implement data-driven styling for {text,icon}-{color,opacity,halo-color,halo-blur,halo-width} (#7939)
* Add symbol dds attributes and adapt style code generation

* Update to mapbox-gl-js/master

* Refactor SymbolFeature as a subclass of GeometryTileFeature

Prepares for enabling DDS on symbol paint properties by allowing the
SymbolFeatures, which we keep around after constructing SymbolLayout,
to be used in evaluating data-driven paint properties later in the
layout process.

* Draft approach for splitting icon/text paint properties

The `Program` types are set up to bind GL attributes to each of the
data-driven paint properties specified in the `PaintProperties` type
provided.  Since `SymbolPaintProperties` specifies both `Text*` and
`Icon*` properties, the symbolIcon, symbolIconSDF, and symbolGlyph
programs each attempt to bind roughly double the number of attributes
that they actually need.

This change addresses this by:
- Adding the more specific `IconPaintProperties` and `TextPaintProperties` types, which are subsets of the full `SymbolPaintProperties`.
- The symbol layer continues to use its `SymbolPaintProperties paint` member to track layer property state, but it provides helpers that construct objects of each the specific `{Icon,Text}PaintProperties::Evaluated` type, for use by the painter.
- The three symbol programs instantiate `Program<>` using the appropriate `{Icon,Text}PaintProperties` type.

* check in generated style code

* Populate paint buffers for symbol DDS properties

* Address first round of review comments

* Refactor VectorTile{Layer,Feature} to explicitly share data

* Update submodule
2017-02-28 19:54:24 -08:00
Anand Thakker
4b81c924cc [core] Log Memory.Footprint test results (#8170)
* Log Memory.Footprint test output

* On CI, only run Memory.Footprint test with libjemalloc
2017-02-28 14:11:35 -08:00
Thiago Marcos P. Santos
bc5e9afd0d [tests] Added unit tests for Thread::pause/resume 2017-02-25 14:03:38 +02:00
John Firebaugh
5354572620 [core] Eliminate manual HeadlessBackend activation management 2017-02-20 12:04:21 -08:00
John Firebaugh
94f011895c [core] Make Image safer
Provide Image::copy, which handles copying rectangles from a source to a destination, with thorough bounds checking.

Also fixes an indexing error in SpriteAtlas, where the top row of pixels in a wrapped image was copied from the wrong source row.
2017-02-14 12:29:01 -06:00
Konstantin Käfer
f97e36acc8 [core] add tests for user/password, port, trailing dot, and IPv4/IPv6 address parsing 2017-02-13 17:23:20 +01:00
Thiago Marcos P. Santos
9279b198df [test] Added a test to make sure 404 does not trigger a retry 2017-02-07 12:17:40 +01:00
Dane Springmeyer
09c6934791 regex is no longer used after 6c91c3e 2017-02-02 15:48:00 -06:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
Konstantin Käfer
62ea1f2185 [core] remove trailing whitespace, add trailing newlines, add space after // 2017-01-27 11:44:16 +01:00
John Firebaugh
d076ba0567 [core] Clean up merge_lines.cpp and add bounds checking 2017-01-18 13:38:05 -06:00
Konstantin Käfer
1fc8159481 [test] add tests for paths with leading slashes 2017-01-17 17:38:57 +01:00
Konstantin Käfer
4b0cb858ba [core] include leading slash in URL.path 2017-01-17 17:38:57 +01: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
Konstantin Käfer
77db372123 [core] refactor URL parsing 2016-12-21 13:00:32 +01: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
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
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
Konstantin Käfer
e76de05402 [build] move logging to util 2016-11-22 20:58:51 +01:00
Konstantin Käfer
117863f111 [build] move headless rendering files to platform/default 2016-11-22 20:58:51 +01:00