Commit Graph

2256 Commits

Author SHA1 Message Date
Konstantin Käfer
2435c1ad26 use array of structs rather than parallel arrays for annotations 2015-06-11 17:26:37 -04:00
Ansis Brammanis
cfee5aa8ef fix text-letter-spacing render test by using float 2015-06-09 11:07:17 -04:00
Konstantin Käfer
f85889dc75 allow constructing LatLng/LatLngBounds objects from TileIDs 2015-06-08 16:13:37 -04:00
Thiago Marcos P. Santos
967fc73c15 Add documentation for TileData::State 2015-06-05 17:47:57 +03:00
John Firebaugh
a0503f3f5b Remove unused overscaling variables 2015-06-04 14:09:05 -07:00
Thiago Marcos P. Santos
b09df7acb5 Cleanup the MapContext before the util::Thread destructor
The util::Thread will call the stop() method of the MapContext's RunLoop
which will wait for the pending tasks tied to it to complete.

If we have a request that is timeout'ing, this could mean a really long
wait. Instead, we now send a cleanup message that will reset all the
attributes first (canceling the pending requests) so the the MapContext
gets destructed quickly.
2015-06-04 14:44:34 +03:00
Thiago Marcos P. Santos
29b8b44b77 Fix race condition on error notification
We start loading the resources at the moment we set the style, but we
set the callback for error notification at renderStill(), which happen
afterwards.

If some error occurs in this short window, it was never being notified.
Now we save the last error and we check after we set the callback.
2015-06-04 14:44:34 +03:00
Ansis Brammanis
9c03b396c0 Merge remote-tracking branch 'origin/master' into HEAD
Conflicts:
	src/mbgl/renderer/painter_fill.cpp
2015-06-03 19:20:41 -04:00
Ansis Brammanis
2bd7e45502 fix collision box clipping
and name parameters when it's not clear from their type
2015-06-03 19:17:49 -04: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
Thiago Marcos P. Santos
68989e671c Remove references to ResourceLoader
ResourceLoader got merged with Style.
2015-06-02 20:23:03 +03:00
Ansis Brammanis
3dfa317cf9 fix android compile errors
- explicitly mark override
- re-add fix from 74604af that was lost in a merge
2015-06-02 11:33:03 -04:00
Ansis Brammanis
4e74867ba9 use source zoom level for tile loading errors 2015-06-02 11:33:03 -04:00
Ansis Brammanis
93fc67ba55 re-add sprite atlas pollution fix
It got missed in a merge.
03d5e2da80
2015-06-02 11:33:03 -04:00
Ansis Brammanis
2ae2cade4a fix assertion. only include glyphs with metrics
fixes bug caught by this assertion:
de3fd89b2c/src/mbgl/text/font_stack.cpp (L124)
2015-06-02 11:33:03 -04:00
Ansis Brammanis
36212ea3c6 sort overlapping symbols in the y direction
fixes #333
fixes #988

