Commit Graph

100 Commits

Author SHA1 Message Date
Ansis Brammanis
4f18d5fa92 [core] sort symbols using symbol-sort-key before placement (#16023)
fix #15964
partially port mapbox/mapbox-gl-js#9054
2020-02-11 11:24:14 -05:00
Mikhail Pozdnyakov
a2edfc79f0 Add CrossTileSymbolLayerIndex.offscreenSymbols test 2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
a9d04d7b1a [core] Do not index and place the off-screen symbols for overscaled tiles
For overscaled tiles the viewport might be showing only a small part of the
tile, so we filter out the off-screen symbols to improve the performance.
2020-01-22 14:30:26 +02:00
Mikhail Pozdnyakov
e6ddcf9beb [core] Simplify CrossTileSymbolIndex::addLayer() 2020-01-22 14:30:26 +02:00
Konstantin Käfer
5a1e4c6b81 [core] implement stretchable icons for icon-text-fit 2020-01-15 15:02:11 +02:00
Konstantin Käfer
027e803b72 [core] move icon rotation from shaping to quad generation to mirror JS 2020-01-15 15:02:11 +02:00
Konstantin Käfer
1342cb44b3 [core] Remove unused WritingMode from getIconQuads 2020-01-15 15:02:11 +02:00
Konstantin Käfer
4b171cccf1 [core] getGlyphQuad -> getGlyphQuads 2020-01-15 15:02:11 +02:00
Alexander Shalamov
89665326c2 [core] Add unit test for calculateTileDistances 2019-12-09 17:26:13 +02:00
Alexander Shalamov
d36958997b [core] Add unit test for getAnchors and remove unused field 2019-12-09 17:26:13 +02:00
Alexander Shalamov
60b61a08f4 [core] Add unit test for tagged string's image sections 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
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
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
Mikko Pulkki
a7a7e8cbe2 [render-test] Implement gfx probe for tracking gpu resources 2019-10-30 14:32:27 +02:00
Mikko Pulkki
0ca96fd8a4 [render-test] Implement fps benchmarking tests (#15803) 2019-10-22 12:13:55 +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
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
Alexander Shalamov
9e3cb67d1c [core][qt] Update unit tests and include Korean symbols
- Decrease pixelmatch tolerance for local glyph rasterizer
- Add Korean symbols to test fixture
- Fix ifdefs, as the QT and Apple related blocks were using same results
- Add NotoSansCJK test for QT / Linux platform
2019-08-28 12:08:54 +03: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
Asheem Mamoowala
aebcaf685f Add unit test and fixture 2019-08-21 12:00:26 +03:00
Asheem Mamoowala
0c017c3e49 Correclty implement canRasterizeGlyph in unit test stub 2019-08-21 12:00:26 +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
Alexander Shalamov
f0f1d7130f [core] Update shaping unit test 2019-08-13 13:32:56 +03:00
Alexander Shalamov
e9ca844d66 [core] Update unit tests 2019-08-13 13:32:56 +03:00
Alexander Shalamov
b4056ad88f [core] Update CrossTileSymbolLayerIndex unit test 2019-07-23 15:43:27 +03:00
Mikhail Pozdnyakov
11bfe23981 [core] Symbol bucket uses shared layout
sizeof(SymbolBucket): 2296 -> 1024
2019-07-22 12:23:39 +03:00
Aleksandar Stojiljkovic
9809c9f8f5 [core] Offset viewport center when edge insets are specified
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
2019-05-28 14:38:01 +03:00
Alexander Shalamov
749044f1b0 [core] Add unit test for zero width space line breaking 2019-05-24 05:59:07 -07:00
Aleksandar Stojiljkovic
3cd8c6c1fd [core] Refactor HeadlessFrontend/Backend: GL separation and factory (#14692)
Refactor out HeadlessFrontend and HeadlessBackend gl independent code to gfx.
Define gl::HeadlessBackend as subclass, instantiated by gfx::HeadlessBackend static factory method.
GL dependent tests are still using gl::HeadlessBackend directly (not through gfx).
2019-05-21 07:37:49 +03:00
Mikhail Pozdnyakov
953ee5e81b [core] Create glyph manager at renderer construction time
Avoid unnecessary glyph manager presence check in `Renderer::Impl::()`.
2019-05-14 11:29:24 +03:00
Thiago Marcos P. Santos
06f1dc48a2 [core] Make the BackgroundScheduler a singleton
- Do not carry it over everywhere as parameter, it is a shared
  instance anyway and the lifecycle is pretty much the app lifecycle
  from the moment we instantiate a map.
- Rename to BackgroundScheduler because it is a Scheduler that will
  do tasks in the background, we don't make assumptions if it is a
  thread pool or a single thread.
- Most importantly, remove the dependency from `core` on `platform`.
2019-05-10 14:20:38 +03:00
Konstantin Käfer
3ceabcd3ec [core] clang-tidy fixes 2019-04-05 11:49:17 +02:00
Konstantin Käfer
5cc3d7a733 [core] move GLContextMode to RendererBackend 2019-04-05 11:49:17 +02:00
Mikhail Pozdnyakov
b39c71eea8 [core] Introduce variable text placement for point labels - Layout part 2019-03-29 16:18:41 +02:00
Sudarsana Babu Nagineni
7af00a404f [core] Include pixelRatio property in MapOptions
Move pixelRatio property from Map constructor to MapOptions.
2019-03-28 16:41:15 +02:00
Sudarsana Babu Nagineni
1cc1d4ea08 [core] Add setter/getter for size property in MapOptions 2019-03-28 16:41:15 +02:00
Bruno de Oliveira Abinader
d5868d3da8 [core] Remove file source from public Map ctor 2019-03-20 21:30:08 +02:00
Bruno de Oliveira Abinader
8cc100bfd5 [core] Get FileSource via UpdateParameters in Renderer::Impl 2019-03-13 17:56:44 +02:00
Alexander Shalamov
8be135231d [core] Add possibility of overriding paint properties inside format expression #14062
* [core] Add format override expression and formatted section to evaluation context

* [core] Add textColor to TaggedString's formatted section

* [core] Add FormatSectionOverrides and introduce overridable properties

* [core] Populate symbol layer paint properties for text sections

* [core] Add benchmark for style that uses text-color override

* [core] Add unit test for FormatOverrideExpression

* [core] Add unit test for FormatSectionOverrides
2019-03-13 17:14:53 +02:00
Sudarsana Babu Nagineni
5e2b6bf636 [core] Add MapOptions to define properties of Map
To simplify the Map constructor, introduce MapOptions
interface to define the properties that can be set on
a Map.
2019-03-08 18:20:55 +02:00
Bruno de Oliveira Abinader
513b50eee8 [Qt] Implement LocalGlyphRasterizer 2019-01-04 17:27:41 -04:00
Ryan Hamley
0c6b1629ef [Core] Ensure queryRenderedFeatures accounts for icon-rotate (#13105) 2018-10-18 12:14:52 -07:00
Chris Loer
fc11d2e872 [core, test] Add BiDi unit test
- Port of arabic.test.js from mapbox-gl-rtl-text
- Modify BiDi::getLine to remove trailing nulls in the event UBIDI_REMOVE_BIDI_CONTROLS causes the string to shorten.
- Patch vendored ICU to avoid undefined undefined bit shifting behavior (triggered sanitizer failure)
2018-10-15 13:15:46 -07:00
Chris Loer
6cbf150a33 [test] Add unit test for TaggedString::trim() 2018-10-15 13:15:46 -07:00