Commit Graph

48 Commits

Author SHA1 Message Date
John Firebaugh
29a2cd908f Introduce TileWorker 2015-07-01 15:21:08 -07:00
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
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
Konstantin Käfer
f4707f72e0 Replace mbgl::util::make_unique<> with std::make_unique<> 2015-05-26 17:57:38 +02:00
Thiago Marcos P. Santos
397bbfe495 Always request the SymbolBucket dependencies at the first pass
When processing a layer, we request the dependencies of all the
SymbolBuckets even if we are not processing it completely.
By doing that we are now requesting glyphs in parallel instead of
sequentially as we were doing before.

This patch is also simplifying the SymbolBucket creation code by getting
rid of the ugly "needsResources" return value passed by reference as
argument.
2015-05-15 10:22:57 +03: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
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
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
Konstantin Käfer
c891df0b5f add upload API to gl 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
0c280adebc Move Worker to Style
This ensures that worker tasks are entirely complete by the
time the style is destructed, and enables us to pass Style&
rather than a shared pointer.
2015-04-28 14:32:26 -04:00
Konstantin Käfer
c88a60b1e5 remove unused includes 2015-04-28 14:32:18 -04:00
Ansis Brammanis
f1edce8e21 remove linejoin shader
The previous commit switched to using triangles for drawing round joins.
2015-04-27 11:44:49 +02:00
John Firebaugh
e72ee04482 Move SourceInfo into source.hpp/cpp 2015-04-06 10:30:01 -07:00
John Firebaugh
1db044d3c0 Remove unused 2015-04-01 11:21:05 -07:00
John Firebaugh
5264982ba7 Eliminate StyleLayerGroup 2015-04-01 11:14:20 -07:00
Konstantin Käfer
220ebf61dd replace iterator variable types with auto 2015-04-01 16:42:42 +02:00
John Firebaugh
3d9b441c8b Eliminate some unnecessary pointer indirection
Buckets had a pointer to the associated layout type, when they can just
have a direct member.
2015-03-31 15:23:40 -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
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
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
John Firebaugh
50b5c15653 Rework GeometryTile* interface 2015-03-09 18:32:08 -07:00
Justin R. Miller
2d8bf823fc unique -> shared ptr 2015-03-09 11:57:34 -07:00
Justin R. Miller
7361f8566b move to shared pointers for queried layers passed to buckets 2015-03-09 11:57:34 -07:00
Justin R. Miller
a45ae199cf move from range-based for loop to iterator for to be clearer 2015-03-09 11:57:34 -07:00
Justin R. Miller
a6b6a8d67e move to abstract interfaces to more be in line with original API 2015-03-09 11:57:34 -07:00
Justin R. Miller
e57703d711 properly iterate geometries 2015-03-09 11:57:33 -07:00
Justin R. Miller
405137700b parse geometry collections from the pbfs; iterate geometries in buckets 2015-03-09 11:57:33 -07:00
Justin R. Miller
0a8a0aee90 move to abstract base classes & shared pointers 2015-03-09 11:57:32 -07:00
Justin R. Miller
41c3b82d3e refs #928: bookmarking working build of refactor 2015-03-09 11:57:31 -07:00
Justin R. Miller
0645300323 move to camelCase & more reference cleanups 2015-03-02 17:31:16 -08:00
Justin R. Miller
4407033b3b clean up members, arguments, and formatting 2015-03-02 17:08:50 -08:00
Minh Nguyễn
6565836a25 Fixed new clang errors in Xcode 6.3b2 2015-02-23 13:50:04 -08: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
89c0ff5f39 make StyleBucket mutable
refs #881
2015-02-17 18:27:51 -08:00
Ansis Brammanis
f99bd1c6ec switch to functions of arrays (from arrays of fns)
for properties like *-translate, *-offset

https://github.com/mapbox/mapbox-gl-style-spec/issues/237
2015-02-05 17:30:34 -08:00
Lauren Budorick
895d90409b Add functions for layout properties. 2015-02-03 16:09:58 -08:00
John Firebaugh
7694b0c1ec Merge pull request #771 from mapbox/visibility
Add visibility property for v7
2015-01-26 11:09:16 -08:00
Lauren Budorick
66355b7d86 Add visibility property for v7. 2015-01-22 17:11:07 -08:00
John Firebaugh
8e23e3a3e8 Remove support for prerendered layers
https://github.com/mapbox/mapbox-gl-style-spec/issues/232
2015-01-21 18:41:17 -08:00
Konstantin Käfer
abafb52f37 make most headers private 2014-12-04 20:02:50 +01:00