Commit Graph

1451 Commits

Author SHA1 Message Date
John Firebaugh
bbcc7c26d9 Merge pull request #1065 from mapbox/1065-separate-ui-from-map-thread
Better separation between UI thread and Map thread
2015-04-30 10:22:06 -04:00
John Firebaugh
1d957d6898 Deactivate after cleanup 2015-04-30 09:57:58 -04:00
Dane Springmeyer
226799e811 Merge pull request #1342 from mapbox/clipper-even-odd
Use evenodd fill type for pre-tessellation union
2015-04-29 10:35:14 -07:00
Ansis Brammanis
3e928f41c8 fix line tessellation
-js: 7cf7ef763d
2015-04-28 18:14:34 -07:00
John Firebaugh
481fa0e69f Restructure *Request and Context
The previous implementation, based on thread-local storage, did not
ensure that the context was destructed before the FileSource run loop.
This resulted in implementations attempting to uv_close handles for a
loop that had already been destroyed.

This change also fixes #1262.
2015-04-28 19:26:35 -04:00
John Firebaugh
2c3952af66 Avoid binding a shared_ptr<TileData> in the work callback
It's possible that the work callback can outlive the after callback,
since work callback destruction and after callback execution happen in
two different threads. This could account for the crash seen in
https://github.com/mapbox/mapbox-gl-native/issues/1309#issuecomment-96108868
2015-04-28 14:32:26 -04:00
John Firebaugh
cdb466e7f7 Convert Style to unique_ptr and pass by reference
Fixes #1277
Fixes #1309
2015-04-28 14:32:26 -04:00
John Firebaugh
0c280adebc Move Worker to Style
This ensures that worker tasks are entirely complete by the
time the style is destructed, and enables us to pass Style&
rather than a shared pointer.
2015-04-28 14:32:26 -04:00
John Firebaugh
4ccf246c10 Rewrite Worker in terms of Thread<> 2015-04-28 14:32:26 -04:00
John Firebaugh
59255a3d9e MapContext::updated doesn't need to be atomic 2015-04-28 14:32:25 -04:00
John Firebaugh
8bb7fc64ff Move Environment to MapContext 2015-04-28 14:32:25 -04:00
John Firebaugh
bb7c453b3e Inline getWorker() 2015-04-28 14:32:25 -04:00
John Firebaugh
3bf0bf9538 Remove unused includes 2015-04-28 14:32:25 -04:00
John Firebaugh
f8db45f19a Move still image callback to MapContext 2015-04-28 14:32:25 -04:00
John Firebaugh
f0b229730f Move style info to MapContext 2015-04-28 14:32:25 -04:00
John Firebaugh
b5b58086a8 Combine update and triggerUpdate 2015-04-28 14:32:25 -04:00
John Firebaugh
230027e514 Resize view from map thread 2015-04-28 14:32:24 -04:00
John Firebaugh
a625ba8a09 Remove Map::start/stop
Both Android and iOS now use pause/resume. The map thread is
always running, and be able to receive messages. When paused,
it will just refuse to render.
2015-04-28 14:32:24 -04:00
John Firebaugh
5f76ab270e Encapsulate access to Thread's uv_loop_t
The Thread object gets access via its constructor. No other object
should have access; off-thread objects can't safely do anything with
it except pass it back to the thread.
2015-04-28 14:32:24 -04:00
John Firebaugh
f27641bcb5 Fully cancel the sprite requests 2015-04-28 14:32:24 -04:00
John Firebaugh
16168abaea Remove redundant Style instantiation
reloadStyle calls loadStyleJSON, which also creates the
style. There is no need to create it in reloadStyle as
well.
2015-04-28 14:32:24 -04:00
John Firebaugh
fec4cd613c Kill overly-verbose output 2015-04-28 14:32:23 -04:00
John Firebaugh
7cd55a3333 Enforce that transformState belongs to Map thread 2015-04-28 14:32:23 -04:00
John Firebaugh
c2abd1d692 Log error as Error 2015-04-28 14:32:23 -04:00
John Firebaugh
05dc61f62c LiveTileData with no data should end up in parsed state, not obsolete 2015-04-28 14:32:23 -04:00
John Firebaugh
958142c512 Clean up Sprite
* Provide a callback so MapContext can re-render when it loads.
* Cancel in-progress loading rather than relying on keeping it
  alive with a shared_ptr.
* Remove / privatize as much as possible.
2015-04-28 14:32:23 -04:00
John Firebaugh
ec7588f1fd Implement Style::isLoaded 2015-04-28 14:32:22 -04:00
John Firebaugh
6c7a01a503 Following kkaefer's view changes 2015-04-28 14:32:22 -04:00
John Firebaugh
75ae956b0e WIP: Use Thread<MapContext> 2015-04-28 14:32:22 -04:00
John Firebaugh
32c818feea Provide Thread objects with access to loop 2015-04-28 14:32:22 -04:00
John Firebaugh
41a44280ca Prepare for using Thread<MapContext> 2015-04-28 14:32:22 -04:00
John Firebaugh
fc9b958bb8 updateAnnotationTiles is called within invoke* 2015-04-28 14:32:22 -04:00
John Firebaugh
025eb013d7 Privatize remaining MapContext members 2015-04-28 14:32:21 -04:00
John Firebaugh
424dae0a2c Move run() to MapContext 2015-04-28 14:32:21 -04:00
Konstantin Käfer
dae18cc7bc remove some unused includes 2015-04-28 14:32:21 -04:00
Konstantin Käfer
6081941662 move uv version check to uv.cpp 2015-04-28 14:32:21 -04:00
Konstantin Käfer
b0a30943b4 move most private Map code to MapContext 2015-04-28 14:32:20 -04:00
Konstantin Käfer
9dc51e7f80 move rendering mode enum to MapData object 2015-04-28 14:32:20 -04:00
Konstantin Käfer
fa272b3aaa move asyncRender to MapContext 2015-04-28 14:32:20 -04:00
Konstantin Käfer
f8600d8d97 move getSprite to MapContext 2015-04-28 14:32:20 -04:00
Konstantin Käfer
9580ec7b08 move Style to MapContext 2015-04-28 14:32:20 -04:00
Konstantin Käfer
f272d13dea move worker to MapContext 2015-04-28 14:32:19 -04:00
Konstantin Käfer
67fa80f5e9 move MapContext to its own file 2015-04-28 14:32:19 -04:00
Konstantin Käfer
07525d5d50 move Sprite to MapContext 2015-04-28 14:32:19 -04:00
Konstantin Käfer
9af7af3109 move GlyphStore to MapContext 2015-04-28 14:32:19 -04:00
Konstantin Käfer
63acd5b0a1 move texturepool to context 2015-04-28 14:32:19 -04:00
Konstantin Käfer
9b64edd712 remove unused reference 2015-04-28 14:32:18 -04:00
Konstantin Käfer
ad0178fd45 move atlas/painter to map context 2015-04-28 14:32:18 -04:00
Konstantin Käfer
c88a60b1e5 remove unused includes 2015-04-28 14:32:18 -04:00
Konstantin Käfer
7c8c45edab move activeSources to internal Map context 2015-04-28 14:32:18 -04:00