Commit Graph

4089 Commits

Author SHA1 Message Date
Mikhail Pozdnyakov
f660e1be2d [core] Enable variable placement with allowed text overlap 2019-08-13 15:20:46 +03:00
Mikhail Pozdnyakov
ead7132548 [core] Simplifications to variable text placement code path 2019-08-13 15:20:46 +03:00
Alexander Shalamov
1b9d4d792c [core] Render half-width glyphs in upright orientation
This change forces glyphs whose natural orientation in vertical writing
mode is 'sideways' to be rendered in upright orientation (only for non complex
text layouts). This is different compared to W3C / browser behavior that is by
default, renders glyphs in their respective natural orientation.

In the future, there  might need to add a new layout property that would control
glyph orientation separately (e.g., text-glyph-orientation: natural | upright).
2019-08-13 13:32:56 +03:00
Alexander Shalamov
03bb17f8c5 [core] Use constexpr map for verticalized punctiation 2019-08-13 13:32:56 +03:00
Alexander Shalamov
44c92b837a [core] Break lines for vertical writing mode 2019-08-13 13:32:56 +03:00
Alexander Shalamov
be974ea65c [core] Rotate text collision box based on text-rotation value 2019-08-13 13:32:56 +03:00
Alexander Shalamov
9aa529576f [core] Implement support for "text-writing-mode" layout property 2019-08-13 13:32:56 +03:00
Alexander Shalamov
075d458403 [core] Add style bindings for "text-writing-mode" layout property 2019-08-13 13:32:56 +03:00
Aleksandar Stojiljkovic
7cdeed7cb4 Changelog entries and a nit for #15281 2019-08-08 12:14:48 +03:00
Aleksandar Stojiljkovic
8cf5103452 [core] Reuse flyTo constant screen velocity calculation for easeTo implementation.
When using flyTo for easeTo:
Limit zoom out to min(startZoom, targetZoom).
Reduce cinematic zoom in animation at the end of transition,
Linear zoom interpolation.

The patch also sets linear interpolation for flyTo edgeInsets animation, as it looks more appropriate to follow the approach taken for pitch and bearing.

Fixes: #15144
2019-08-08 12:14:48 +03:00
Aleksandar Stojiljkovic
9ed6a84df6 [core] easeTo: linear interpolation over zoom instead of scale
Fixes: 15144
2019-08-08 12:14:48 +03:00
Aleksandar Stojiljkovic
8103a2b028 [core] Enable opaque pass for background layer. fix heatmap+background test.
Follow the approach from mapbox-gl-js for enabling opaque pass for background layer (same as for fill layer).

Fix combinations/heatmap-translucent--background-opaque render test.
2019-08-05 18:56:07 +03:00
Mikhail Pozdnyakov
c763c262c8 [core] Remove ProjectedCollisionBox from CollisionBox
- Minus 20 bytes from CollisionBox size.
- Fix constness at Placement::placeBucket
2019-08-05 16:13:26 +03:00
Mikhail Pozdnyakov
65d2f7ed6a [core] Introduce ProjectedCollisionBox type
ProjectedCollisionBox encapsulates geometry of the projected
collision box, it is using union and thus provides memory save
- 12 bytes per collision box instance.
2019-08-05 16:13:26 +03:00
Mikhail Pozdnyakov
55581b6e61 [core] Remove unused CollisionBox::offset 2019-08-05 16:13:26 +03:00
Mikhail Pozdnyakov
9b34997986 [core] Fix using of uninitialized circle in collision index
In `CollisionIndex::placeLineFeature()` check that previous circle
was initialized before asking its center coordinates.
2019-08-05 16:13:26 +03:00
Alexander Shalamov
d30dc89cf7 [core] Increase round join approximation precision 2019-08-05 13:00:35 +03:00
Alexander Shalamov
5784e326e2 [core] A more accurate algorithm for approximating round line joins
Port for https://github.com/mapbox/mapbox-gl-js/pull/8275
2019-08-05 09:40:15 +03:00
Mikhail Pozdnyakov
187962e425 [core] Fix render tile set source update
Before this change, the `RenderTileSetSource` implementation
ignored update calls for the sources whose description was not yet
loaded and it lead to missing of relayout requests.
2019-08-01 18:20:21 +03:00
Aleksandar Stojiljkovic
73d9f26d03 [core] Limit pitch based on edge insets. Fix max Z calculation in getProjMatrix.
Patch partly fixes #15163 in a way that it doesn't allow loading tens of thousands of tiles and attempt to show area above horizon:

