Commit Graph

4052 Commits

Author SHA1 Message Date
Mikhail Pozdnyakov
3a0db3921c [core] Introduce RenderTileSetSource class
Encapsulates the tiles update logic based on the given tile set.
2019-07-22 10:41:03 +03:00
Mikhail Pozdnyakov
ff42997b01 [core] Avoid unneeded tile sets copying at sources code 2019-07-22 10:41:03 +03:00
Mikhail Pozdnyakov
bbe7679bc6 [core] Render sources keep the existing tiles until the new tileset is ready
In Continuous map mode, keep the existing tiles if the new tileset is not
yet available, thus providing smart style transitions without flickering.
2019-07-22 10:41:03 +03:00
Thiago Marcos P. Santos
fe9d463658 [core] Do not try to place a center anchor beyond the center of the line
Once the algorithm finds the center of the line, if placement is
not possible, do not place the anchor.

Previous code was trying to continue place the label beyond the center
of the segment.

Fixes #15139.
2019-07-19 15:17:00 +02:00
Aleksandar Stojiljkovic
d7f28c3079 Fix wrong #15065 nit fix
Change in 3ffc14a325
was a typo while addresssing review nit: while it didn't affect render tests it doesn't work properly in all cases.

Fixes: #14844, #14779, #15039
2019-07-19 12:58:19 +03:00
Aleksandar Stojiljkovic
ae38a22dc1 [core] Fix collision with content insets
Viewport center offset usage was wrongly submitted in #14664. It was part of alternative approach that used enlarged viewport. Existing and added tests were not sufficient to spot the regression, since the collision check padding is usually larger than the center offset x and y. Annotation picking has tolerance of only 10 pixels but no annotation integration test was using content insets.

Usage of offset is not needed because `posMatrix` in e.g. `CollisionIndex::projectPoint(const mat4& posMatrix, const Point<float>& point)` already incorporates center offset (projection matrix) and the code in current master was just offsetting all by the value.

Modified [ios] MGLAnnotationViewIntegrationTests.testSelectingAnnotationWithCenterOffset to use different insets. It verifies the fix.

Fixes [iOS] Annotations are not selectable (added via iosapp menu) #15106:

In case of #15106, view's original content insets is {top:88, bottom:34}, causing that center offset is {x:0, y:27} and selection with tolerance of 10 wouldn't select annotation.
After tapping the view, so that the header gets removed, view's content insets get changed to {top:44, bottom:34}, center offset is {x:0, y:5} and annotation selection would work, as described in #15106.

Fixes: #15106
2019-07-17 16:13:33 -07:00
Mikhail Pozdnyakov
8574b8b726 [core] Favor previous anchor only when still in the text-variable-anchor options
Port of https://github.com/mapbox/mapbox-gl-js/pull/8473
2019-07-17 14:52:47 +03:00
Mikhail Pozdnyakov
ff7fb5e46d [core] RenderCustomGeometrySource should clear tiles after style update
Otherwise, the remaining stale tiles cannot be updated.
2019-07-12 19:38:23 +03:00
Mikhail Pozdnyakov
fa5646d112 [core] Synchronize render passes and render tiles
Before this change render passes were assigned for the
whole layer at properties evaluation stage.

This caused problems, as layer render data are bound
to the tile and these data might differ from tile to
tile, depending on which tile has been updated by the
tile worker and which has not been yet updated.

This change takes into consideration the actual render
passes required for each tile and combines them for
the layer render passes. Naturally, this change also
introduces render pass check for each render layer in
`RenderLayer::render()` implementations.
2019-07-11 15:36:28 +03:00
Łukasz Paczos
da8ed930de [core] decrease the minimum pixel distance required to interpolate during camera animation
The changes introduced in #9199 changed the minimum required pixel distance between start and end points to >= 1px in order to interpolate, which in scenarios of big zoom changes and low pixel density can result in animation to the previous position and then a jump to the target.
2019-07-09 18:07:22 +02:00
Mikhail Pozdnyakov
6b8df343ef [core] Put gfx backend scope guard to Renderer::reduceMemoryUse() 2019-07-09 17:36:10 +03:00
Aleksandar Stojiljkovic
286bc66ba4 Issue #15065 changelogs and nit fix. 2019-07-09 15:13:38 +02:00
Aleksandar Stojiljkovic
2c5528e691 Fix layers rendering after fill-extrusion
This fixes following issues:
* Fix some false passing combinations/fill-extrusion-translucent--XXXX tests
* Fix and enable other, failing but ignored, combinations/fill-extrusion-translucent--XXXX tests
* Fix rendering of layers that are on top of fill-extrusion layers

state.getProjMatrix(nearClippedProjMatrix, 100) caused that tests with size 64x64 were not
rendering fill extrusions: far plane calculated as 96.9 and near plane set to 100 was the cause.
near plane is changed from hardcoded 100 to depend on state.getCameraToCenterDistance() - producing
similar value but one that follows max zoom.

This caused that e.g. combinations/fill-extrusion-translucent--fill-opaque was falsely passing as
only fill-opaque layer got rendered.

combinations/fill-extrusion-translucent--XXXX tests expose regression https://github.com/mapbox/mapbox-gl-native/issues/14844#issuecomment-503600034 in #14844, #14779.

Fix (opaquePassCutoff, is3D) is ported from https://github.com/mapbox/mapbox-gl-js/pull/7821