-js: 6514de77be2ff3df4267785f42f5e53c63233cac
2015-06-02 11:33:03 -04:00
John Firebaugh
925cc91ef2 Remove unused; fix naming style 2015-06-01 13:22:02 -07:00
John Firebaugh
ec06bb7e3c Merge ResourceLoader into Style and move atlas ownership 2015-06-01 13:22:02 -07:00
Ansis Brammanis
520eddb794 use floats when resampling lines to match -js
This fixes many small render test and collision differences.
2015-05-29 11:51:10 -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
fd19eb7905 fix shaped icon box sizes 2015-05-28 19:17:07 -04:00
Ansis Brammanis
4cd95a97c6 fix clipping lines for labeling 2015-05-28 19:17:07 -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
Thiago Marcos P. Santos
48875d8d6c Notify glyph parsing errors
Emit a signal when the glyphs are not parsed correctly.
2015-05-28 09:33:08 +03:00
Thiago Marcos P. Santos
4819379020 Notify sprite parsing errors
Emit a signal when the JSON or the sprite image was not
parsed correctly.
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
John Firebaugh
87b1da7611 DefaultFileSource has responsibility for handling mapbox:// URLs 2015-05-26 12:14:10 +02:00
Thiago Marcos P. Santos
eaf1c24cdc Do not call abandon texture if there is no texture
Check if the texture was created before abandoning on SpriteAtlas
destructor. Linux driver was fine with that, but was crashing on Mac.
2015-05-22 15:21:39 +03:00
Konstantin Käfer
3cf76ce907 split up glyph_store.cpp into multiple files 2015-05-22 12:30:18 +02:00
Thiago Marcos P. Santos
ee9b172152 Notify failures when loading glyphs 2015-05-22 10:44:18 +03:00
Thiago Marcos P. Santos
ac64bef87f Notify failures when loading tiles 2015-05-22 10:44:18 +03:00
Thiago Marcos P. Santos
7274d2e195 Notify failures when loading the sprite JSON and image 2015-05-22 10:44:18 +03:00
Thiago Marcos P. Santos
90fd06762c Notify failures when loading the source JSON 2015-05-22 10:44:18 +03:00
Thiago Marcos P. Santos
da81211fea Add callback for error notifications on renderStill()
The callback will be called when any of the resources requested
from the network failed to load.

There is not recovery implemented yet, so the closest thing to
reseting the Map object and reloading all the resources would
be setting a new style.
2015-05-22 10:44:18 +03:00
John Firebaugh
b304b20073 Add Thread tests; get argument transfer working for all cases 2015-05-21 19:57:28 -07: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
Minh Nguyễn
b6765a2eb1 Merge pull request #1453 from mapbox/1ec5-whee-2
Prevent full-circle spin during animated rotation
2015-05-19 16:18:26 -07:00
Ansis Brammanis
03d5e2da80 port sprite atlas pollution fix
fixes #1398

js: 212760981493460b438f1cc117001825773fad91
https://github.com/mapbox/mapbox-gl-js/pull/1195

The sprite atlas already had two empty pixels between each each icon.
But the icon's real boundary isn't used for drawing. Drawing uses an
icon's box rounded up to the nearest multiple of four. Sometimes this
rounded boundary was directly on the edge of another icon. When the icon
was sampled with linear interpolation it's edge would get polluted with
values from the other icon.

This commit shifts all icons and glyphs by 1px so that there is padding
on all sides of the box being drawn. The quads used for drawing are
shifted in the opposite direction by 1px to compensate for this.
2015-05-19 10:04:46 -07: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
Konstantin Käfer
bcf66b7449 only return locked FontStack objects 2015-05-19 16:13:36 +02:00
Konstantin Käfer
b0c89e7f44 extend the FontStack lock to returned values 2015-05-19 16:13:36 +02:00
Konstantin Käfer
ab3105aac9 don't mark the glyphs as parsed until we've actually parsed them 2015-05-19 16:13:36 +02:00
John Firebaugh
63ea3d4bef Don't crash if VAO extensions are not available
Fixes #1585
2015-05-18 16:47:20 -07: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
4e7c97466c Allow reparsing partial tiles when we have new tiles
When parsing a tile, we request resources from the network, like
sprites and glyphs.

In the rare case of the resources arriving before the tile is
parsed for the first time, if we don't mark it for being parsed
again, it can end up with a tile eternally stuck in the partial
state.
2015-05-18 10:42:05 +03:00
Thiago Marcos P. Santos
3f445e8578 Do not process partial tiles if no new resources have arrived
Partial tiles are now only processed again when there is a new resource
available. If we don't have new resources - like new glyphs - the end result
of the reparsing is the same, because no new SymbolBuckets would are created.

In my tests debugging with PowerTOP, this patch drops the CPU utilization
during the sampling period from 100ms/s to 40ms/s. The improvements on
slow connections (i.e. more time waiting for resources) are even more
noticeable.
2015-05-18 10:42:05 +03:00
Thiago Marcos P. Santos
41dc5e836a Emit the signal on the MapThread
We were previously emitting the signal on the thread parsing the
glyph, but signals can only be trigger from the MapThread
because the observers are living there.
2015-05-18 10:42:05 +03:00