Commit Graph

318 Commits

Author SHA1 Message Date
Mikhail Pozdnyakov
8af78ddbb9 [core] Update MapObserver::onDidFinishRenderingFrame() API 2019-09-12 00:40:08 +03:00
Alexander Shalamov
5d316a8076 [core][qt] Check if QFont supports glyph and adjust backing image width
- Don't rasterize glyphs if font does not support requested code point
- Render symbols at hardcoded baseline, so that locally rasterized glyphs
  align better with server side generated fonts.
- Resize backing QImage width to be at least 24px
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
Mikhail Pozdnyakov
ef3d04dee5 [core] Export symbol placement update status from MapObserver 2019-08-23 10:56:05 +03:00
Juha Alanen
0ca8ea6f16 [core] Add number-format expression 2019-06-27 15:51:22 +03:00
Łukasz Paczos
7d6255c860 [core] option to perform platform specific operations when creating/destroying core threads 2019-05-22 15:52:55 +02: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
8f331f5ae3 [core] refactor ThreadLocal backend 2019-04-08 14:41:16 +02:00
Konstantin Käfer
5cc3d7a733 [core] move GLContextMode to RendererBackend 2019-04-05 11:49:17 +02:00
Konstantin Käfer
66c020034e [core] refactor RendererBackend 2019-04-05 11:49:17 +02:00
Konstantin Käfer
a782a6d15b [core] move BackendScope to gfx namespace 2019-04-05 11:49:17 +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
Sudarsana Babu Nagineni
11afef7825 [core] Add interface to change the orientation through MapOptions 2019-03-28 16:41:15 +02:00
Bruno de Oliveira Abinader
ac6855a473 [core] Fix signature of fluent interface setters 2019-03-23 09:12:44 +02:00
Bruno de Oliveira Abinader
d5868d3da8 [core] Remove file source from public Map ctor 2019-03-20 21:30:08 +02:00
Ander Conselvan de Oliveira
5733440747 [core] Group Map LatLngBounds, min and max zoom methods
Group bounds, minimum and maximum zoom related methods together using
the new BoundOptions.

v2: Document that getBounds() initializes all optional fields.
  - Add test for getBounds() on a map with default values.
2019-03-14 18:33:11 +02:00
Bruno de Oliveira Abinader
8cc100bfd5 [core] Get FileSource via UpdateParameters in Renderer::Impl 2019-03-13 17:56:44 +02:00
Ander Conselvan de Oliveira
7d19115720 [core] Don't use exceptions in MapObserver::onDidFailLoadingMap
Using different exception pointers to specify the loading failure makes
an awkward API. Most users rethrow the exception only to figure out what
type of error happened so it can be reported properly. So replace the
exception pointer with a enum an string description of the failure.
2019-03-13 11:58:27 +02:00
Thiago Marcos P. Santos
7cdc39bee9 [Qt] Fix race when locking a FileSource
We were returning the FileSource, it could have expired
already. We _need_ to check if the lock() on the weak
pointer worked before returning.
2019-03-08 20:56:45 +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
Thiago Marcos P. Santos
7b7ad9d39b [qt] Also use the base API URL as key for sharing the cache.
Otherwise we will have a URL pointing to different servers and
potentially different data.
2019-03-04 19:33:45 +02:00
Bruno de Oliveira Abinader
586b22c0df [core] Remove map coordinate setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
ba7427b4ac [core] Transform{State}: s/angle/bearing/ 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
73ac3c784f [core] Remove map bearing setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
21a39306da [core] Remove map pitch setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
f5f10ec119 [core] Remove map zoom setters/getters 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
491fce6879 [core] Added Map::pitchBy() 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
02f2b9c75c [core] Added Map::scaleBy() 2019-03-04 14:45:32 +02:00
Bruno de Oliveira Abinader
362231e2d0 [qt] Cleanup QMapboxGL::coordinateZoomForBounds() 2019-03-04 14:45:32 +02:00
Thiago Marcos P. Santos
edc6a5dd8b [qt] Share the same file source only if using the same access token
If access tokens are different, we cannot share the file source,
because it will override the previously set access token.
2019-02-27 13:31:21 +02:00
xylosper
0c66ce9a95 [qt] fix missing alpha channel for QColor
`QColor::name()` produces `#rrggbb` format where alpha is missing.
Use `rgba(...)` string instead when convert `QColor` to mapbox style.

