Commit Graph

3267 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
70e557a6f8 [core] Use gmtime_s on Windows
gmtime_r is POSIX
2017-07-12 15:13:33 +03:00
Thiago Marcos P. Santos
0d7d3d8959 [core] Use std::to_string on Windows
Clang on Window's can't parse rapidjson's dtoa.
2017-07-12 15:13:33 +03:00
Thiago Marcos P. Santos
3b49ec3a0b [core] Prefer std:: functions over POSIX
s/unlink/std::remove
2017-07-12 15:13:33 +03:00
Ansis Brammanis
eac297185d [core] add static asserts for more gl constants
and rename BufferUsageType to BufferUsage
2017-07-11 09:10:25 -07:00
Ansis Brammanis
d661b4ba61 [core] port pitch-label collision hack
81363951ed
2017-07-11 09:10:25 -07:00
Ansis Brammanis
e514138b69 [core] improve legibility of labels that follow lines
port https://github.com/mapbox/mapbox-gl-js/pull/4781

This improves legibility of labels that follow lines in pitched views.
The previous approach used the limited information in the shader to
calculate put the glyph in approximatelyright place. The new approach
does this more accurately by doing it on the cpu where we have access to
the entire line geometry.
2017-07-11 09:10:24 -07:00
Ansis Brammanis
77734cfe1b [core] fix transformMat4
It used to overwrite values in the middle of the calculation which would
cause problems when `out` and `a` were a reference to the same vector.
2017-07-11 09:10:24 -07:00
Chris Loer
a0e37fe35b [core] Hold on to tile yStretch value for rendering old symbolBuckets while waiting for new ones. 2017-07-11 09:10:24 -07:00
Chris Loer
a432a289a3 [core] Change OverscaledTileID to also include a "wrap" value.
This prevents TilePyramid from sharing wrapped copies of tiles.
This is necessary because two wrapped tiles no longer share the same CollisionTile.
2017-07-11 09:10:24 -07:00
Chris Loer
72f6b73590 [core] Limit symbol re-placement on changed tile distance to pitch > 25. 2017-07-11 09:10:24 -07:00
Chris Loer
7c7564d72e [core] Re-generate shaders. 2017-07-11 09:10:24 -07:00
Chris Loer
8c23f14a9f [core] Use fade texture in collision debug boxes so that they agree more closely with symbol shaders. 2017-07-11 09:10:23 -07:00
Chris Loer
f8402e2042 [core] Set "max_camera_distance" to 1.5 for viewport-aligned road labels.
Viewport-aligned curved labels start to look very strange in the distance. Until we have a better system for projecting them, just prevent them from showing.
2017-07-11 09:10:23 -07:00
Chris Loer
2ee59796fb [core] Enable tile clipping for collision boxes.
Necessary because collision boxes now change shape based on while tile they're part of.
2017-07-11 09:10:23 -07:00
Chris Loer
7b29b90e7f [core] Extend collision feature boxes to accommodate potential pitch-scaling. 2017-07-11 09:10:23 -07:00
Chris Loer
8f5e0b66ab [core] Pass pitch-scaling vertex attributes and uniforms to shaders. 2017-07-11 09:10:23 -07:00
Chris Loer
59df3a90f4 [core] Improved label pitch-scaling: approximate collision box shapes based on tile distance from camera. 2017-07-11 09:10:22 -07:00
Konstantin Käfer
d03fd0dce2 [build] Don't use maybe-uninitialized and misleading-indentation in Clang, since they're not implemented there 2017-07-11 16:23:19 +02:00
Thiago Marcos P. Santos
7c117281bc [core] Isolate pthread-based tls implementation 2017-07-07 18:10:06 +03:00
Thiago Marcos P. Santos
f734126416 [core] Fix conditional unitialized jump on RenderGeoJSONSource
```
==24942== Conditional jump or move depends on uninitialised value(s)
==24942==    at 0x7D943D: mbgl::RenderGeoJSONSource::update(mbgl::Immutable<mbgl::style::Source::Impl>, std::vector<mbgl::Immutable<mbgl::style::Layer::Impl>, std::allocator<mbgl::Immutable<mbgl::style::Layer::Impl> > > const&, bool, bool, mbgl::TileParameters const&) (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0x796445: mbgl::RenderStyle::update(mbgl::UpdateParameters const&) (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0x77E29D: mbgl::Map::Impl::render(mbgl::View&) (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0x77E559: mbgl::Map::Impl::renderStill() (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0xA39772: uv__async_event (async.c:98)
==24942==    by 0xA398F8: uv__async_io (async.c:138)
==24942==    by 0xA4375F: uv__io_poll (linux-core.c:380)
==24942==    by 0xA3A1F2: uv_run (core.c:354)
==24942==    by 0x61BADC: API_ZoomHistory_Test::TestBody() (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0x89FDE9: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0x885450: testing::Test::Run() (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==    by 0x88642F: testing::TestInfo::Run() (in /home/tmpsantos/Projects/mapbox-gl-native/build/linux-x86_64/Release/mbgl-test)
==24942==
```
2017-07-07 17:05:34 +03:00
Thiago Marcos P. Santos
e962b79b0f [core] Fix sorting order for render tiles
Sort by z order, so lower res tiles don't get rendered
over high res tiles.
2017-07-07 14:28:52 +03:00
Thiago Marcos P. Santos
407fbc70b1 [core] Prefetch low resolution tiles 2017-07-07 14:28:52 +03:00
Minh Nguyễn
2fe3dd64c0 [core] Updated script detection for Unicode 10
Updated script detection code to reflect changes in Unicode 10 and UTR 50 revision 17.
2017-07-06 11:50:03 -07:00
Chris Loer
d5fbcb242a [core] Implement circle-pitch-alignment property
Closes issue #9349.
2017-07-06 09:39:26 -07:00
Bruno de Oliveira Abinader
a1ed9f8794 [core] Don't upload empty buckets 2017-07-06 16:17:58 +03:00
John Firebaugh
754d2f377a [core] make{Glyph,Image}Atlas only once for any number of symbol layers 2017-07-06 05:28:37 -07:00
Konstantin Käfer
64a827c325 [core] rename getStencils() to getClipIDs() to better reflect what it actually does 2017-07-06 12:32:54 +02:00
Konstantin Käfer
107622a72b [core] don't use unordered_* collections for things we need to sort anyway 2017-07-06 12:32:54 +02:00
Konstantin Käfer
6d526c7b1d [core] refactor ClipID generation 2017-07-06 12:32:54 +02:00
John Firebaugh
87081b8391 [core] Fix iterator invalidation in erase_if
vector::erase invalidates iterators. It's not safe for erase_if to cache the end iterator nor increment, then erase.
2017-07-05 20:15:17 +02:00
Bruno de Oliveira Abinader
60eae41549 [core] Factor timePoint initialization: take 2 2017-07-04 15:50:50 +03:00
Lauren Budorick
b5fed1172d [core] Bind only active attributes in order to avoid exceeding attribute limits (#9373)
Introducing two new attributes to enable property functions for line-width (#9250) pushed the attribute count over GL_MAX_VERTEX_ATTRIBS on some devices. Now we selectively bind only attributes that are used, making it unlikely to surpass GL_MAX_VERTEX_ATTRIBS.
2017-06-29 11:29:48 -07:00
Bruno de Oliveira Abinader
1df45a5e42 [core] Check if frameZoom is NaN in Transform::flyTo callback 2017-06-28 20:59:56 +03:00
Bruno de Oliveira Abinader
433e54e636 [core] Clamp to scale boundaries in TransformState::setLatLngZoom 2017-06-28 20:59:56 +03:00
Ivo van Dongen
20189db67f [core] remove tile cache size setter 2017-06-27 17:02:40 -07:00
Ivo van Dongen
24a00231f3 [core] fix render doesn’t flag style mutation 2017-06-26 16:19:06 -07:00
John Firebaugh
150fc6b643 [core] Don't transition new layers on a setStyle operation 2017-06-26 09:42:35 -07:00
Thiago Marcos P. Santos
6beccef517 [core] Introduce the ResourceTransform
Wrapper for transforming URLs on the OnlineFileSource.
2017-06-26 16:32:21 +03:00
Thiago Marcos P. Santos
54c3ccc37d [core] Make the mbgl/actor headers public
They will be needed by the DefaultFileSource, something that we
also export as public.
2017-06-26 16:32:21 +03:00
John Firebaugh
40e4755621 [core] Move setStyleJSON/URL to Style; add Map::setStyle 2017-06-22 08:04:39 -07:00
John Firebaugh
1520a56813 [all] Promote Style to public API 2017-06-22 08:04:39 -07:00
John Firebaugh
be7e9bbb8d [core] Refactor CustomLayer internals
Move the responsibility for initialization/deinitialization/rendering to RenderCustomLayer. This eliminates special case code from Map and Style.
2017-06-22 08:04:39 -07:00
Konstantin Käfer
122db77581 [core] document lifetimes of GeometryTileFeatures 2017-06-21 17:18:08 -07:00
Konstantin Käfer
244484ca6c [core] retain GeometryTileLayer in SymbolLayout
We're storing GeometryTileFeature objects in SymbolLayout, but they may reference data in GeometryTileLayer, which could go away if we don't retain it.
2017-06-21 17:18:08 -07:00
Konstantin Käfer
7b90af5d35 [core] always return owning pointers for GeometryTileData::getLayer() 2017-06-21 17:18:08 -07:00
Konstantin Käfer
2cc330463d [core] switch to vector-tile library for decoding Mapbox vector tiles 2017-06-21 17:18:08 -07:00
Konstantin Käfer
0f300d8dcd [core] shared feature data for GeoJSONTileData objects 2017-06-21 17:18:08 -07:00
Konstantin Käfer
4ea4715179 [core] shared data among AnnotationTileFeature objects 2017-06-21 17:18:08 -07:00
Konstantin Käfer
4bfc559223 [core] add benchmark for vector tile parsing 2017-06-21 17:18:08 -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