Commit Graph

4218 Commits

Author SHA1 Message Date
Mikhail Pozdnyakov
684000fc26 [core] Merge style::Layer::set{Layout,Paint}Property 2019-12-03 14:20:17 +02:00
Alexander Shalamov
84ec379477 [core] Turn off clang format for generated shaded code 2019-12-02 17:11:49 +02:00
Alexander Shalamov
72e9388a61 [core] Add unit tests for Formatted class 2019-12-02 17:11:49 +02:00
Alexander Shalamov
614000256b [core] Shape images in labels at bucket zoom level 2019-12-02 17:11:49 +02:00
Alexander Shalamov
33ba4052b6 [core] Use linear filtering for icons in text for zoom dependent text-size 2019-12-02 17:11:49 +02:00
Alexander Shalamov
26bf566f53 [core] Use new 'SymbolTextAndIcon' program to draw icons in text 2019-12-02 17:11:49 +02:00
Alexander Shalamov
2c49c4374c [core] Store 'sdf' flag in vertex attribute 2019-12-02 17:11:49 +02:00
Alexander Shalamov
2bb2a40b6d [core] Shape images in labels and create image quads 2019-12-02 17:11:49 +02:00
Alexander Shalamov
f4f652063d [core] Calculate line width and line breaks for images 2019-12-02 17:11:49 +02:00
Alexander Shalamov
34a9bc08ce [core] Pass images and evaluated layout text size to shaping 2019-12-02 17:11:49 +02:00
Alexander Shalamov
a9c3b5a389 [core] Add evaluated images to styled text sections 2019-12-02 17:11:49 +02:00
Alexander Shalamov
a01ecc92a0 [core] Add image sections to format expression 2019-12-02 17:11:49 +02:00
Mikhail Pozdnyakov
7bacf5696c [core] Introduce Pass<> class and use it for Scheduler
Thus we enforce client to retain the returned `Scheduler` objects.
2019-12-02 14:12:18 +02:00
Alexander Shalamov
00d133239e [core] Blacklist VAO extension for Adreno (TM) 4xx GPUs
Blacklist in order to avoid crashes in a driver.
2019-12-02 11:03:16 +02:00
Mikhail Pozdnyakov
3947d5fa98 [core] Retain thread pool in GeoJSONSource
Otherwise, the construction of the `Immutable<Source::Impl>` in background thread might never yeld.
2019-11-29 15:37:49 +02:00
Mikhail Pozdnyakov
597757df6a [core] GeoJSONVTData uses Scheduler::GetSequenced() 2019-11-29 11:12:55 +02:00
Mikhail Pozdnyakov
06c80cae3c [core] Introduce GeometryTile::reset()
The newly introduced `GeometryTile::reset()` is
used while GeoJSON tile update in order to prevent from the
parsing of the new data with the stale layers or vice verse.
2019-11-29 11:12:55 +02:00
Mikhail Pozdnyakov
6419cd0ab2 [core] Calculate GeoJSON tile geometries in a background thread
Call `mapbox::geojsonvt::GeoJSONVT::getTile()` in a background
thread, so that the rendering thread is not blocked.
2019-11-29 11:12:55 +02:00
Mikhail Pozdnyakov
ab5572b0bc [core] Fix supercluster lambdas capturing 2019-11-29 09:53:28 +02:00
Mikhail Pozdnyakov
cd4136ed4b [core][android][darwin] Fix GeoJSONOptions handling
- share the `GeoJSONOptions` instances using `Immutable<GeoJSONOptions>` - avoid extra copying
- fix wrapping of the `GeoJSONOptions` instances in supercluster map/reduce lambdas.
  Previously, local variables were wrapped by reference.
2019-11-29 09:53:28 +02:00
Mikhail Pozdnyakov
b5794730b5 [core] Introduce Scheduler::GetSequenced() API
The newly introduced `Scheduler::GetSequenced()` returns
sequenced schedulers from the cache limited to 10 instances,
preventing from spawning too many threads.
2019-11-28 14:34:52 +02:00
Mikhail Pozdnyakov
b6fbd1221e [core] Clear tiles when GeoJSON data changes
In tile and static mode clear tiles when data changes
in order to avoid render tests being flaky.
2019-11-26 16:35:17 +02:00
Konstantin Käfer
3600dd8a1a [core] fix rendering of dashed lines with round caps
In https://github.com/mapbox/mapbox-gl-native/pull/15862, we introduced individual textures for line dash patterns to eliminate atlas overflows. Unfortunately, this broke dashed lines that had round caps (dashed lines with straight caps still rendered correctly). Line pattern textures for round caps were now using 256×15 pixel textures.

