Commit Graph

3215 Commits

Author SHA1 Message Date
Justin R. Miller
eded1d90aa Merge pull request #1055 from mapbox/cocoa-annotations
Cocoa annotations API
2015-03-22 11:44:52 -07:00
Justin R. Miller
8b21104eba more safe return when no selection 2015-03-22 10:45:47 -07:00
Justin R. Miller
fbd90ff48a safety checks & no-op returns 2015-03-22 10:43:10 -07:00
Justin R. Miller
ecb8e2800d Cocoa annotations API 2015-03-22 00:53:36 -07:00
Minh Nguyễn
188331505e Merge pull request #1043 from mapbox/964-emerald-default
Show Emerald by default
2015-03-20 23:44:31 -07:00
Minh Nguyễn
f43661115f Show Emerald by default
a1a7ab62e1 only added an Emerald option to the test app, but `MGLMapView` itself has its own default style.

Fixes #964.
2015-03-20 22:52:21 -07:00
Minh Nguyễn
9ee8bac1fe Updated to latest styles
a1a7ab62e1 requires mapbox/mapbox-gl-styles@26ba1edacd.
2015-03-20 22:40:31 -07:00
Peter Liu
a1a7ab62e1 add emerald 2015-03-20 18:31:12 -07:00
Konstantin Käfer
84d472833d Merge pull request #1016 from mapbox/1016-coalesce-opengl-object-deletion
Crash when deleting buffers
2015-03-20 22:06:15 +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
Minh Nguyễn
8fb1bbca8e Merge pull request #1030 from mapbox/829-pod
CocoaPod podspec for beta 1
2015-03-20 10:02:06 -07:00
Thiago Marcos P. Santos
622b331cd5 Merge pull request #1024 from mapbox/mem_leaks
Fix a few memory leaks
2015-03-20 15:42:35 +02:00
Thiago Marcos P. Santos
1ffe2dd615 Add a reference Valgrind suppresion file
When using Valgrind for debugging memory leaks and access violations, we
often see a lot of false positives, specially when dealing with OpenGL
that does it own buffer management. This file is an attempt to filter
these false positives.

Note that we are only filtering for the open source Radeon driver and
the list will probably grow to accommodate other setups.

To use the Valgrind with the suppression file for hunting memory leaks,
try something like:

