Commit Graph

952 Commits

Author SHA1 Message Date
Justin R. Miller
2066e201ea Merge remote-tracking branch 'origin/master' into 1128-convert-booleans 2015-03-27 09:00:07 -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
1a8d6445d1 convert metrics BOOLs to strings internally 2015-03-27 00:17:42 -07:00
Justin R. Miller
bf3c87b17f more metrics magic strings removals 2015-03-26 23:31:08 -07:00
Justin R. Miller
83f083c7b5 fixes #1116: metrics stability & performance refactor 2015-03-26 21:27:56 -07:00
Minh Nguyễn
32aa865f14 Merge branch 'ios-unused'
Left in MGLTypes.h, which is now a platform-neutral (iOS + OS X) place for MGLUserTrackingMode.
2015-03-26 15:12:15 -07:00
Justin R. Miller
f3058dbc9a closes #1082, refs #756: user dot on map in iOS 2015-03-25 17:48:22 -07:00
Justin R. Miller
10a30daed6 refs #894, fixes #1074: callout views for iOS 2015-03-24 18:43:24 -07:00
Brad Leege
88398b2545 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into 1033-metrics
Conflicts:
	platform/ios/MGLMapView.mm
2015-03-24 15:15:27 -05:00
Brad Leege
3e062d0e20 #1033 - Flush all events to server when app enters background 2015-03-24 10:02:13 -05: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
Brad Leege
044d1fc3c2 Merge branch 'master' of github.com:mapbox/mapbox-gl-native into 1033-metrics
Conflicts:
	gyp/platform-ios.gypi
	platform/ios/MGLMapView.mm
	styles
2015-03-23 10:52:27 -05: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
Justin R. Miller
0e2d6c8277 fixes #1053: umbrella Cocoa header 2015-03-22 12:25:10 -07:00
Justin R. Miller
ecb8e2800d Cocoa annotations API 2015-03-22 00:53:36 -07:00
Brad Leege
33f4dfffd2 #1033 - Removing BackgroundStatus analytic 2015-03-20 17:14:25 -05:00
Brad Leege
ec304d37ac #1033 - Integrating MapboxEvents class. 2015-03-20 16:01:52 -05: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
Brad Leege
253643f57d #1033 - Renaming MBLocationManager to MGLMetricsLocationManager to better comply with naming scheme. 2015-03-20 11:37:50 -05:00
Brad Leege
c42e83fcc6 #1033 - Moving MBLocationManager to Core GL from app specific instance. 2015-03-20 11:11:06 -05:00
Konstantin Käfer
f73dfc73f1 make more things const and refs, and add mutexes 2015-03-20 13:14:00 +01:00
John Firebaugh
645d1f3857 Delete unused code
This code appears to be unused and has not been kept in sync with style
spec changes.
2015-03-19 14:45:59 -07:00
Minh Nguyễn
0cdf21c62d Merge pull request #1020 from mapbox/init-bundled-style
API for initializing with bundled style
2015-03-19 13:39:05 -07:00
Minh Nguyễn
3d195b467a Added API for initializing with bundled style
As a best practice for the beta and a workaround for #1014.

Also reversed the argument order of the existing init method. Reads better this way, but you’ll likely have to change your initialization to match the new signatures.
2015-03-19 10:29:04 -07:00
Thiago Marcos P. Santos
3254cdc85c Log the Environment ID and the Thread name
To make it easier to debug, add the Environment ID and the Thread name
to the log messages. For instance log messages from the TileParser will look like:

[WARNING] {0}{TileWorker_15/18653/9486}[ParseTile]: some relevant warning message
   |       |             |                  |
   |       |             |                  +-> Component
   |       |             +--------------------> Thread name
   |       +----------------------------------> Environment ID
   +------------------------------------------> Severity level

Log messages that are not inside an Environment::Scope will work
normally and will look like:

[WARNING] [JNI]: some relevant warning message

Fixes #882.
2015-03-18 12:51:33 +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
Konstantin Käfer
48c55af5c1 fix sprites for pixel ratios that are not 1 and 2
- OpenGL ES 2 doesn't allow NPOT textures with wrap-around
- The Sprite object reported the map's pixelRatio, even though it loaded @2x assets
- Copying icons from the sprite into the atlas now uses bilinear scaling to scale up to the actual size
2015-03-17 12:30:40 +01: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
069505fe75 fix rare issue that had the notify and cancel callbacks called in the wrong order 2015-03-13 15:30:10 +01:00
Thiago Marcos P. Santos
2b6afe6a54 Merge pull request #972 from mapbox/log_cleanup
Refactoring of the log system
2015-03-12 14:18:25 +02:00
Thiago Marcos P. Santos
79f3149d9d Update the FixtureLog
Now the FixtureLog is an Log::Observer instead of a backend. The
observer can sniff and filter log messages, that can be used
for fail a test if it emits a warning for example.
2015-03-12 13:28:41 +02:00
Thiago Marcos P. Santos
51bc265db3 Make the logging system static
No initialization is needed anymore and we can use the logging functions
safely at any point of the code (threading is not handled though, so you
might get multiplexed messages if you log from two threads
simultaneously).
2015-03-12 13:28:41 +02:00
Thiago Marcos P. Santos
2948e7d121 Simplify the logging mechanism
Move the implementation of the more specialized methods to the base
class and let the platform implement only the most generic method that
takes all the possible arguments.

These specialized methods will then map to the generic implementation
that must be provided by the platforms we support.
2015-03-12 13:28:40 +02: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
10d84f6be8 remove unused enum 2015-03-06 20:52:47 +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
8c0acecbe3 fix handling around unique_ptr releases 2015-03-06 16:17:49 +01:00
Konstantin Käfer
8408dc9e4d use a reinterpret_cast to return the correct type 2015-03-06 16:17:49 +01:00
Konstantin Käfer
2075d6bb9a fix ambiguous name (gcc) 2015-03-06 16:09:14 +01:00
Konstantin Käfer
025654a101 throw exception when shader compilation fails 2015-03-06 15:42:34 +01:00
Konstantin Käfer
e8389d82cd guard against concurrent OpenGL extension loading 2015-03-06 15:42:34 +01:00
Konstantin Käfer
c30bb1a9f8 add more locking around GlyphStore and FontStack
this is a stopgap until we have a solution that gives every worker thread their own copy
2015-03-06 15:42:34 +01:00