Commit Graph

79 Commits

Author SHA1 Message Date
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
Chris Loer
ce76bde13d [core] Initial implementation of 'format' expression 2018-10-15 13:15:46 -07:00
Chris Loer
d734f670e8 [core] Fix sort order for queryRenderedFeatures when features are filtered.
Fixes issue #12104.
2018-07-03 15:28:00 -07:00
Chris Loer
b9d3ecc990 [core] Introduce LanguageTag for parsing BCP 47 tags 2018-07-03 10:03:05 -07:00
Chris Loer
27b21363e6 [core] Only run placement for first layer per SymbolBucket
Native version of mapbox/mapbox-gl-js#6548.
Port of mapbox/mapbox-gl-js#6550.
Prevents symbols that share the same layout properties from colliding against each other.

Bump GL JS pin to get regression test.
Rename "bucketName" -> "bucketLeaderID" to make it clearer what it represents.
2018-05-03 14:17:25 -07:00
Chris Loer
b3d3ab0e31 [core] Prevent symbols at the same zoom from sharing a crossTileID.
Port of GL JS PR #5994.
Fixes issue #10844, which would allow multiple symbols in a tile to share the same crossTileID as one of their duplicate parent-tile symbols. Once the symbols shared a crossTileID, they would permanently remain "duplicates" of each other, even after increasing zoom level allowed the CrossTileSymbolIndex to distinguish between them.
2018-01-17 12:49:30 -08:00
Ansis Brammanis
feab36a9fb [core] port minor collision changes from -js (#10764) 2018-01-08 12:57:03 -05:00
Chris Loer
56aa7dad4f [macos,ios,android] Unit test fixups
- Add explanatory comment
 - Remove dead/unused Android test
 - Increase image diff threshold to .05 to accommodate slightly different versions of "PingFang" between different test platforms
2017-12-11 10:43:00 -08:00
Chris Loer
b4c781aef7 [core, macos, ios] Unit tests for LocalGlyphRasterizer
Core test uses stubbed "glyph.pbf" without Chinese glyphs
Darwin test relies on locally available "PingFang" font.
Android test relies on locally available "Droid" font. 'expected.png' is NOT correct b/c I haven't figured out how to run unit tests on Android yet.
2017-12-11 10:43:00 -08:00
Chris Loer
1661af1cb4 [core] Enable local glyph generation using TinySDF.
- Platform-specific LocalGlyphRasterizer is responsible for deciding which glyphs to rasterize locally and for implementing the rasterization.
 - Default platform implementation doesn't locally generate any glyphs -> no behavior change
 - Unit test uses StubLocalGlyphRasterizer, which returns a single fixed bitmap for all CJK glyphs
 - Rename glyph_loader.test to glyph_manager.test
2017-12-11 10:43:00 -08:00
Ansis Brammanis
d69c1c4806 [core] Add unit test for CrossTileSymbolIndex 2017-11-17 10:05:15 -08:00
Bruno de Oliveira Abinader
c9e9cd2aff [test] Added GlyphManager.ImmediateFileSource 2017-10-09 13:33:30 +03:00
Lauren Budorick
2de89a99bc Implement icon-anchor property 2017-08-28 13:32:56 -07:00
Chris Loer
fd2b525c4d [core] Correct x-offset introduced by vertical glyph rotation
Fixes issue#9768.
Port of GL JS PR #5100.
2017-08-18 10:53:26 -07:00
Chris Loer
3b26177e9d [test] Fix undefined behavior warning:
quads.test.cpp used a bin with unsupported x/y coordinates.
Issue #9499.
2017-07-14 09:45:06 +02:00
Ansis Brammanis
e514138b69 [core] improve legibility of labels that follow lines
port https://github.com/mapbox/mapbox-gl-js/pull/4781

This improves legibility of labels that follow lines in pitched views.
The previous approach used the limited information in the shader to
calculate put the glyph in approximatelyright place. The new approach
does this more accurately by doing it on the cpu where we have access to
the entire line geometry.
2017-07-11 09:10:24 -07:00
John Firebaugh
0b68731207 [core] Per-bucket icon atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
92252849c1 [core] Per-bucket glyph atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
d766af44c8 [core] Auto-growable SpriteAtlas using shelf-pack 2017-05-26 11:21:56 -07:00
John Firebaugh
1759603e12 [core] Simplify and fix sprite atlas coordinate calculations
* Always return image metrics exclusive of padding
* Work with integer coordinates whenever possible
* Eliminate redundant SpriteAtlasElement members
* Fix asymmetric re-padding in getIconQuad when pixelRatio != 1
* Add explanatory comments
2017-05-23 12:59:27 -07:00
John Firebaugh
72b13cef6a [core] Remove unnecessary optionals in PositionedIcon
Lack of icon is already checked at the call site of shapeIcon; no need to check hasArea() here.
2017-05-23 12:59:27 -07:00
John Firebaugh
cc1ea759a6 [core, node, darwin, android, qt] Make image ID part of Image
More like Source and Layer.
2017-05-16 12:26:35 -07:00