Commit Graph

161 Commits

Author SHA1 Message Date
John Firebaugh
6e78eabfff [core] Clean up ThreadContext vestiges 2016-04-15 09:56:18 -07:00
John Firebaugh
204c7fee03 [core] Render from the main thread
Do not create a thread for the MapContext anymore.
2016-04-14 13:44:08 -07:00
John Firebaugh
5eda74a514 Merge branch 'release-ios-3.2.0-android-4.0.0' 2016-03-30 17:43:37 -07:00
John Firebaugh
7b5a1ca167 [core] Localize and simplify state for MapChangeDidFinishLoadingMap event
Only Map needs to track this state, and it can simply be set when beginning to load a style and reset when finished.
2016-03-30 13:53:31 -07:00
Bruno de Oliveira Abinader
fe1b417d04 [core] Update time point in map context on every update
Previous behavior prevented view from notifying when map was fully
loaded, because the style sources relies on a future time point for
checking if their tiles are updated. This was first caught only in still
mode, but also happens in continuous mode for platforms that rely on
View::notifyMapChange for updating the view.
2016-03-24 22:02:30 +02:00
Bruno de Oliveira Abinader
cd1a06c2dc [core] Get rid of MapData::{get,set}animationTime 2016-03-18 01:27:48 +02:00
Bruno de Oliveira Abinader
8f96dea822 [core] Remove default transition duration 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
f736e46ca4 [core] s/Update::Zoom/Update/RecalculateStyle/ 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
4909169996 [core] Added user-defined transition properties when modifying classes 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
aa530d2bea [core] Cleaned up duplicate code in MapContext 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
01edd4503c [core] Move class handling to Style 2016-03-18 01:26:22 +02:00
Henry Dooley
cf4dddd1b9 Fixes an issue where rendering without Vertex Array Objects would cause a massive slowdown in the driver on Nvidia hardware. Unconfirmed if the issue is present on other GPUs. 2016-03-04 10:23:09 -08:00
Bruno de Oliveira Abinader
877adedb0f [core] Fix style cascade loop when transitioning 2016-03-03 15:47:03 +02:00
John Firebaugh
9c26f06318 [core] Thread GLObjectStore through to Holder objects
This eliminates the reliance on ThreadContext to provide GLObjectStore, and statically enforces that GL cleanup functions happen only when GLObjectStore::performCleanup is called.

