Commit Graph

168 Commits

Author SHA1 Message Date
Justin R. Miller
190709c6b1 fixes #1157, #1255: cache parsed tiles in memory 2015-04-16 01:15:41 -07:00
Mike Morris
5972a7d16e make environment.hpp header public 2015-04-15 17:14:36 +02:00
John Firebaugh
6708959d12 Remove some uv.hpp includes 2015-04-09 15:30:58 -07:00
John Firebaugh
0c087603e6 Replace uv_messenger with AsyncQueue; rewrite remaining uv_* in C++ 2015-04-09 15:30:58 -07:00
John Firebaugh
d8411f26d2 Tile::ID ⇢ TileID
This allows making both Tile and TileID private.
2015-04-06 13:58:56 -07:00
John Firebaugh
7e0e55e542 Eliminate StyleSource
Fixes #695
2015-04-06 10:30:01 -07:00
Minh Nguyễn
6a1e7d5707 Fixed race condition after setting access token
`Map` should be able to deal with having no access token or JSON even while it’s running. Most of `Map` accounts for this situation, but `reloadStyle()` incorrectly assumes that one or the other is set. This change corrects the assumption in `reloadStyle()`.

Also expose the access token and style name to clients as ordinary KVO-compliant properties. Actually, they’re not so ordinary because they’re inspectable!

Ref #1070, #1147
2015-04-03 12:07:53 -07:00
John Firebaugh
12c07b916b Rework easing transition code
This brings the easing transition code a bit closer to how easings work
in gl-js. Instead of having an array of individual transitions for scale,
rotate, and pan, there is a single transition function that does all the
required calculations. This permits us to:

