Commit Graph

3411 Commits

Author SHA1 Message Date
Ivo van Dongen
eec0db49e4 [core] blacklist vao usage on mali t720 (sapphire 650)
Avoids problems on (amongst others) Samsung Galaxy J3
2018-03-01 11:46:04 +01:00
Ivo van Dongen
b00e92fa94 [core] check opengl error state after custom layer invocations 2018-03-01 11:46:04 +01:00
Konstantin Käfer
aacd55c64b [core] continue loading style even if we mutate it
When we load a stale style from cache, and the user immediately starts mutating it, we should continue loading the style so that we'll get a fresh copy of the data into our cache and avoid perpetually showing the stale style.
2018-02-27 17:22:54 +01:00
Asheem Mamoowala
4ab07f5be7 Reset tileset-based render sources when any tileset properties changed. (#11042) 2018-02-08 12:39:30 -08:00
Asheem Mamoowala
64374711a0 Support TileJSON bounds property (#10701)
* [core] Parse TileJSON bounds property
* [core] Add TileRange and LatLngBounds::contains(CanonicalTileID)
Move LatLngBounds::contains impl to cpp file
* [core] Skip tile creation outside of tileset bounds
* [core] Fix TileRange for wrapped bounds and use for CustomTileLoader instead of LatLngBounds comparisons for tiles.
2018-02-08 12:39:30 -08:00
Chris Loer
057af7e75f [core] Don't crash on line labels with 0 glyphs.
Fixes issue #10956.
2018-02-07 12:11:19 -08:00
Tobrun
c8a96bb24f [android] - blacklist adreno 2xx for VAO support 2018-02-05 12:03:19 +01:00
Konstantin Käfer
ce817a57f6 [core] blacklist binary program loading for Vivante GC4000 GPUs 2018-01-09 11:41:55 -08:00
Konstantin Käfer
498dbf27b9 [core] don't tie Annotation geometries to Map maxzoom
Instead, geometry generation via GeoJSONVT is now bound to the hardcoded limit of the annotation tile source.
2018-01-02 20:17:15 +01:00
Asheem Mamoowala
6a9eec8ed5 Fix CustomLayer context retain count (#10765)
* [core] RenderCustomLayer should de-initialize old context

* [iOS, macOS] Use toll-free bridging to retain/release MGLOpenGLStyleLayer instead of a separate array.
2017-12-20 14:51:30 -08:00
Chris Loer
f1f2ebb019 [core] Hook LocalGlyphRasterizer "font family" configuration up to Renderer 2017-12-18 12:17:22 -08:00
Chris Loer
a53818a10b [core] Enable local glyph generation using TinySDF.
- Platform-specific LocalGlyphRasterizer is responsible for deciding which glyphs to rasterize locally and for implementing the rasterization.
 - Default platform implementation doesn't locally generate any glyphs -> no behavior change
 - Unit test uses StubLocalGlyphRasterizer, which returns a single fixed bitmap for all CJK glyphs
 - Rename glyph_loader.test to glyph_manager.test
2017-12-18 12:17:22 -08:00
Chris Loer
2e3e88f027 [core] C++ port of TinySDF 2017-12-18 12:17:22 -08:00
Ivo van Dongen
bf9c1fb1b3 [core] blacklist VAO usage on adreno 3xx
- Causes crashes on usage of glBuffer(Sub)Data
2017-10-26 18:14:45 +02:00
Konstantin Käfer
c9d7951e0d [core] fix crash when querying GeoJSON tiles 2017-10-25 22:32:26 +03:00
John Firebaugh
ba8342a12e [core] Add layer before notifying observer 2017-10-25 09:05:00 -07:00
Konstantin Käfer
61ea2f43e4 [core] limit annotation tile source to z16 2017-10-19 16:50:17 -07:00
Fabian Guerra Soto
b7b8baef9d [ios, macos] Add selection support to MGLMultiPoint annotations. (#9984)
* [ios, macos] Add selection support to MGLMultiPoint annotations.

* [ios, macos] Update changelogs.
2017-10-18 15:18:54 -04:00
Konstantin Käfer
9c12a311f2 [core] correctly alter sprite URLs when attaching sprite.png/sprite.json filenames 2017-10-17 17:31:59 -07:00
Konstantin Käfer
0cd646180e [core] don't generate clip IDs for buckets/layers that don't need to be clipped 2017-10-17 15:48:41 -07:00
Asheem Mamoowala
d7d3d2c731 [core] Fix out-of-bounds array access 2017-10-13 10:48:21 -07:00
Konstantin Käfer
78ea88d757 [core] make forcing cache/network only more explicit
Previously, we used the existence of a `prior*` field in the Resource object as an indication for whether we should consult the cache or not. However, this is prone to error, since a failed cache lookup won't set any prior fields. Therefore, we manually set `priorExpires` to 0. This in turn triggered another bug where generated wrong expiration timestamps when the server response we got was expired (or expired between sending and receiving).

This commit changes the flags so that we can now explicitly request CacheOnly/NetworkOnly (or All) loading methods, rather than the implicit Optional/Required naming scheme.
2017-10-12 17:58:03 +02:00
Asheem Mamoowala
df20b0cbec [core] Add cameraForLatLngs() method with modified bearing 2017-10-09 13:58:11 -07:00
Asheem Mamoowala
a323b0dcec [core] Split GeoJSONTileData and related classes into a separate header 2017-09-28 15:47:21 -07:00
Konstantin Käfer
8fae8a1645 [core] Add minzoom to GeoJSONOptions 2017-09-28 15:47:21 -07:00
Konstantin Käfer
64c75b442c [build] split out DefaultFileSource and dependents to a separate target
We don't want to link it into the node bindings, so keep it in a separate target
2017-09-28 13:48:36 -04:00
Jesse Crocker
a06f4849bc [core] Move *TileID hashing to separate impl 2017-09-26 10:55:40 -07:00
Konstantin Käfer
f281e6ae8a [core] fix loading of stale must-revalidate resources
In https://github.com/mapbox/mapbox-gl-native/pull/9670, we implemented support for the Cache-Control: must-revalidate header. While we now respect this header and don't show resources that are stale and have this header set, the optional cache request never completes. This means we're also never going to try to actually get a fresh tile and just never show this tile anymore.

This commit fixes this by responding with a Not Found error when the resource is unusable (= stale and has must-revalidate set). Since we actually still have the data (but can't use it due to caching rules), we're responding with the data as well. To avoid a second cache hit, tile_loader_impl.hpp now passes on the data from the Optional to the Required request so that it can be reused when we get a 304 Not Modified response from the server.
2017-09-25 10:47:20 +02:00
Ivo van Dongen
97a010cc9b [core] custom layer - add contextLost callback
- optional callback method that can be used to do cleanup when the context has been lost before re-initialisation
2017-09-22 23:33:56 +03:00
Ivo van Dongen
bda6ed26c6 [core] send signal to RenderCustomLayer when gl context has been lost
- Prevents cleaning up of GL resources that no longer exist, resulting in a crash
2017-09-22 23:33:56 +03:00
Ivo van Dongen
6211db6968 [core] allow context to be abandoned on destruction
- This enables the use case where the system already destroyed the underlying GL resources. Otherwise, the cleanup would fail and crash
2017-09-22 23:33:56 +03:00
Ivo van Dongen
e18da38faa [core] remove throttling from geometry tile
- This doesn't work for asynchronous rendering -  see https://github.com/mapbox/mapbox-gl-native/pull/9611
2017-09-22 23:33:56 +03:00
Lauren Budorick
a9ddf5b7fd Preserve depth buffer between 3D layers + optimize render order (#9931)
Port of https://github.com/mapbox/mapbox-gl-js/pull/5101: adds a new render pass `Pass3D` before any other rendering wherein we render layers with 3D passes (fill-extrusion layers) to offscreen framebuffers, sharing a depth renderbuffer between those layers in order to render 3D space correctly. Those framebuffers are saved on the RenderLayers and copied back to the map during the translucent pass. Rendering to offscreen framebuffers before we do any clear + draw means we can avoid expensive framebuffer restores.
2017-09-21 14:26:48 -07:00
Konstantin Käfer
f659aa4eda [core] make sure tiles are not treated as complete until all worker operations completed
Previously, when we started a worker operation that eventually throws an exception (e.g. due to the tile not being parseable), and then enqueue another worker operation while the first one is processing, we treated the worker as idle once the first operation's error callback fired, even though the second operation was still in progress. Due to our use of coalescing, I was unable to come up with a reliable test since we'd need to reproduce the behavior described above, which is timing dependent.
2017-09-21 12:20:54 +02:00
Konstantin Käfer
1a684c1f48 [core] keep tiles renderable even if a subsequent error occurs
Since 9a9408e811, we marked tiles as non-renderable if an error occured. This lead to situations where a tile was loaded + parsed successfully, then a revalidation attempt occured (e.g. because the resource was stale) which failed. In this case, we used to mark the tile as non-renderable although we could've used the perfectly parsed (stale) resource.
2017-09-21 12:20:54 +02:00
Asheem Mamoowala
2d84e2a1ae Fix platform dependent number type unsigned long -> uint64_t 2017-09-20 09:05:45 -07:00
Chris Loer
975d6b1698 [core] Don't redo placement for zoom changes at low pitch.
Fixes issue #9996
 Port of GL-JS #5284
2017-09-18 11:59:21 -07:00
Bruno de Oliveira Abinader
c20fdd07db [core] Bypass GeoJSON tile data update if tileID zoom is above source's maxZoom 2017-09-15 18:28:40 -03:00
Bruno de Oliveira Abinader
fe1cf83a28 [core] TransformState::getIntegerZoom should be uint8_t 2017-09-15 18:28:40 -03:00
Bruno de Oliveira Abinader
45d07163eb [core] Reset zoom history state in still mode 2017-09-15 16:41:29 -03:00
Bruno de Oliveira Abinader
0f9773e615 [core] Partially revert ZoomHistory.lastIntegerZoom update 2017-09-15 16:41:29 -03:00
Bruno de Oliveira Abinader
f40519e78d [core] Do not cache stale tiles 2017-09-14 06:30:12 +03:00
Bruno de Oliveira Abinader
88a0187f21 [core] Precompute if has image diffs when updating sources 2017-09-14 06:30:12 +03:00
Bruno de Oliveira Abinader
cda418198f [core] Clear atlasImage rect for a removed pattern 2017-09-13 22:17:41 +03:00
John Firebaugh
2bbde6903a [core] Rename for clarity: ActiveTexture → ActiveTextureUnit 2017-09-11 10:17:54 -07:00
John Firebaugh
437f243d65 [core] Dirty the correct state when a texture is deleted
When a texture is deleted, it is as if all texture units to which that texture object is bound are rebound to texture object zero. Therefore it's the *bindings* that need to be dirtied, not the active texture unit.
2017-09-11 10:17:54 -07:00
Asheem Mamoowala
50fd917510 Fast tileCount with help from @mapbox/sphericalmercator module 2017-09-08 17:38:42 -07:00
John Firebaugh
aa4dff1095 [core] Align line vertex to 4-byte boundary
10 byte vertices are heavily penalized by common GL implementations.
2017-09-08 09:35:47 -07:00
John Firebaugh
b05e5ddd34 [core] Fix z-fighting of translucent fills 2017-09-08 08:30:10 -07:00
Lauren Budorick
f8a53234ff [core] Remove debug::renderTree 2017-09-07 12:07:46 -07:00