Commit Graph

4111 Commits

Author SHA1 Message Date
Konstantin Käfer
c7be3d52a7 Always call onSourceLoaded observers (#15548)
* [core] add sources to source collection before triggering load

* [test] add testcase for #15514

* [core] also call onSourceLoaded observers when no network request was necessary
2019-09-03 17:02:23 -07:00
Mikhail Pozdnyakov
3b5a43c722 [core] Enable text-offset with variable label placement
Port of https://github.com/mapbox/mapbox-gl-js/pull/8642
2019-09-03 11:45:17 +03:00
Aleksandar Stojiljkovic
4ba1270dcc [core] DEMData: do decode on GPU (port mapbox/mapbox-gl-js#8694)
This is first part of work on porting mapbox/mapbox-gl-js#8694 - in follow up patch(es) it is required to remove CPU side copy using 2d canvas support on all supported platforms, similar to approach taken in gl.js  https://github.com/mapbox/mapbox-gl-js/pull/8694/files#diff-34dbe5f7de34dc4b9a8745dcde9bdc37R48

Decoding on CPU removed.
Padding is still done in DEMData() but, instead od doing it wwhile decoding, it is using memcpy to pad original values.

Rebase to latest mapbox-gl-js master and re-generate shaders.

Partly fixes: #15503
2019-08-30 11:18:55 +03:00
zmiao
6ef2710e5c [core] fix collisionBox alignment when Icon/text translation is enabled (#15467)
* add initial fix

* fix bug for collision circle

* refind code structure

* fix indentation

* update test

* refind code structure

* Add changelog

* Add comment for boolean
2019-08-30 08:24:03 +03:00
Łukasz Paczos
e5c219d035 [core] make padding optional when camera position is requested.
When padding is not provided, the current one that's cached in the TransformState is going to be returned.
2019-08-29 14:51:24 +02:00
Ander Conselvan de Oliveira
21632a66f8 [core] Remove programCacheDir parameter from ProgramParameters
Binary shader support has been removed in commit c2f974f2a5 ([core]
Remove binary shader support). This left-over parameter is not used
anywhere anymore.
2019-08-27 16:23:48 +03:00
zmiao
c770c23262 [core] fix mixed sdf + non-sdf icon rendering in one layer (#15456)
* [core] fix icon symbol rendring when sdf and non-sdf icon in the same symbol layer

* fix build error

* fix typo

* revert renderableSegment change

* simplify codes

* fix build error

* refine sdf icon flag

* [core] fix mixed sdf + non-sdf icon rendering in one layer

* remove iconstatus getter in stymbol bucket

* fix review findings

* provide bitwise operator for SymbolContent enum

* use MBGL_MBGL_CONSTEXPR

* add one missing update for sdfIcon

* make renderer symbol type as enum
2019-08-26 21:54:59 +03:00
Aleksandar Stojiljkovic
9eff849c74 [core] Fix tileCover / TileCoordinate fromScreenCoordinate(#15442)
Remove unecessary tile coordinate unproject -> project  step.
Unproject+project isn't always a noop and this was the issue leading to wrong cover calculation in high pitch values.

Fixes: https://github.com/mapbox/mapbox-gl-native/issues/15442
2019-08-23 16:43:05 +03:00
Mikhail Pozdnyakov
ef3d04dee5 [core] Export symbol placement update status from MapObserver 2019-08-23 10:56:05 +03:00
Mikhail Pozdnyakov
68de60c8d0 [core] Fill layer pattern change must cause re-layout
Otherwise, pattern properties update is not taken in action.
This caused the following render tests failure:
`build/mbgl-render-test runtime-styling/layer-add-fill regressions/mapbox-gl-js#3107 --recycle-map`
2019-08-22 14:27:27 +03:00
Mikhail Pozdnyakov
a1da06cb68 [core] Fix GeoJSON tiles update
Before this change, GeoJSON tiles data were updated before the
corresponding layers were applied, therefore `GeometryTileWorker`
parsed new data with the outdated layers.

It caused the following render test failure:

`mbgl-render-test text-max-width/unlimited regressions/mapbox-gl-native#9976 --recycle-map`

Now a GeoJSON tile, which needs relayout, is not parsed until the valid layers
are set.
2019-08-22 10:55:56 +03:00
Asheem Mamoowala
0e3a7416e5 [core] Don't overwrite locally renderable glyphs with remote glyphs 2019-08-21 12:00:26 +03:00
Ansis Brammanis
888d2b06ec speed up fading when zooming even more
And a linear adjustment seems to make more sense.
2019-08-20 13:34:22 +03:00
Ansis Brammanis
7d9b54a573 [core] make symbols fade out faster while zooming out
Zooming outcan make symbols overlap quickly. The area previously covered
by the viewport is covered by a lot of colliding labels while the
surrounding area has no labels. This difference produces an unwanted
effect.

This reduces that effect by:
- reducing the fade duration while zooming out
- doing placement more frequently while zooming out
2019-08-20 13:34:22 +03:00
Alexander Shalamov
9ba700fd47 [core] Fix combination of icon-text-fit with text-variable-anchors and text-writing-mode 2019-08-20 12:31:02 +03:00
Konstantin Käfer
71a334152a [core] also remove version info in ImageManager when removing an image (#15397) 2019-08-19 13:54:30 -07:00
Thiago Marcos P. Santos
6dfe0e60ca [core] Fix use after std::move detected by clang-tidy
Detected by the bot being setup at
https://github.com/mapbox/mapbox-gl-native/pull/15385.
2019-08-19 13:37:23 +03:00
Mikhail Pozdnyakov
c7169e6f8d [core] Fix layer impl cast in render layer implementations
This PR puts `impl()` functions definitions into a nameless namespace
to provide internal linkage and to make sure that appropriate cast function
is invoked.
2019-08-16 18:33:30 +03:00
zmiao
0f34eb7b25 Indroduce clusterProperty option for aggregation (#15287)
* indroduce clusterProperty option for aggregation

* remove unnecessary codes

* update geojson_option conversion

* fix reviewing findings
2019-08-16 15:03:48 +03:00
Alexander Shalamov
5f477e310b [core] Check type of a convertible value when constructing legacy filter 2019-08-16 00:19:30 +03:00
Alexander Shalamov
148d65bced [core][node] Serialize formatted expression's text-color option
This enables proper round-tripping for serialized format expression.
2019-08-15 18:25:10 +03:00
Alexander Shalamov
cd129612c1 [core] Clear collision text boxes between symbol placement iterations 2019-08-14 13:54:53 +03:00
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