Commit Graph

407 Commits

Author SHA1 Message Date
jakepruitt
14ba3cfd6a Adding special case for non-fontstack "glyph" resource URLs
- does not prepend /v4/ to api endpoints like /fonts/v1/
- only prepends it to things starting with /fontstack
- solves the problem in #1918
- refs mapbox/mapbox-gl-style-spec#309
2015-07-27 10:16:14 -04:00
Thiago Marcos P. Santos
234a653931 Use the observer pattern for GlyphPBF loading
This will make the code a lot more clear and it will
also move how parsing is initiated to the GlyphPBF
class, to be initiated after the request, like we do
for other resources.
2015-07-17 21:00:34 +03:00
Thiago Marcos P. Santos
dd818874cc Remove hacks because of Glyph requests could not be canceled 2015-07-16 19:38:39 +03:00
Thiago Marcos P. Santos
cd2c1200c8 Add GlyphStore unit tests 2015-07-16 19:38:39 +03:00
Thiago Marcos P. Santos
7d4349e308 Added unit tests for the WorkQueue 2015-07-16 19:38:38 +03:00
Bruno de Oliveira Abinader
0ea8a37cb0 Unify default transition values in MapData
Relevant changes:
 - Added 'defaultFadeDuration' and 'defaultTransitionDelay' to MapData;
 - Painter & StyleParser now receives a reference to MapData;
 - As previously seen on the code: 300ms is the default fade duration
   and 0ms is the default transition duration;
 - We no longer pass the current time point to Style, since it now uses
   MapData.animationTime, which gets updated in MapContext::update().
 - Updated StyleParser check to use a mock MapData;
2015-07-14 16:58:32 +03:00
Thiago Marcos P. Santos
06e27f905e Mark overrides
Detected by clang++-3.6
2015-07-11 12:42:45 +03:00
Thiago Marcos P. Santos
30416c5a98 Add unit tests for addPointAnnotations()
This test would have caught #1874
2015-07-10 21:03:47 +03:00
Thiago Marcos P. Santos
0d44402628 Move MockFileSource to fixtures
It is going to be used by another test that needs to emulate
asynchronous requests.
2015-07-10 21:03:23 +03:00
Nicki Dlugash
d63f706c5f Merge pull request #1840 from mapbox/repeat-distance
Updates to labels along lines
2015-07-10 10:59:37 -04:00
Thiago Marcos P. Santos
a666c08274 Add unit tests for the Sprite class 2015-07-10 15:35:26 +03:00
Ansis Brammanis
1f2d439059 update test-suite 2015-07-10 12:52:51 +02:00
Thiago Marcos P. Santos
7fc6d0444c Re-enable Sprite resource loading tests 2015-07-10 10:48:46 +03:00
Thiago Marcos P. Santos
0ee9f21c56 Report Sprite parsing errors to Observers
Parsing errors will be reported to Observers. In practice this will
bubble all the way to the Map object.

This will make possible to identify possible corrupted data instead
of rendering without sprites like we do in case of semantic errors.
2015-07-10 10:48:46 +03:00
Thiago Marcos P. Santos
1fbbedd47b Make FixtureLogObserver thread-safe
We can log for different threads (main, map, workers, etc) so
we need to lock before adding the messages on the list.

