Commit Graph

1314 Commits

Author SHA1 Message Date
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
Konstantin Käfer
54cd6a59de make sure that we always have a style object after prepar() 2015-03-26 16:12:49 +01:00
Ansis Brammanis
14e8b4bb09 support wrapped bilinear scaling
to get rid of seams in repeating patterns.

https://github.com/mapbox/mapbox-gl-styles/issues/50#issuecomment-86159351
2015-03-26 10:45:23 +01:00
Ansis Brammanis
9080f25d31 fix sprite padding, fixes
https://github.com/mapbox/mapbox-gl-styles/issues/50#issuecomment-86159351
2015-03-26 10:45:23 +01:00
Ansis Brammanis
24922795c5 height not width, fixes #1038 2015-03-25 13:23:15 -07:00
Justin R. Miller
10a30daed6 refs #894, fixes #1074: callout views for iOS 2015-03-24 18:43:24 -07:00
Ansis Brammanis
f14111b82a make 1.0 the default base for all types 2015-03-24 16:30:17 -07:00
Ansis Brammanis
31a3d3603c clip fill antialiasing with depth buffer to avoid overlapping
https://github.com/mapbox/mapbox-gl-native/pull/381
2015-03-24 16:08:26 -07:00
John Firebaugh
96f6b79251 Compare correct fill/stroke variables
The comparisons here need to take into account the check above for the
special value {{ 0, 0, 0, -1 }} for stroke_color, which indicates that
the fill color should be used.
2015-03-24 16:08:26 -07:00
Konstantin Käfer
2990f38824 Merge pull request #1073 from mapbox/debug_crash
Fix crash on debug build
2015-03-24 15:14:48 +01:00
Justin R. Miller
c5597ad6f1 annotations perf improvements & iOS app testing
squash of #1061
2015-03-23 20:49:02 -07:00
Thiago Marcos P. Santos
0603d8f5e3 Fix crash on debug build
styleInfo is being passed to request() by reference but it is stack
allocated and goes out of scope. Pass the bits we are interested by
value instead.
2015-03-24 00:44:07 +02:00
Justin R. Miller
486a385f98 Merge branch 'master' into 1022-annotations-thread-safety 2015-03-23 11:13:51 -07:00
Konstantin Käfer
9d30d4042c delete the workers in the correct thread
fixes #1066
2015-03-23 12:18:40 +01: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
ecb8e2800d Cocoa annotations API 2015-03-22 00:53:36 -07: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
Justin R. Miller
6b1d792f9d add comments to annotation manager; fix vector reserve 2015-03-20 08:28:15 -07:00
Justin R. Miller
897107416b remove now-unused operator 2015-03-20 08:22:53 -07: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
Konstantin Käfer
f73dfc73f1 make more things const and refs, and add mutexes 2015-03-20 13:14:00 +01: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
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
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
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
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
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
John Firebaugh
ba933b3f45 Merge pull request #984 from mapbox/log_stderr_printf
Get rid of printf and cout by using Log::*
2015-03-12 15:39:07 -07:00
Konstantin Käfer
74ef8840ce tolerate missing sprites
Do not try to fulfil the promise twice in case both requests to the sprite JSON and image fail. this will crash the program. Instead, we always continue with the promise, instead of throwing an exception. This allows the program to continue parsing tiles, but without an image sprite available. This means the map will render, but without the sprite images
2015-03-12 15:27:56 +01:00
Thiago Marcos P. Santos
124b49562d Get rid of printf and cout by using Log::*
Use our logging system that will route the message accordingly on
the target platform.

Fixes #613
2015-03-12 14:19:32 +02: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