The OpenGL ES 2.0 spec, section 3.8.2 states:

    Calling a sampler from a fragment shader will return `(R,G,B,A) = (0,0,0,1)` if any of the following conditions are true:
    […]
    - A two-dimensional sampler is called, the corresponding texture image is a non-power-of-two image […], and either the texture wrap mode is not `CLAMP_TO_EDGE`, or the minification filter is neither `NEAREST` nor `LINEAR`.
    […]

This means that texture lookups won't work for NPOT textures unless they use `GL_CLAMP_TO_EDGE`. We're using `GL_CLAMP_TO_EDGE` for the vertical direction, but GL_REPEAT for the horizontal direction, which means that we need a power-of-two texture for our line dash patterns to work on OpenGL ES 2.0 conforming implementations. Fortunately, this just means changing the height from 15 to 16, and from 30 to 32, so we don't waste many pixels.
2019-11-22 16:36:17 +01:00
Roman Kuznetsov
0ea086ecf8 [core] Remove default move operator for RenderTile 2019-11-19 16:06:18 +02:00
Sergey Yershov
37b332899b [core] Fix incorrect resizing of TileCache 2019-11-19 15:03:28 +02:00
Mikhail Pozdnyakov
986465e015 [core] Introduce style::CollectionWithPersistentOrder
So that we do not unnecessarily remove and re-add
sources and images if their order has been modified
in the updated style.
2019-11-19 14:39:52 +02:00
Ander Conselvan de Oliveira
4c1d03c257 [core] Fix MapSnapshotter build failure on Windows
MSVC implementation of std::promise is buggy and only works with types
that can be default-constructed. To avoid a compilation failure in the
instantiation of ask() inside MapSnapshotter::getRegion(), which creates
a std::promise<LanLngBounds>, make LatLngBounds' default constructor
public.
2019-11-13 13:31:01 +02:00
Mikhail Pozdnyakov
49bcf69a3b [core] Avoid GeoJSON source flickering on style transitions
Before this change, all GeoJSON source cleared tile pyramid
at the style transition and it caused flickering.

Now, in Continuous mode, we keep the existing tiles until the
new GeoJSON data is not yet available, thus providing smart
style transitions without flickering.

