Commit Graph

48 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
c4cb026fa4 [core] Fix readability-redundant-member-init errors in header files
As reported by clang-tidy-8.
2020-04-17 13:36:50 +03:00
Thiago Marcos P. Santos
dffe00feea [core] Fix readability-avoid-const-params-in-decls errors in header files
As reported by clang-tidy-8.
2020-04-17 13:36:50 +03:00
Thiago Marcos P. Santos
94d1c10727 [core] Fix readability-* errors
As reported by clang-tidy-8.
2020-03-30 23:37:44 +03:00
Thiago Marcos P. Santos
d15b9c1f9c [core] Fix performance-unnecessary-value-param errors
As reported by clang-tidy-8.
2020-03-23 12:09:09 +02:00
Thiago Marcos P. Santos
991cfee7df [core] Fix performance-noexcept-move-constructor errors
As reported by clang-tidy-8.
2020-03-23 12:09:09 +02:00
Alexander Shalamov
202b5a8ecc [core] Calculate size of an ambient cache without offline resources 2020-03-07 10:14:18 +02:00
Alexander Shalamov
deca818614 [core] Simplify MapSnapshotter constructor and add observer interface 2020-03-05 17:43:37 +02:00
Alexander Shalamov
174f40dee3 [core] Add Snapshotter::cancel method 2020-03-05 17:43:37 +02:00
Alexander Shalamov
1577a6b537 [core] Expose Style from Snapshotter 2020-03-05 17:43:37 +02:00
Alexander Shalamov
29eff4028d [core] Remove Actor from public Snapshotter API 2020-03-05 17:43:37 +02:00
Alexander Shalamov
09e69654fa [core] Refactor Snapshotter
Move renderer to a separate thread while keeping map on a client thread.
2020-03-05 17:43:37 +02:00
Mikhail Pozdnyakov
3c05bd984a [core] Fix offline region download freezing
Downloaded resources are put in the buffer and inserted in the database in batches.

Before this change, the buffer was flushed only at the network response callback
and thus it never got flushed if the last required resources were present locally
and did not initiate network requests -> it caused freezing.