With the elimination of the Map thread, this becomes important because there may be multiple GLObjectStore's per-thread, and Map will need to ensure that the correct context is active when calling GLObjectStore::performCleanup.
2016-02-18 15:15:24 -08:00
John Firebaugh
7b39ce9521 [core] Remove ThreadContext::getFileSource; instead thread FileSource through 2016-02-18 15:15:24 -08:00
Bruno de Oliveira Abinader
bfafc360a7 [gl] Moved TexturePool to gl namespace 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
1336e3e30f [gl] Moved GLObjectStore to gl namespace 2016-02-18 13:27:35 +02:00
John Firebaugh
e9302c797f [all] Don't interpret 404s on non-tile resources as "no content" 2016-02-10 15:40:20 -08:00
John Firebaugh
5512d87362 [core] Remove TransformState::getNormalizedZoom
It calculated the same value as TransformState::getZoom.
2016-02-02 12:44:28 -08:00
John Firebaugh
b41a73e1c1 [core] Rationalize Resource initialization 2016-01-29 14:50:15 -08:00
John Firebaugh
27134df2e4 [core] Use notModified to check for style change 2016-01-22 18:42:53 -08:00
John Firebaugh
9b62661b07 [core] Use experimental optional instead of mapbox::util::optional 2016-01-19 17:56:48 -08:00
Konstantin Käfer
21e4029acf [core] use stale styles
This adds support for using cached styles that are stale. They're treated like changing styles; when the refreshed style changed compared to the one we've already had, we're swapping out the entire style, which might cause a slight flicker.
2016-01-15 11:59:26 +01:00
Thiago Marcos P. Santos
d7fdcc73bf [core] Get rid of ::unref() for Timer and AsyncTask
Not need, legacy from libuv. The RunLoop keep the main
loop running until is explicitly no longer needed.
2016-01-09 01:26:29 +02:00
Konstantin Käfer
bc309d84d7 [core] unify URL prefix detection (asset:// and mapbox://) 2016-01-08 12:14:39 +01:00
John Firebaugh
16de579d7c [core] Rationalize error handling for resource loading
* Standardize on std::exception_ptr as the error representation
  (fixes #2854).
* Don't format textual strings at the error source; pass on the
  constituent data via observer method parameters instead.
* Use the null object pattern to simplify observer notification code.
* Further refactoring for ResourceLoading tests.
2015-12-23 12:50:42 -08:00
John Firebaugh
110f1ec796 [ios, android] Add methods to remove a custom layer 2015-12-17 15:15:55 -08:00
John Firebaugh
8a17d30c50 [android] Custom layer bindings 2015-12-16 11:03:32 -08:00
Romain Quidet
af45d87e54 2210: Sprites can be removed / updated correctly 2015-12-15 16:36:17 -08:00
John Firebaugh
bde07c8f0e [core] Custom layers 2015-12-09 13:51:28 -08:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
Konstantin Käfer
dc620f48de [core] Fix std::move() misuse that disables copy elision 2015-12-03 15:38:36 +01:00
John Firebaugh
8afa14fa78 [core] Map::setSprite ⇢ Map::addAnnotationIcon
Fixes #3084
2015-12-01 15:10:28 -08:00
John Firebaugh
b7674040ab [core] Privatize layers and sources 2015-12-01 11:16:57 -08:00
Adam Hunter
e1091db45e [core] Use a separate atlas and store for annotation sprites
Fixes #1488
2015-12-01 09:15:05 -08:00
John Firebaugh
58886842bc [core] Move MapData storage to MapContext
This allows MapData members to hold GL resources which must be released
on the MapContext thread -- necessary for the following commit.
2015-12-01 09:15:05 -08:00
Thiago Marcos P. Santos
1d62332204 [core] Use AsyncTask on the MapContext 2015-12-01 00:00:09 +02:00
John Firebaugh
0c1e378bc9 [core] Rewrite image handling
* Consolidate Image and StillImage
* Typecheck unassociated vs premultiplied images
* Rewrite default platform image decoding implementation
2015-11-25 15:57:36 -08:00
John Firebaugh
afa04de152 [core] Followup fix to #3037
The previous fix resulted in annotations sometimes never being added.
This would happen if, during the execution of MapContext::update where
Update::Annotations was set, the style itself was loaded but some of
its subresources (sprite or sources) were not.

#3082 is a follow up issue to make MapContext::update less error-prone.
2015-11-19 18:01:42 -08:00
John Firebaugh
db1c4f2cc2 [core] Avoid calling AnnotationManager::updateStyle until the style is loaded
Fixes #3037
2015-11-18 16:05:13 -08:00
Bruno de Oliveira Abinader
711d41f91b [core] Avoid extra copy of TransformState in Painter::render
In MapContext thread, TransformState gets updated from main thread to
MapContext and Painter can safely reference MapContext's TransformState
instead of copying it upon each Painter::render call.
2015-11-18 09:37:27 +02:00
John Firebaugh
1caf89c32b [core] Pass a value to response callback, not a reference 2015-11-16 12:25:47 -08:00
Thiago Marcos P. Santos
36581f3d30 [core] Do not pass uv_loop_t around
This should be abstracted by util::RunLoop
2015-11-16 12:25:47 -08:00
John Firebaugh
f9ebe54a63 [core] Merge Sprite into SpriteStore 2015-11-12 13:03:14 -08:00
John Firebaugh
1e350b7ea4 [core] Reorganize sprite related files 2015-11-12 13:03:14 -08:00
Konstantin Käfer
7b8b2b1790 Revert "[core] only update the render order array when there are changes to tiles"
This reverts commit ec1a58d8ef and 177372b836.
2015-11-09 11:18:10 -08:00
Bruno de Oliveira Abinader
ff5d405958 [core] Update::Classes already implies repaint 2015-11-09 15:05:08 +02:00
Konstantin Käfer
ec1a58d8ef [core] clear the render order when we're loading a new style
regression introduced by #2908
2015-11-06 16:42:44 +01:00
Konstantin Käfer
177372b836 [core] only update the render order array when there are changes to tiles 2015-11-05 10:33:21 +01:00
Konstantin Käfer
4d5c6333be [core] move retry logic to DefaultFileSource 2015-11-02 17:24:40 +01:00