Limit pitch based on edge insets. It is not too bad - current limit of 60 degrees stays active until center of perspective is moved towards the bottom, to 84% of screen height. The plan is to split removal of 60 degrees limit to follow up patch.

Fix max Z calculation in getProjMatrix. TransformState::getProjMatrix calculation of farZ was complex with possibility to lead to negative z values. Replacing it with simpler, precise calculation:
furthestDistance = cameraToCenterDistance / (1 - tanFovAboveCenter * std::tan(getPitch()));

TransformState::getProjMatrix calculation of farZ was an aproximation. Replacing it with simpler, but precise calculation.

Related to: #15163
2019-08-01 09:28:36 +03:00
Alexander Shalamov
3b3e4a4772 [core] Fix int overflow issue in GridIndex 2019-07-30 14:46:18 +03:00
Bruno de Oliveira Abinader
6f0cda8c8b [build] Use mapbox-base optional 2019-07-29 18:36:08 +03:00
Mikhail Pozdnyakov
41e30343f7 [core] Shrink RenderOrchestrator::filteredLayersForSource in reduceMemoryUse()
Before this change, `RenderOrchestrator::filteredLayersForSource` shrank inside
`createRenderTree()`, which potentially might have affected rendering performance.
2019-07-29 12:59:10 +03:00
Mikhail Pozdnyakov
8a6a332264 [core] Fix assertion at RenderRasterLayer::prepare()
It shall consider that image data might not be available until
the source loads it.
2019-07-26 11:23:13 +03:00
Mikhail Pozdnyakov
273ad436fb [core] Avoid copying feature properties 2019-07-25 17:36:35 +03:00
Mikhail Pozdnyakov
e6e1e15f95 [core] Simplfy ToGeometryCollection 2019-07-25 17:36:35 +03:00
Mikhail Pozdnyakov
0051fcdbb8 [core] Optimize Query Rendered Features API
This PR filters out invisible layers before quering features
(rather than after, like it happened before).

With this change `API_queryRenderedFeaturesAll` performance test
passes almost two times faster.
2019-07-25 12:58:27 +03:00
Mikhail Pozdnyakov
2c2e8589c3 [core] GeometryCollection must not be implicitly copied 2019-07-24 21:04:56 +03:00
Mikhail Pozdnyakov
a242bd1070 [core] Optimize RenderLineLayer::queryIntersectsFeature 2019-07-24 21:04:56 +03:00
Mikhail Pozdnyakov
ec6650d3c0 [core] Default GeometryTileFeature::getGeometries() implementation 2019-07-24 21:04:56 +03:00
Alexander Shalamov
852fef66ef [core] Force getGeometries() return const ref 2019-07-24 21:04:56 +03:00
Mikhail Pozdnyakov
cafecd3f6f [core] Introduce VertexVector::extend() and use it in placement code. 2019-07-23 16:55:25 +03:00
Alexander Shalamov
d7dd352209 [core] Remove unused field from icon buffer 2019-07-23 15:43:27 +03:00
Alexander Shalamov
ac74fc6d00 [core] Release quad data after vertex buffers are created 2019-07-23 15:43:27 +03:00
Mikhail Pozdnyakov
e582a329ef [core] SymbolBacket creates collision buffers optionally
sizeof(SymbolBucket) : 1024 -> 704
2019-07-22 12:23:39 +03:00
Mikhail Pozdnyakov
11bfe23981 [core] Symbol bucket uses shared layout
sizeof(SymbolBucket): 2296 -> 1024
2019-07-22 12:23:39 +03:00
Mikhail Pozdnyakov
3184cb29db [core] sizeof(SymbolBucket) 2312 -> 2296 2019-07-22 12:23:39 +03:00
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