valgrind --leak-check=full --track-origins=yes --suppressions=[path/to/valgrind.sup] ./mapbox-gl
2015-03-20 14:38:08 +02:00
Thiago Marcos P. Santos
ceb7049389 Delete the data buffer of LineAtlas
Data buffer is allocated but never deleted.
2015-03-20 14:38:08 +02:00
Thiago Marcos P. Santos
490c172b35 Delete the GLFWView object at exit
Also destroy the glfwWindow we create. This leak was probably harmless
but a nice cleanup helps us debug other serious memory leaks.
2015-03-20 14:38:08 +02:00
Minh Nguyễn
1be8e6327b Prepared podspec for beta 1
This podspec was originally lifted from mapbox/mapbox-ios-sdk, which was structured and built quite differently. We could have the podspec build this repo as is, using scripts/package_ios.sh, but that would require developers to install the same version of Xcode as Travis is using (see #977). So this podspec instead pulls a prebuilt library. Much simpler.

Also package a LICENSE with the archive to satisfy a CocoaPods warning.

Fixes #829.
2015-03-19 14:40:44 -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
Justin R. Miller
b4dbba93f8 bump iOS app version 2015-03-19 12:41:59 -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
Mike Morris
ae7bd9ac6a Merge pull request #946 from friedbunny/931-fullwidth-block
Fix end of acceptable glyph/unicode range
2015-03-18 11:47:47 -04:00
Konstantin Käfer
1c276cbb76 Merge pull request #1015 from mapbox/log_scope
Scope threads to an Environment
2015-03-18 13:53:19 +01: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
66841bf7eb Add an ID to Environment
Environment will now have an incremental unique ID to that will
help distinguish between threads scoped to different Environments
when logging.
2015-03-18 12:51:33 +01:00
Thiago Marcos P. Santos
aa9adbb8f8 Scope the Tile worker thread to an Environment
We are also removing the code that is passing the Environment around
and instead, we get now the Environment in the TileData using
Environment::Get().

When processing the job, the work will be temporally registered to
the Environment as "TileWorker_0/0/0" which can be used for logging
in the future. At the end of the job, it gets unregistered
automatically from the Environment.
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
Thiago Marcos P. Santos
b52aab5f7c Introduce the ThreadInfoStore and Environment::Scope
The Environment will now keep track of every thread that is running
within a Environment::Scope. Once the Scope object is created, it will
automatically register the thread to the ThreadInfoStore with some
additional information and it will automatically deregister as the stack
frame rewinds (which can be useful for Threads that are temporally in
use by an Environment like Workers).

The ThreadInfoStore could be using the thread-local storage, but I think
that making the Environment aware of what threads are associated to it
can be useful for writing a mechanism for posting messages between threads.

Withing a Scope, the Environment associated to the thread can be queried
at any time which will save us from juggling a reference to the
Environemnt around. Finally, the type of thread (Main, Map, etc) can
also be queried at any moment to make sure a piece of code is running
on the desired thread.
2015-03-18 12:38:39 +01:00
Justin R. Miller
7b996012a5 Merge pull request #1012 from mapbox/1011-bundle
Look inside MapboxGL.bundle when present
2015-03-17 20:30:23 -07:00
Justin R. Miller
d47b29813e Merge pull request #1021 from mapbox/point-annotations-api
refs #893 #992: point annotations API
2015-03-17 20:01:38 -07:00
Justin R. Miller
93abf881fb feature() -> getFeature() to clear up ambiguity / Linux compiler error 2015-03-17 19:25:32 -07:00
Justin R. Miller
02cccfe7e8 properly clean up tile annotations on delete 2015-03-17 17:46:33 -07:00
Justin R. Miller
76f8a3d846 fix passing of annotation manager 2015-03-17 17:45:09 -07:00
Justin R. Miller
e049ce6df1 refs #893 #992: point annotations API 2015-03-17 17:30:24 -07:00
Brad Leege
1ce51a17e7 Merge pull request #1013 from mapbox/android-22
Update to latest API 22 build tools
2015-03-17 09:21:17 -05:00
Konstantin Käfer
36cee94e61 Merge pull request #843 from mapbox/843-fix-sprites
sprite images  missing on > 2.0 scale factors
2015-03-17 12:54:41 +01: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
Leith Bade
9c907e78ac Update to latest API 22 build tools 2015-03-17 13:59:05 +11:00
Minh Nguyễn
3ba72da74f Look inside MapboxGL.bundle when present
Fixes #1011.
2015-03-16 16:22:16 -07:00
Minh Nguyễn
0b1faba369 Merge pull request #1009 from mapbox/1ec5-967-readme
Add iOS project setup walkthrough including dependencies
2015-03-16 15:12:15 -07:00
Minh Nguyễn
8548927f3b Added iOS project setup walkthrough
Lists the dependencies needed for linking.

Fixes #967.
2015-03-16 12:29:57 -07:00
Konstantin Käfer
0d8b3aa5f7 Merge pull request #1006 from mapbox/linux_build_fix
Link with X11 explicitly
2015-03-16 12:10:23 +01:00
Thiago Marcos P. Santos
d66b24f58f Link with X11 explicitly
We are using X11 symbols directly like XFree() so we need to link
with it explicitly. Previously these symbols were being resolved
somehow by libGL, but apparently they are now hidden - good - in
the custom version we are using since 5e40f72b7.

Fixes #1005.
2015-03-16 10:54:34 +02:00
John Firebaugh
0c985c024b Revert "Move atlas ownership to Style"
This reverts commit bffee07154.
2015-03-13 13:05:32 -07:00
John Firebaugh
6325f1e25a Index glyph use by tile pointer value, not tile ID
There can be multiple tiles with the same ID, but from different
sources.

Fixes #957
2015-03-13 10:55:49 -07:00
John Firebaugh
96682a02af Remove unused declaration 2015-03-13 10:55:49 -07:00
John Firebaugh
998092e5b2 Remove needless indirection 2015-03-13 10:55:49 -07:00
John Firebaugh
762e4bdfbe Clean up GlyphAtlas 2015-03-13 10:55:49 -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
Justin R. Miller
c36522e2a0 Merge pull request #1000 from mapbox/ios-set-classes
iOS setAppliedStyleClasses -> setStyleClasses
2015-03-13 09:10:27 -07:00
Justin R. Miller
bcc4c9e78d iOS setAppliedStyleClasses -> setStyleClasses 2015-03-13 08:02:02 -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