Commit Graph

34 Commits

Author SHA1 Message Date
John Firebaugh
ee46378583 Reduce number of arguments in Source::update pathway 2015-07-01 15:21:08 -07:00
John Firebaugh
4eff674c1d Revert "Do not hold a reference to the Style at the [Live|Vector]TileData"
This reverts commit 044454417b.
2015-07-01 15:21:08 -07:00
Thiago Marcos P. Santos
044454417b Do not hold a reference to the Style at the [Live|Vector]TileData
Layers are added and removed dynamically on the Map thread when we use shape
annotations and we are iterating style.layers on the Worker thread without
any lock.

Now when we create a [Live|Vector]TileData at the Map thread we give it
a layers list (instead of the Style) and [Live|Vector]TileData will ultimately
make a copy of this list (on the Map thread, so no concurrency with
adding shape annotations).

The copy should be relatively cheap because we are using a shared pointer
for storing the layers on the list.
2015-06-18 13:39:18 +03:00
John Firebaugh
a0503f3f5b Remove unused overscaling variables 2015-06-04 14:09:05 -07:00
Ansis Brammanis
1f5fb1db4a fix hangs caused by redoPlacement
After parsing a tile, it redoes placement for that tile if the angle has
changed since it started parsing. These redo calls were accidentally
done from the worker thread. Assigning the new work to `workRequest`
caused it to cancel itself.

Fix the problem by calling redoPlacement from the map thread.
2015-06-02 17:06:24 -04:00
Ansis Brammanis
4e74867ba9 use source zoom level for tile loading errors 2015-06-02 11:33:03 -04:00
Ansis Brammanis
ff6a5ce5bc Merge remote-tracking branch 'origin/master' into new-labelling
Conflicts:
	src/mbgl/map/source.cpp
	src/mbgl/map/source.hpp
	src/mbgl/map/tile_data.cpp
	src/mbgl/map/tile_parser.cpp
	src/mbgl/map/vector_tile_data.cpp
	src/mbgl/renderer/painter.cpp
	src/mbgl/renderer/symbol_bucket.cpp
	src/mbgl/text/glyph.hpp
	src/mbgl/text/glyph_store.cpp
	src/mbgl/text/placement.cpp
	test/suite
2015-05-28 20:01:15 -04:00
Ansis Brammanis
1e044a175c Reparse tiles when zoom level > source maxzoom
so that layout property functions are applied correctly
and so that label placement is redone

js:
https://github.com/mapbox/mapbox-gl-js/pull/1005
and
440bc02505
2015-05-28 19:17:07 -04:00
Ansis Brammanis
8962442b1b make collision debug boxes toggleable 2015-05-28 19:17:07 -04:00
Thiago Marcos P. Santos
f8cc50683a Notify tile parsing errors
The tile parsing is done in a worker thread and if it fails,
we set the tile state to "obsolete" and set an error message.

When the completion callback is fired, we check for the error
message and if it is set, we emit the error signal.

The trick here is the signal cannot be emitted directly from
the worker thread because that would violate data ownership rules.
2015-05-28 09:33:08 +03:00
Konstantin Käfer
f4707f72e0 Replace mbgl::util::make_unique<> with std::make_unique<> 2015-05-26 17:57:38 +02:00
Ansis Brammanis
0bd39ae44a place symbols with correct angle on initial load 2015-05-20 19:18:53 -04:00
Ansis Brammanis
d41bfa2679 redo placement when map rotates 2015-05-20 17:52:00 -04:00
Ansis Brammanis
7abd7950c9 Merge branch 'master' into new-labelling
Conflicts:
	src/mbgl/map/tile_parser.cpp
	src/mbgl/map/tile_parser.hpp
	src/mbgl/renderer/painter.hpp
	src/mbgl/renderer/painter_symbol.cpp
	src/mbgl/renderer/symbol_bucket.cpp
	src/mbgl/renderer/symbol_bucket.hpp
	src/mbgl/text/collision.cpp
	src/mbgl/text/collision.hpp
	src/mbgl/text/placement.cpp
2015-05-19 11:09:33 -04:00
Thiago Marcos P. Santos
aaaf1e4c14 Only emit tile updated signals when the tile really changes
We only emit signals when the number of buckets increase (i.e. the
new data that arrived added a new bucket to the tile).

Also, if we try to reparse a partial tile but it is not possible, we
keep the flag up for trying to reparse it again on the next update,
because the data might have arrived after the bucket that is waiting
for the data was processed but before the end of the parsing.

Fixes #1458
2015-05-18 10:42:05 +03: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
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
John Firebaugh
5c7867f435 Join worker tasks before destroying TileData
Fixes #1309
2015-05-04 15:09:19 -07:00
Konstantin Käfer
839b19330e remove hasData() from Bucket interface 2015-05-04 17:33:04 +02:00
Konstantin Käfer
5f496d8f0c build render order array once instead of recursing through lots of different objects 2015-05-04 17:33:04 +02:00
John Firebaugh
cdb466e7f7 Convert Style to unique_ptr and pass by reference
Fixes #1277
Fixes #1309
2015-04-28 14:32:26 -04: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
e72ee04482 Move SourceInfo into source.hpp/cpp 2015-04-06 10:30:01 -07: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
Justin R. Miller
e049ce6df1 refs #893 #992: point annotations API 2015-03-17 17:30:24 -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
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
0151fe6c01 pass StyleLayer objects as const ref instead of a shared pointer 2015-03-06 13:26:11 +01:00
Konstantin Käfer
c07fa06994 rename StyleBucket* => StyleLayout*
and remove a few unused variables

refs #881
2015-02-17 18:27:51 -08:00
Konstantin Käfer
31a0d18ca1 remove circular shared_ptr and a few other memory leaks 2015-02-04 10:49:05 +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
Konstantin Käfer
abafb52f37 make most headers private 2014-12-04 20:02:50 +01:00