Note: `QColor::name(QColor::HexArgb)` produces `#aarrggbb` format string,
but mapbox does not support this format apparently.
2019-02-20 16:16:34 +02:00
Thiago Marcos P. Santos
470b01847d [android,linux,darwin,qt] Load OpenGL for the platform
These loaders will provide pointers to the platform implementation
of OpenGL. On Android, Linux and Darwin, we simply link with the
OpenGL implementation that is expected to exist on the platform.

Qt has its own GL loader, so we just connect the dots.
2019-02-12 19:42:08 +02:00
xylosper
26af7265c3 [qt] add global projection functions
There are 3 methods in QMapboxGL which can be static method.

QMapboxGL::metersPerPixelAtLatitude
QMapboxGL::projectedMetersForCoordinate
QMapboxGL::coordinateForProjectedMeters

Add these functions into QMapbox namespace as global functions.
The methods in QMapboxGL are kept for backward compatibility.
2019-02-12 11:08:26 +02:00
xylosper
6b2f17191b [qt] Support feature collection for GeoJSON source data
This commit adds support of `QVector<QMapbox::Feature>`
and `QList<QMapbox::Feature>` for data in GeoJSON source.
2019-02-01 16:34:35 +02:00
Thiago Marcos P. Santos
2a535a8f5e [qt] Use QVector instead of QList
For our use case `QVector` is more efficient and will
do less memory allocations.

Fixes: #13830
2019-01-30 16:22:13 +02:00
Bruno de Oliveira Abinader
963dd5e567 [Qt] Support local font family in QMapboxGLSettings 2019-01-04 17:27:41 -04:00
Bruno de Oliveira Abinader
513b50eee8 [Qt] Implement LocalGlyphRasterizer 2019-01-04 17:27:41 -04:00
Konstantin Käfer
1d8235f5b8 [build] rework platform/default directory and add -files.txt for vendored libs 2018-12-14 11:03:03 +01:00
Huyen Chau Nguyen
9a606caf0b [core] define number of concurrent downloads in online file source variable 2018-11-15 12:19:48 -08:00
Thiago Marcos P. Santos
253ba55f1f [qt] Fix crash on Qt filesource
When opening many maps and sharing the same filesource:

- Say we open around 30 maps and they all have the same style.
- They will all request the same sprite.json, but Qt filesource will
  restrict simultaneous request to 20.
- Mapbox GL will send some sprite.json to the filesource and queue
  some internally along with other requests.
- When the first sprite.json arrives and the Qt filesource calls the
  callback, Mapbox GL will synchronously push queued requests to the
  Qt filesource when a request is handled.
- We are walking a QVector dispatching sprite.json requests, but more
  requests get added to this QVector while we are walking it using an
  iterator.
- That corrupts the iterator and we get a crash.

The fix is simple, just pop items from the QVector until it is empty
instead of using iterators.
2018-11-13 23:26:34 +02:00
Thiago Marcos P. Santos
cd92a231b3 [qt] Deprecate Qt4 and old versions of Qt5
Not enough adoption to keep the platform alive.
2018-11-13 22:55:26 +02:00
Mikhail Pozdnyakov
7a9461a8d4 Consolidate style::Layer properties API
The `style::Layer` class now exposes all the properties contained at `style::LayerImpl`.
This allowed to drop `style::Layer::accept()` method usage, avoid the repeated generated code
and thus save some binary size.

This patch is a part of the layers modularization effort.
2018-10-25 22:42:43 +03:00
Konstantin Käfer
282c71e8e9 [core] unify UTF-8/16 conversion to <boost/locale/encoding_utf.hpp> 2018-10-23 12:23:40 +02:00
Bruno de Oliveira Abinader
98c36fc06e [core] CameraOptions receives and outputs angle and pitch as degrees, not radians 2018-10-19 12:05:16 +02:00
Chris Loer
bc71825774 [core] Bidi support for styled text.
Remove use of QString from non-ICU Qt stub bidi implementation since we weren't making use of it.
2018-10-15 13:15:46 -07:00
Bruno de Oliveira Abinader
6c4cb063c2 [Qt] UpdateParameters should always be available when rendering 2018-10-01 23:51:33 +03:00
Konstantin Käfer
071129bf61 [linux,qt] Remove remainder of WebP support 2018-09-13 13:27:44 +02:00
Asheem Mamoowala
bc806d4354 Use QSqlError::databaseText for reporting errors from SQLite wrapper to match SQLite3 error messages 2018-08-28 07:14:54 -07:00
Konstantin Käfer
112bbc7ab2 [core] make style/conversion.hpp implementation private 2018-08-19 13:09:16 +02:00