Fixes: #14844, #14779, #15039
2019-07-09 15:13:38 +02:00
Mikhail Pozdnyakov
929824ecc3 [core] Share render tiles lists between layers
This helps to avoid unneeded allocations.
2019-07-09 12:34:58 +03:00
Alexander Shalamov
8d94bb1be0 [core] Reserve size for filtered render layers 2019-07-09 11:43:46 +03:00
Alexander Shalamov
57402314e1 [core] Improve performance for query rendered features
- query rendered symbols only from layers that support it
- remove unnecessary iterations over vectors
2019-07-09 11:43:46 +03:00
Thiago Marcos P. Santos
3575695033 Revert "[core] Change severity of too many data-driven properties to "Info""
This reverts commit 2125080dc3.
2019-07-08 20:29:43 +03:00
Mikhail Pozdnyakov
da3b7749b0 [core] RenderSource creates render items 2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
8b78398190 [core] Remove down-casting of render sources 2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
1155121530 [core] Introduce ImageSourceRenderData and RenderSource::getImageRenderData()
Image source render data is owned by render source, which is simpler than the
previous approach and aligned with the render tiles ownership model.
2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
e797e31831 [core] ImageManager is not used at tile upload stage 2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
d2e867e3e0 [core] Introduce ImageManager::getSharedImage 2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
63dd17e2bb [core] Introduce TileRenderData
Remove rendering functionality from Tile implementations.
2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
b1cbc2f245 [core] Geometry tile keeps layout result as a shared pointer 2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
d570834975 [core] Remove orchestration methods from RenderTile 2019-07-04 16:56:43 +03:00
Mikhail Pozdnyakov
55da0b0fe7 [core] Remove unused PaintPropertyBinders::constants() 2019-07-02 16:05:09 +03:00
Mikhail Pozdnyakov
0687460033 [core] RenderSource does re-layout if layer's data-driven properties change. 2019-07-02 16:05:09 +03:00
Mikhail Pozdnyakov
affb21a612 [core] Geometry tile updates layer render data if its constants mask remains
Thus, we do not have to wait for tile update completion in case
the updated properties have the same constants mask, i.e. fit
the existing bucket.
2019-07-02 16:05:09 +03:00
Mikhail Pozdnyakov
c144591322 [core] Introduce LayerProperties::constantsMask()
Constants mask for data-driven paint properties is a reliable
criteria of whether the given updated properties can still be used
with the existing bucket (and the gl program instance).
2019-07-02 16:05:09 +03:00
Thiago Marcos P. Santos
848ad0d25e [core] include Hiragana and Katakana glyph ranges to LocalGlyphRasterizer
Fixes #14993
2019-06-28 15:19:58 +03:00
Juha Alanen
0ca8ea6f16 [core] Add number-format expression 2019-06-27 15:51:22 +03:00
Bruno de Oliveira Abinader
78e5a264e0 [core] Fix macOS clang exception error in expression-tests/to-number/2-ary 2019-06-25 20:10:21 +03:00
Bruno de Oliveira Abinader
1a9e07e4ed [core] DefaultFileSource dynamic support for cache-only requests 2019-06-25 20:10:21 +03:00
Mikhail Pozdnyakov
658d68e38c [core] Introduce RenderOrchestrator 2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
4283c9bb34 [core] Introduce RenderTree
Split orchestration from rendering in the `Renderer::Impl` implementation.
2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
c09cbaf6e0 [core] PaintParameters do not need UpdateParameters 2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
cfe11f563d [core] Remove RenderPass::Upload 2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
23d8ae5e73 [core] Simplify RenderLayer::upload()
Now `RenderLayer::upload()` accepts only `uploadPass`, similar to other uploadable objects.

Few simplifications were made in the `LineLayer` prepare stage.
2019-06-25 12:53:52 +03:00
Thiago Marcos P. Santos
2125080dc3 [core] Change severity of too many data-driven properties to "Info"
So it can be filtered by the SDKs using a Log::Observer.
2019-06-15 03:39:45 +03:00
Mikhail Pozdnyakov
2acfa8b86f [core] Keep the same sort index for all feature rings 2019-06-12 20:39:03 +03:00
Konstantin Käfer
ce91218b42 [core] don't call glFlush on every frame 2019-06-12 18:08:18 +02:00
Konstantin Käfer
844299f1c3 [build] remove roundtrip through <experimental/optional> when using optional 2019-06-12 12:04:07 +02:00
Aleksandar Stojiljkovic
d7fa18efa6 [core] Remove unused OffscreenTexture variant with depth render target 2019-06-11 11:39:51 +03:00
Vladimir Agafonkin
6262b83cc6 [core] Switch back to a more compact line attributes layout (#14851)
* [core] switch back to a more compact line attributes layout

* update mapbox-gl-js to point to master
2019-06-10 22:26:16 +03:00
Mikhail Pozdnyakov
6583204e69 [core] TilePyramind uses TransformState::getScale() 2019-06-10 19:36:47 +03:00
Mikhail Pozdnyakov
1edebf0035 [core] TilePyramid::getRenderTiles -> getRenderedTiles 2019-06-10 19:36:47 +03:00
Mikhail Pozdnyakov
737665bc07 [core] Refactor tile pyramid
Tile pyramid is no longer operating with `RenderTiles` and does not perform
rendering operations (upload, finish render).

Render tiles belong to rendering, and tile pyramid belongs to orchestration.
2019-06-10 19:36:47 +03:00
Mikhail Pozdnyakov
ad53132e5d [core] Inherit RenderAnnotationSource from RenderTileSource 2019-06-10 19:36:47 +03:00
Thiago Marcos P. Santos
50e239a937 [core] Renamed to avoid collision with libcurl
Rename curlx_sltosi to mbgl_curlx_sltosi to avoid collision
when liking with libcurl statically.
2019-06-10 15:34:38 +03:00
Aleksandar Stojiljkovic
0bab9127d7 [core] Use unique ID in hillshade and hillshade_prepare draw. 2019-06-06 11:21:37 +03:00