In other modes (Static, Tile) clear the tile pyramid in order
to avoid render tests being flaky.
2019-11-12 15:12:31 +02:00
Alexander Shalamov
c6f3cc8b60 [core] Implement image expression (#15877)
* [core] Bump gl-js version
* [core] Implement image expression
* [core] Use new image expression
* [core] Coerce image expression to / from string
* [core] Serialize evaluated image
* [core] Pass available images to layout
* [core] Pass images to evaluation context
* [core] Set available flag value based on image availability
* [core] Allow image coercion to boolean to indicate image availability
* [core] Coalesce image expression
* [core] Add image expression to next build system
* [core] Align serialization format and evaluated type with gl-js
* [core] Add images to expression evaluation method
* [core] Add support for Image expression to expression test runner
* [core] Unskip image expression tests
* [core] Update unit tests
* [core] Use image expression in annotation manager
* [core] Add string to ImageExpression conversion
* [core] Add image expression to expression dsl
* [core] Convert tokens for implicitly created Image literal
* [core] Fix clang format
* [core] Split generated style code lines that are over 120 characters
* [core] Add unit test for image expression equality
* [core] Add image property expression evaluation unit test
* [core] Unskip image expression render test
* [core] Skip 'in' expression tests
* [core] Ignore fill-pattern/update-feature-state render test
* [core] Rename Image::serialize to Image::toValue
2019-11-11 18:20:01 +02:00
zmiao
2e8a350d68 [core] Add batch conversion of latLngs to/from screenCoords (#15891)
* [core] Add batch conversion of latLng vs screenCoord

* [core] Take the simple approach
2019-11-07 18:16:31 +02:00
Mikhail Pozdnyakov
e6e6bcf55c [core] Parse GeoJSONSource description in background
Unblocks the UI thread on heavy GeoJSON tiles parsing operation
2019-11-05 11:45:38 +02:00
Mikhail Pozdnyakov
31421f8448 [core] Add Scheduler::scheduleAndReplyValue() API 2019-11-05 11:45:38 +02:00
Mikhail Pozdnyakov
4afb4438eb [android] Convert GeoJSON features to tiles in background
Composing tiles from the GeoJSON features is an expensive
operation that might block UI thread on updating the `GeoJsonSource`
with the new data.

This change moves tile composing to the background thread and thus
unblocks the UI thread.
2019-10-31 10:24:55 +02:00
Mikhail Pozdnyakov
8c498cd36c [core] Introduce and apply GeoJSONData::create() API 2019-10-31 10:24:55 +02:00
Mikko Pulkki
fb062bb23e [render-test] Add resource usage tracking to gfx context 2019-10-30 14:32:27 +02:00
Konstantin Käfer
84f2ff1084 [core] use individual textures for line dash patterns
This moves the LineAtlas from a shared texture that contained SDF dash patterns to use individual textures.

Previously, the texture space was limited to a texture of 512 pixels height. Dash patterns were never removed (and are still never removed as of this patch), which means that this texture could fill up for styles that use a lot of different dash patterns. In particular, dash patterns for lines with a round line cap take up 15 pixels of texture height, limiting the amount of unique dash patterns to 34. While this was probably enough for rendering a single style, we quickly exhausted this number when reusing the Map object to render different styles.

Instead of a global shared texture, we're now creating individual textures for every dash pattern. These textures are still cached so that we don't need to re-upload the texture on every frame.
2019-10-29 11:27:24 +01:00
Mikhail Pozdnyakov
bdbb136612 [ios][android][core] Added change log entries and more code comments 2019-10-28 13:02:32 +02:00
Mikhail Pozdnyakov
2f00ba7294 [core] Do not make pending requests for already requested images.
so that processing for the corresponding tile does not suspend and
the rendering performance is not affected.
2019-10-28 13:02:32 +02:00
Mikhail Pozdnyakov
aa36dc87fb Revert "[core] Revert coalescing requests to the client for the same missing image"
This reverts commit 22132683797b5ea5cbe8622f77c01b399ad9c71e.
2019-10-28 13:02:32 +02:00
Mikhail Pozdnyakov
646d4e3996 [core] Fixed formatting 2019-10-24 15:43:13 +03:00
Mikhail Pozdnyakov
424cf20207 [core] Revert coalescing requests to the client for the same missing image 2019-10-24 15:43:13 +03:00
Ansis Brammanis
4fb75ba32c [core] avoid edges for labels that use text-variable-anchors
to prevent clipped labels in rendered image tiles.
2019-10-24 15:39:10 +03:00
Ansis Brammanis
99feb9bb30 [core] fix collisions with icon-text-fit and variable placement (#15828)
port 61a61a1982cb8c637d467f91da5b0817a61a9de6
2019-10-22 20:30:55 -04:00
Mikko Pulkki
0ca96fd8a4 [render-test] Implement fps benchmarking tests (#15803) 2019-10-22 12:13:55 +03:00
Mikhail Pozdnyakov
057048b293 [core] Fix image requests for already obtained images
Before this change, repeated request for an already
obtained image was erroneously treated as pending.
2019-10-17 16:29:02 +03:00
Konstantin Käfer
2187980a87 [core] fix icon-text-fit
This fixes rendering by account for the 1px texture padding around icons that were stretched with icon-text-fit. We've added the 1px padding before, but didn't scale it accordingly when we are resizing the icon when it is stretched to fit the text. Adjusts the code to match the logic in GL JS.
2019-10-14 18:46:12 +02:00
Konstantin Käfer
9cac122c5c [core] map image type to string until we have a dedicated implementation 2019-10-14 18:46:12 +02:00
Jordan Kiley
e4e2a78033 Add iOS bindings for cluster properties (#15515) 2019-10-11 13:46:41 -07:00
Mikhail Pozdnyakov
2f973e9646 [core] Introduce Scheduler::bindOnce() and use it in ImageManager 2019-10-10 15:39:34 +03:00
Mikhail Pozdnyakov
71047ab853 [core] Disallow coalesced requests for patterns
Unlike icons, pattern changes are not caught with
style-diff meaning that the existing request could
be from the previous style and we cannot coalesce
requests for them.
2019-10-10 15:39:34 +03:00