Commit Graph

1523 Commits

Author SHA1 Message Date
John Firebaugh
e6eb6c7fe4 Use uv::async 2015-05-13 13:54:16 -07:00
John Firebaugh
386be7c0fa Remove unused
There are no longer any requests made that don't have a run loop to
dispatch back to.
2015-05-13 13:54:16 -07:00
Konstantin Käfer
e274959753 abort rendering early when we don't need to
when rendering still images, we don't need to render until everything is completely loaded
2015-05-13 10:39:22 +02:00
Thiago Marcos P. Santos
3b92725de1 Stop processing SymbolBuckets at the first incomplete bucket
In order to calculate the collision correctly, the layer ordering
matters. Because of that, when we find the first incomplete symbol
bucket, we stop processing any furter SymbolBucket.

The side effect of this change is, if the first SymbolBucket is the
last to receive its resources, we won't see any label at all on
the screen until the last moment, when everything will be draw at
once.
2015-05-13 09:58:29 +02:00
Thiago Marcos P. Santos
af63b4980d Move the Collision object from TileParser to VectorTileData
We keep the Collision object alive longer because we need it
for the SymbolBuckets yet to be created in case more data
resources arrive. When the tile is no longer needed or if it
is completely parsed or obsolete (i.e. in a immutable state)
we throw the Collision object away.
2015-05-13 09:58:29 +02:00
Thiago Marcos P. Santos
41d619771e Make the state attribute private
Also add a virtual setState() method to give subclasses a chance
to intercept the change of state. This will be used by VectorTileData
to release resources when the TileData becomes immutable.
2015-05-13 09:58:19 +02:00
Konstantin Käfer
40b604448f add BinPack test 2015-05-12 20:46:56 -07:00
Konstantin Käfer
8dd6da5b5e don't implicitly cast to bool since this will make comparisons fails 2015-05-12 20:46:56 -07:00
Konstantin Käfer
fc74f8dcd5 Merge pull request #1484 from mapbox/fix-line-atlas-overflow
Fix potential integer overflow in line_atlas
2015-05-12 15:21:00 +02:00
John Firebaugh
76b922453a Set correct strata for background render
Fixes #1478
2015-05-12 10:50:36 +02:00
Brad Leege
d4fcb5bb98 Merge pull request #1469 from mapbox/1435-android-gl-crash
Android GL Crash
2015-05-11 11:42:21 -05:00
Thiago Marcos P. Santos
642024af6d Merge pull request #1499 from mapbox/clang-3.7-libcpp-atomic_flag-initialized
Initialize the atomic_flag in the class definition
2015-05-11 16:10:54 +03:00
Thiago Marcos P. Santos
b7c63630a4 Initialize the atomic_flag in the class definition
ATOMIC_FLAG_INIT is often defined to { 0 } or { false } and some
compilers might complain about initializing as flag(ATOMIC_FLAG_INIT).
2015-05-11 15:43:55 +03:00
Konstantin Käfer
b7b532ce28 manage atlas textures with unique_ptrs 2015-05-11 11:28:11 +02:00
Leith Bade
703e0bc2ee Ignore deactivate when no valid EGL display. Fixes #1435
Initialise NativeMapView's EGL variables before Map

Fix hang

Add check for double pause

Add test for double pause
2015-05-09 12:02:39 +10:00
Dane Springmeyer
768c259495 fix division by zero conditions 2015-05-08 15:19:41 -07:00
Dane Springmeyer
04c73e5ae1 fix integer overflow in line_atlas 2015-05-08 14:52:33 -07:00
Konstantin Käfer
24ea920810 ignore Transform changes with NaN parameters 2015-05-08 20:25:47 +02:00
Konstantin Käfer
9014890d44 initialize TransformState helper variables correctly 2015-05-08 20:25:38 +02:00
John Firebaugh
1cf5af9c31 Merge remote-tracking branch 'origin/1369-alternate-fix' 2015-05-08 11:20:10 -07:00
Konstantin Käfer
8ee40a544e make WorkRequests cancelable 2015-05-08 16:43:18 +02:00
Konstantin Käfer
bd8d10bab6 make DefaultFileRequest movable only 2015-05-08 11:34:46 +02:00
Konstantin Käfer
fb984a22d1 don't trigger a HTTP request twice 2015-05-08 11:30:26 +02:00
Minh Nguyễn
dcbf4940da Merge pull request #1464 from mapbox/1ec5-type-in
Parse feature types in set filters
2015-05-07 11:35:48 -07:00
Minh Nguyễn
6292e95f80 Parse feature types in set filters
A filter key of `$type` should work in an `in` filter, just like in an `==` filter.
2015-05-07 08:35:41 -07:00
Thiago Marcos P. Santos
8ad81a6676 Removed unused method from MapContext 2015-05-07 16:21:01 +03:00
John Firebaugh
5b4015ccba Reference safety for Worker after callbacks
Joining a WorkRequest now ensures that either the after callback has
already been executed, or will never be executed.