Now the buffer is flushed every time the remaining resources container gets empty.
2020-02-25 23:15:47 +02:00
Mikhail Pozdnyakov
c04551a4e3 Expose READ_ONLY_MODE_KEY property for DatabaseFileSource 2020-02-07 14:39:03 +02:00
Alexander Shalamov
534003495b [core] Switch unordered_map to map
Change container types where number of elements expected
to be rather small. For instance, number of offline packs
or sql statements.
2020-02-06 23:54:19 +02:00
Alexander Shalamov
879c44f661 [core] Modularize FileSource codebase (#15768)
* [core] Introduce FileSourceManager and use it for default platform impl

  - Add `FileSourceManager` interface that provides access to `FileSource`
    instances and means of registering / unregistering `FileSource` factories
  - Split `DefaultFileSource` into smaller parts
  - Add `DatabaseFileSource` interface and it's default implementation
  - Remove inter-dependencies between concrete `FileSource` classes

* [build] Add files to next build system

* [core] Add generic property setters / getters

* [core] Remove setOnlineStatus from OnlineFileSource interface

* [core] Hide threading implementation details from DatabaseFileSource interface

* [core] Make DB file source methods virtual

* [core] Add documentation for DatabaseFileSource and rename one method

* [core] Use simple callback instead of ActorRef

* [core] Remove ActorRef from OnlineFileSource public header

* [core] Add callback to FileSource::forward async API

* [core] Pass OfflineRegionDefinition by value

* [core] Update tests to use modular file sources

* [core] Update unit tests

* [core] Update unit tests after rebase

* [core] Backport low prio fix for cached requests

* [core] Backport pack database

* [core] Return removed factory from unRegisterFileSourceFactory

* [core] Rename shadowed args in onlinefilesource

* [core] Remove simple std::function callback aliases

* [core] Expose online file source property keys in public header file

* [test-runner] Add proxy file source test runner

* [cache] Update mbgl-cache utility to use new file source

* [metrics] Rebaseline binary size metrics

* [offline] Update offline utility

* [core] Update changelog
2020-01-13 10:57:23 +02:00
Thiago Marcos P. Santos
d08bb49c34 [core] Make it possible to reopen the database read-only for testing
Needed for Android, because the database is in readonly filesystem
and also because it is annoying to see files modified every time we
run the tests.
2020-01-08 13:07:12 +02:00
Mikhail Pozdnyakov
4c49f0c9db [core] Introduce OfflineDatabase::runPackDatabaseAutomatically() API
- added a unit test
- Updated inline comments in default_file_source.hpp
2019-12-02 13:46:51 +02:00
Mikhail Pozdnyakov
615e095ed6 [core] OfflineDatabase pack API
- introduce `OfflineDatabase::pack()` standing for incremental vacuum
- make pack optional at offline region deletion
- update `OfflineDatabase.DeleteRegion` test accordingly to the items above
2019-11-12 17:24:50 +02:00
Mikhail Pozdnyakov
e1556fc539 [core] Improve OfflineDatabase error handling
- fixes missing exception handlers (e.g. runtim error from the `initialize()` method)
- introduces generic exception handling mechanism to reduce the repeated code
2019-11-11 15:33:55 +02:00
Mikko Pulkki
a7a7e8cbe2 [render-test] Implement gfx probe for tracking gpu resources 2019-10-30 14:32:27 +02:00
Mikhail Pozdnyakov
ab603c5fed [core] Enable incremental vacuum for Offline DB
Thus we avoid re-creating the whole database and keeping the backup file as it happens on calling VACUUM.
2019-10-22 15:51:16 +03:00
Mikko Pulkki
0ca96fd8a4 [render-test] Implement fps benchmarking tests (#15803) 2019-10-22 12:13:55 +03:00
Thiago Marcos P. Santos
a4e1707f6b [offline] Document the database schema 2019-10-11 16:06:28 +03:00
Thiago Marcos P. Santos
990fdc43fa [build] Make sure offline_schema.hpp is up-to-date
- Get the bots to verify that.
 - Fix the paths.
2019-10-11 16:06:28 +03:00
Julian Rex
2b08c1d7bf [ios, macos] Fix MGLOfflinePack invalidate crash (#15582) 2019-09-18 18:13:07 -04:00
Thiago Marcos P. Santos
d424850257 [build] Make the default styles part of GL Native
The reason is applications using it, like GLFW, don't need
to depend on code inside platform/default.
2019-09-17 12:28:55 +03:00
Mikhail Pozdnyakov
f84e46ad26 [core] Mark offline region resources in batches 2019-08-29 17:28:51 +03:00
Mikhail Pozdnyakov
0c80f3a383 [core] Add OfflineDatabase::markUsedResources() 2019-08-29 17:28:51 +03:00
Mikhail Pozdnyakov
62e1e03c09 [core] Move semantics for OfflineDownload::ensureResource() 2019-08-29 17:28:51 +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
Thiago Marcos P. Santos
68e3cbacbc [core] Add method for setting a maximum size for the ambient cache
- Removed this parameter from the constructor, now that we
  have a method to set it.
- Add the method and enforce the limits if the ambient cache exceeds the
  size.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
78eeffe171 [core] Clear/Invalidate should also work on non-tile resources
These methods were only affecting tiles, but they should really
work on every resource like style, glyphs, etc.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
59e7b9a878 [core] Rename resetCache to resetDatabase
Avoid confusion about what is being reset. In this case, the whole
database and not only the ambient cache.
2019-06-18 16:26:51 +03:00
Thiago Marcos P. Santos
32e0b7beec [core] Add API for clearing tile cache 2019-06-13 22:28:16 +03:00
Konstantin Käfer
7f9274035b [core] refactor program object creation 2019-05-28 16:11:05 +02:00
Thiago Marcos P. Santos
cc26ef17d5 [core] Introduce usage tag for resources
Make the distinction if a resource is being requested for offline
usage or if it will be used immediately.

Fixes #14746
2019-05-28 16:30:49 +03: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
Thiago Marcos P. Santos
1def782cf2 [core] Add API for invalidating tiles
Add new APIs for invalidating tiles, effectively forcing Mapbox
GL Native to check with the servers if the tiles are valid before
using them. This is more efficient then deleting tiles, because
in case of valid tiles, they won't get downloaded.

Fixes #4376.
2019-05-21 01:04:01 +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
Sudarsana Babu Nagineni
2604991b2b [core] Introduce resetCache API
Add an API to delete existing database and re-initialize.
2019-04-29 17:09:58 +03: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
Bruno de Oliveira Abinader
d5868d3da8 [core] Remove file source from public Map ctor 2019-03-20 21:30:08 +02:00
Łukasz Paczos
3f7b70fdb0 [core] expose an option to change the db file path in runtime 2019-03-13 18:28:04 +01:00
Bruno de Oliveira Abinader
8cc100bfd5 [core] Get FileSource via UpdateParameters in Renderer::Impl 2019-03-13 17:56:44 +02:00
Julian Rex
1c7cd243c4 [core,ios,macos] Updates default styles to streets v11, etc. (#13585) 2018-12-18 16:00:19 -05:00
Alexander Shalamov
a228f3d80a [core] Refactor duplicated code in Asset and File sources 2018-12-17 11:37:56 +02: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