Commit Graph

3384 Commits

Author SHA1 Message Date
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
Ivo van Dongen
be859427a9 [core] remove map update enum 2017-08-31 18:45:28 +03:00
Ivo van Dongen
4c96603eb6 [core] move annotation tile updates to renderer
- AnnotationData.updateData() was not completely thread safe. Calling it from the renderer thread instead of the main thread fixes this
- Since we moved the coalescing of updates out of the map and into the renderer frontend implementations, the updateData was called too much, resulting in degraded performance. Moving it into the renderer makes sure it gets coalesced again.
2017-08-31 18:45:28 +03:00
Ivo van Dongen
377faaf4f8 [core] annotation manager - manage dirty state internally 2017-08-31 18:45:28 +03:00
Bruno de Oliveira Abinader
d43757271e [node] Cleanup NodeMap::Render 2017-08-31 10:17:21 +03:00
Asheem Mamoowala
69b52367d3 [core][ios][macos][android]DDS-ify text-letter-spacing and text-max-width 2017-08-30 10:59:08 -07:00
Ivo van Dongen
0bb97e2307 [core] make thread.hpp public 2017-08-30 17:18:37 +03:00
Bruno de Oliveira Abinader
af01d6ffee [core] Set Style::Impl::loaded only when finishing parsing style 2017-08-30 16:43:13 +03:00
Bruno de Oliveira Abinader
e1dfdc9338 [core] Clear RenderGeoJSONSource tilePyramid if no data is available 2017-08-30 16:02:26 +03:00
Lauren Budorick
2de89a99bc Implement icon-anchor property 2017-08-28 13:32:56 -07:00
Chris Loer
6cbeeff689 [core] Fix issue #9843 (overzoomed line label rendering glitch).
Ports fix for GL JS issue #5112.
Line label projection can't be based on tile geometry that's behind the plane of the camera.
The relevant tests are still ignored because the overzoomed collision behavior is different between native and JS.
2017-08-25 14:20:42 -07:00
Chris Loer
17a3a805f1 [core] Add optional type template parameter to util::unit, so that it doesn't always pick up the default type of 'double' from util::mag. 2017-08-25 14:20:42 -07:00
Bruno de Oliveira Abinader
fe8cbc78d3 [core] Added GeometryTileWorker-owned image correlation ID 2017-08-25 23:41:52 +03:00
Bruno de Oliveira Abinader
f3fc9b2b92 [core] Don't throttle placement in still mode 2017-08-25 23:41:52 +03:00
Bruno de Oliveira Abinader
8b45d64efc Revert "[core] Ensure image dependencies in GeometryTileWorker::onImagesAvailable"
This reverts commit cd8eb13ba2.
2017-08-25 23:41:52 +03:00
John Firebaugh
b0c03f9396 [core] No need to skip glClear optimization in overdraw mode 2017-08-24 13:06:23 -07:00
John Firebaugh
28be432041 [core] Eliminate temporary sources set 2017-08-24 13:06:23 -07:00
John Firebaugh
4dd30db7cb [core] Clean up includes and forward declarations 2017-08-24 13:06:23 -07:00
John Firebaugh
9c02e4d7dd [core] Inline Renderer::Impl::doRender 2017-08-24 13:06:23 -07:00
John Firebaugh
d05486391a [core] Remove unnecessary members from UpdateParameters 2017-08-24 13:06:23 -07:00
John Firebaugh
079ddfc8e4 [core] Create BackendScopes in Renderer, assert in Impl
This avoids a long series of reset() calls in the Impl.
2017-08-24 13:06:23 -07:00
John Firebaugh
ad70cd30ef [core] Inline RenderItem and RenderData 2017-08-24 13:06:23 -07:00
John Firebaugh
47ac22b6ac [core] Merge RenderStyle into Renderer::Impl 2017-08-24 13:06:23 -07:00
John Firebaugh
d26559bb28 [core] Avoid GeometryTile dependency in FeatureIndex 2017-08-24 13:06:23 -07:00
John Firebaugh
e706ed4b2e [core] Avoid RenderStyle dependency in query code 2017-08-24 13:06:23 -07:00
Bruno de Oliveira Abinader
80e4b2f1ab [core] Update ZoomHistory.lastInteger{Zoom,Time} if different from floor zoom 2017-08-22 10:17:25 +03:00
Asheem Mamoowala
d21f19686b Set Default MaxZoom to 22 2017-08-21 15:01:36 -07:00
Chris Loer
fd2b525c4d [core] Correct x-offset introduced by vertical glyph rotation
Fixes issue#9768.
Port of GL JS PR #5100.
2017-08-18 10:53:26 -07:00