Fixes #1438
2015-05-06 14:30:02 -07:00
John Firebaugh
a7df0781f8 Don't crash if ResourceLoader::_sprite is null 2015-05-05 13:34:46 -07:00
Thiago Marcos P. Santos
19881f8b24 Cancel all pending requests before leaving
This still has the unwanted side effect off blocking the Map thread
waiting for the workers to return (because they hold a reference
to the Map thread main loop).

Maybe the only way to solve this would be having a I/O thread for
dispatching messages.

The Request is not bound anymore to the invoker thread because the workers
will request for glyphs, but the reply will arrive at the Map thread.
2015-05-05 18:35:40 +03:00
Thiago Marcos P. Santos
071e2e1731 Do not process buckets depending on Glyphs that were not loaded
For now, the buckets depending on Glyphs that are not yet available
are simply not created (or created and discarded). In the future
we could refactor the code to not create the bucket at all or put
the bucket in a suspended state until the glyph range is available.
2015-05-05 18:35:40 +03:00
Thiago Marcos P. Santos
f10839bac2 Make GlyphStore observable
GlyphStore will notify observers when a glyph range is loaded. By now
the notification is generic, but could be fine grained, causing the
processing of buckets depending on this particular range.
2015-05-05 18:35:40 +03:00
Thiago Marcos P. Santos
1455e5e53c Add partial tile parsing
This change will add a new state to the tile called "partial" which
is a state where the tile can be rendered but some information might
be missing.

For now we skip the SymbolBucket if the Sprites are not loaded (will
also do the same for the glyphs in the future). When the Sprites are
finally loaded, we trigger another update, this time the Tile will
get completely re-rendered and change the state to "parsed".
2015-05-05 18:35:40 +03:00
Thiago Marcos P. Santos
c487c521b4 Move the Sprite handling to ResourceLoader
This is the first concrete step to remove promises from the parsing
pipeline. Buckets depending on the Sprite (i.e. SymbolBucket) won't
be created if the Sprite is not loaded yet. When the Sprite finally gets
loaded, it will fire a signal that will ultimately trigger a reparse.

We still have to expose the Sprite to the Map object as it is needed
for getting offset pixels for annotation symbols, but we can probably
improve that.
2015-05-05 18:10:21 +03:00
Thiago Marcos P. Santos
d726613f6f Update the tiles via ResourceLoader 2015-05-05 18:10:21 +03:00
Thiago Marcos P. Santos
f4baa0ba3e Notify data changes using Observer pattern
This pattern, in contrast with callbacks, allows us to clearly see
the dependency and hierarchy between the objects. It will also help
on writing unit tests as we can count how many times a notification
was triggered.
2015-05-05 18:10:20 +03:00
Thiago Marcos P. Santos
4956da61b9 Introduce the ResourceLoader
ResourceLoader will handle all the tile changes and notifications
through the Source object owned by the Style. This object lives
entirely on the Map thread and should be only accessed by it.

The observer will receive notifications every time the tile data changes
and this will probably trigger a new rendering operation.

This first patch will delegate Source loading to the ResourceLoader.
2015-05-05 18:04:54 +03:00
Konstantin Käfer
5aa0caf5c5 don't trigger cleanups when we're not rendering 2015-05-05 11:53:23 +02:00
Konstantin Käfer
691c305467 add Map::isFullyLoaded()
returns whether the Map is still loading/parsing any assets or whether everything is there and a render will likely be complete
2015-05-05 11:47:23 +02:00
Konstantin Käfer
4cf3d4ef9f show failed glyph URL 2015-05-05 11:47:22 +02:00
Konstantin Käfer
63bb10a06b apply the framebuffer size before calling updateMatrices() 2015-05-05 11:16:02 +02:00
John Firebaugh
00a1f44cfc Ensure no GL commands are executed after pause 2015-05-04 18:27:48 -07:00
John Firebaugh
5c7867f435 Join worker tasks before destroying TileData
Fixes #1309
2015-05-04 15:09:19 -07:00
John Firebaugh
2b0892aaaa Build with gcc 4.9 2015-05-04 11:59:39 -07:00
Konstantin Käfer
27d8e82e1c lower thread priority of worker threads 2015-05-04 17:33:05 +02:00
Konstantin Käfer
7390062c45 check for errors 2015-05-04 17:33:05 +02:00
Konstantin Käfer
99ad8a4036 fix needsUpload() 2015-05-04 17:33:05 +02:00
Konstantin Käfer
78073d6fdd don't reallocate the Glyph atlas too often
- previously, we reallocated the glyph atlas on every upload. Instead, we're now using glTexSubImage2D to reuse the existing buffer
- we're no longer forcing a texture upload when we remove glyphs; they won't be rendered anyway
- we're now only doing a texture upload once per frame; previously, worker threads that added glyphs mid-render could trigger a texture upload while rendering is in progress
2015-05-04 17:33:05 +02:00
Konstantin Käfer
72964f5bef only update GL state when it actually changed 2015-05-04 17:33:05 +02:00
Konstantin Käfer
914b6f01f8 add gl::groups back for easier debugging in Xcode 2015-05-04 17:33:05 +02:00
Konstantin Käfer
f89f7f1bc2 rename prepare => upload and determine passes per layer instead of per bucket 2015-05-04 17:33:05 +02:00