This was causing few tests to randomly crash.
2015-07-08 23:48:05 +03:00
Thiago Marcos P. Santos
0014c0bd8d Make MockFileSource behave more like the real one
This will help make some bugs more reproducible on the tests as
things will happen more asynchronously.
2015-07-08 23:48:05 +03:00
Konstantin Käfer
1f4b5e7736 add custom imagery visual test 2015-07-08 19:46:03 +02:00
Konstantin Käfer
c66ec8739b show info message when Sprite does not exist 2015-07-08 19:46:03 +02:00
Konstantin Käfer
493c72b1f4 move crc64() to test fixture 2015-07-08 19:46:03 +02:00
Konstantin Käfer
74b744a656 test SpriteAtlas updates when SpriteStore was updated 2015-07-08 19:46:03 +02:00
Konstantin Käfer
0d4cfd5bd6 test for sprite image that doesn't exist 2015-07-08 19:46:02 +02:00
Konstantin Käfer
d37bd549bc make sure that the SpriteStore object correctly replaces the SpriteImages 2015-07-08 19:46:02 +02:00
Konstantin Käfer
32699333e6 add image to odd pixelRatio atlas 2015-07-08 19:46:02 +02:00
Konstantin Käfer
d08ec53a0e add test for fractional pixel ratios 2015-07-08 19:46:02 +02:00
Konstantin Käfer
a57f3ddceb add basic SpriteAtlas test 2015-07-08 19:46:02 +02:00
Konstantin Käfer
746e4d20ee explicitly name the sprite that couldn't be changed 2015-07-08 19:46:02 +02:00
Konstantin Käfer
b2a3314192 replace Style object immediately
this makes sure that adding custom sprite imagery will add them to the new Style object rather than
the old one in case a user adds new custom sprites immediately after changing a stylesheet
2015-07-08 19:46:01 +02:00
Konstantin Käfer
6271f8e546 mark Image constructor as explicit to avoid accidental implicit argument conversion
when passing a std::string instead of an Image, the parameter gets implicitly and automatically converted (== parsed) to a temporary Image object. Since parsing an Image shouldn't be a frequent operation
2015-07-08 19:46:01 +02:00
Konstantin Käfer
bc41d3cf6d don't restrict pixelRatio in SpriteStore
this is required so that devices that aren't using 1x or 2x (like the iPhone 6 Plus with a pixelRatio of 3x) still show icons, albeit bilinearly scaled to the correct size in the SpriteAtlas
2015-07-08 19:46:01 +02:00
Konstantin Käfer
4f48874ef0 we're no longer throwing exceptions when loading invalid sprite resources 2015-07-08 19:46:01 +02:00
Konstantin Käfer
afaf74e41a use SpriteStore from the SpriteAtlas 2015-07-08 19:46:00 +02:00
Konstantin Käfer
aa2dcf1968 disallow changing an existing Sprite's size 2015-07-08 19:46:00 +02:00
Konstantin Käfer
086e72afe3 use a 64 bit CRC value instead of std::hash 2015-07-08 19:46:00 +02:00
Konstantin Käfer
d880507f84 add missing headers 2015-07-08 19:46:00 +02:00
Konstantin Käfer
33a3388ccd add API for adding multiple sprites at once 2015-07-08 19:46:00 +02:00
Konstantin Käfer
54aaa43b6d add test for trying to add mismatched SpriteImage 2015-07-08 19:46:00 +02:00
Konstantin Käfer
04d57b8ef2 check for presence of Sprite creation warnings 2015-07-08 19:45:59 +02:00
Konstantin Käfer
a96a8fef76 add a separate SpriteParser object
transforms a JSON and an associated PNG file into individual SpriteImage objects that can be inserted into a SpriteStore
2015-07-08 19:45:59 +02:00
Konstantin Käfer
a68b47b969 ratio => pixelRatio 2015-07-08 19:45:59 +02:00
Konstantin Käfer
9991f9da54 add RAII-style FixtureLog 2015-07-08 19:45:59 +02:00
Konstantin Käfer
7f705da564 Sprite store API 2015-07-08 19:45:59 +02:00
Konstantin Käfer
675ddddee7 Make pixelRatio constant across a Map object lifetime
also moves framebuffer size out of TransformState into its own object
2015-07-08 10:40:05 +02:00
Konstantin Käfer
3ea640e6e3 run the Assert.Always test first by reordering the symbols 2015-07-06 16:44:48 +02:00
Thiago Marcos P. Santos
ec1b4c43fd Do not force uv_loop_t as the first parameter for a threaded object ctor 2015-07-06 16:01:59 +03:00
Thiago Marcos P. Santos
f74bc9d8ce Update the unit tests to check for raster tiles failures 2015-07-02 23:21:42 +03:00
Thiago Marcos P. Santos
e4cc06b798 Add test fixtures for testing raster tiles
Add a raster source for the style we use for testing that will
force requests for raster tiles.
2015-07-02 23:21:42 +03:00
John Firebaugh
e466348dea Remove unnecessary use of optional 2015-07-01 17:12:21 -07:00
John Firebaugh
fc64e97bce Simplify RunLoop
Instead of transforming between return value and callback, pass
the wrapped callback on to the invoked function as the last argument.

This eliminates the need for multiple invokeWithArgument overloads
and permits invoked functions to be asynchronous.
2015-07-01 16:12:12 -07:00
Thiago Marcos P. Santos
d30fce5f7d Catch exceptions when parsing tile PBFs
Also improved the error message and updated the test case.
2015-07-01 15:21:10 -07:00
John Firebaugh
3670a78569 Convert Worker tests to Thread tests 2015-07-01 15:21:10 -07:00