* Eliminate the "timeout" transition. (Fixes #126)
* Replace start/stopPanning() et al with setGestureInProgress(). Apps or
  SDKs are expected to make paired calls to setGestureInProgress(). This
  state will be ORed with the active easing state to determine when to
  use texture interpolation. (Fixes #79)
* Run style recalculations only when an ease transition that affects the
  zoom is in progress. (Fixes #1155)
2015-04-02 16:12:29 -07:00
John Firebaugh
9e38d7cc2b Move Update to its own header file 2015-04-02 15:30:13 -07:00
John Firebaugh
9331acf8e6 Add typedefs for std::chrono::steady_clock types 2015-04-02 12:28:12 +02:00
John Firebaugh
5264982ba7 Eliminate StyleLayerGroup 2015-04-01 11:14:20 -07:00
Konstantin Käfer
a2629393b3 dispatch all AnnotationManager calls to the map thread
calls that return a value block until the operation was executed
2015-03-27 12:56:41 +01:00
Justin R. Miller
10a30daed6 refs #894, fixes #1074: callout views for iOS 2015-03-24 18:43:24 -07:00
Justin R. Miller
c5597ad6f1 annotations perf improvements & iOS app testing
squash of #1061
2015-03-23 20:49:02 -07:00
Justin R. Miller
486a385f98 Merge branch 'master' into 1022-annotations-thread-safety 2015-03-23 11:13:51 -07:00
Konstantin Käfer
d2faca1861 move style classes to MapData object and make thread safe 2015-03-23 11:02:21 +01:00
Konstantin Käfer
3d2dcbb6ef move accessToken to MapData 2015-03-23 11:02:21 +01:00
Konstantin Käfer
9637176711 move defaultTransitionDuration to MapData 2015-03-23 11:02:19 +01:00
Konstantin Käfer
268975d4c2 move animationTime to MapData store 2015-03-23 11:01:39 +01:00
Konstantin Käfer
03e400e002 make the debug flag atomic and move to MapData 2015-03-23 11:01:02 +01:00
Konstantin Käfer
ebd2985f78 make style updates a little more threadsafe
- we're now always loading and parsing styles in the map thread
- adds an atomic enum that stores the actual updates we need to perform
- adds a MapData object that mutexes access to variables used from both threads
2015-03-23 11:01:01 +01:00
Konstantin Käfer
61fa436193 coalesce buffer deletions and run them in bulk during rendering
On iOS, the main thread does framebuffer operations just before it requests a rerender of the view contents. This means that GL operations on the Map thread will interfere with that and cause a crash. While most GL operations happen throughout rendering (which is synchronized with the main thread), deletion of shared_ptrs release in turn their OpenGL objects. This may happen at any time and isn't synced with rendering.

This patch changes this so instead of deleting all objects immediately, we are collecting all abandoned IDs and delete them in bulk once the main thread has given us permission to use OpenGL calls (i.e. during render()).
2015-03-20 19:47:54 +01:00
Konstantin Käfer
f73dfc73f1 make more things const and refs, and add mutexes 2015-03-20 13:14:00 +01:00
Thiago Marcos P. Santos
b5facd35bc Scope the Map thread to an Environment
Also, replace manual thread type checks with Environment::currentlyOn().
2015-03-18 12:51:33 +01:00
Justin R. Miller
e049ce6df1 refs #893 #992: point annotations API 2015-03-17 17:30:24 -07:00
John Firebaugh
0c985c024b Revert "Move atlas ownership to Style"
This reverts commit bffee07154.
2015-03-13 13:05:32 -07:00
John Firebaugh
bffee07154 Move atlas ownership to Style
This follows gl-js and just makes sense -- whenever the style changes
the atlases should be blown away.

Refs #957
2015-03-13 10:55:47 -07:00
Konstantin Käfer
47ede853c4 fixes black flicker on rotating the device
fixes #838

instead of rendering ad libitum on the map thread, we are now driving rendering from the UI thread on iOS via the map.renderSync() function. There are still white bars during the rotation, but the general content of the view is kept visible.

- upgrades GLFW to 3.1
- removes swapped/needsSwap in favor of a more explicit scheme
- View#invalidate() now replaces View#swap() and is called whenever the View needs to trigger a rerender. GLFW and Android to this right away, while iOS goes back to the main thread and does the Map redrawing as part of the GLKView update
- sets all iOS deployment targets to 7.0
- disables SQLite3 version check, since the library version changed on iOS 8.2
2015-03-12 12:16:38 +01:00
Konstantin Käfer
9781785ab7 scope Requests to an Environment object for easier cancelation
we are now scoping all file requests to an environment object. The FileSource implementation treats
this as an opaque pointer, but allows canceling all Requests that are associated with that pointer.
This is necessary to abort all file requests that originated from a particular Map object. Aborting
a file request is different from canceling a file request: A canceled request doesn't have its
callback called, while an aborted request will have its callback called with an error, indicating
that the environment is going to be shut down.
2015-03-06 08:21:47 -08:00
Konstantin Käfer
e00bae4f1c lock the StyleBucket to avoid crashing
stopgap until we have a solution that doesn't mutate the style objects while parsing a tile
2015-03-06 15:42:34 +01:00
Konstantin Käfer
fb44fc81bd make Map::resize() private
they can only be called by View::resize
2015-03-06 13:52:25 +01:00
Konstantin Käfer
8e42582c52 update static image rendering executable 2015-03-06 12:41:00 +01:00
Justin R. Miller
6e41664cb0 fixes #476 & #853: pixel/meter/latlng conversion routines in core & iOS 2015-02-16 09:52:36 -08:00
Konstantin Käfer
704b3719f5 use standard DEBUG macro rather than NDEBUG 2015-02-04 10:49:07 +01:00
Konstantin Käfer
b9bf66e67e rewrite storage layer to be independent of the Map's event loop 2015-02-04 10:46:37 +01:00
Leith Bade
89bbd29278 Use std::chrono 2015-02-04 09:39:25 +11:00
Leith Bade
42d1972732 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	src/mbgl/renderer/painter_prerender.cpp
	src/mbgl/renderer/prerendered_texture.cpp
	src/mbgl/renderer/prerendered_texture.hpp
2015-01-23 11:11:04 +11:00
John Firebaugh
a8b6e3dc71 Merge remote-tracking branch 'origin/dash-3' into v7 2015-01-22 13:06:30 -08:00
Leith Bade
5feba9ac07 get/setAppliedStyleClasses -> get/setClasses 2015-01-18 17:05:01 +11:00
Leith Bade
016c2948c5 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	src/mbgl/map/map.cpp
2015-01-18 16:33:39 +11:00
Ansis Brammanis
2643a0efc7 start porting dash lines from js
- switches to dash units that are scaled by line width
- adds a lineatlas to store patterns line dashed lines
- adds linesdf shader which renders line fill from the lineatlas

js: 8e83d76af3bd877eb9639c02e296363e2c0186f8
2015-01-14 20:56:18 -05:00
John Firebaugh
d24b73b1a6 Move class state to map
https://github.com/mapbox/mapbox-gl-js/pull/936
2015-01-14 17:43:44 -08:00
Leith Bade
ff3ea3e20b Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	platform/default/glfw_view.cpp
	platform/default/headless_view.cpp
	src/mbgl/map/map.cpp
2014-12-23 11:33:26 +13:00
Leith Bade
0771e50460 Rename View functions to match conventions. Also tidy up view classes and remove C style casts. Closes #656 2014-12-23 09:29:45 +13:00
Leith Bade
df19683b6a Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	Makefile
	platform/default/headless_view.cpp
	src/mbgl/map/map.cpp
2014-12-21 15:02:47 +13:00
Konstantin Käfer
21e9e0a5ea set rendering mode so that we can skip intermediate renders for static images 2014-12-12 15:01:09 +01:00
Leith Bade
0487b0c6a3 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	src/mbgl/map/map.cpp
2014-12-08 20:19:41 +11:00
John Firebaugh
de098591c5 Remove Map::cleanup and Painter::cleanup
Both were noops.
2014-12-06 14:08:40 -08:00
Leith Bade
de9eb00276 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts:
	.gitignore
	gyp/mbgl-ios.gypi
	gyp/mbgl-linux.gypi
	gyp/mbgl-osx.gypi
	include/mbgl/map/map.hpp
	src/mbgl/map/map.cpp
	src/mbgl/storage/caching_http_file_source.cpp
2014-12-05 23:16:49 +11:00
John Firebaugh
ff640132de Move setAccessToken to CachingHTTPFileSource 2014-12-04 17:03:23 -08:00