Commit Graph

262 Commits

Author SHA1 Message Date
Minh Nguyễn
f9c544a9ea Reset map view frame on every test
To counteract the call to `-insetMapView` in `-testInsetMapView`.
2015-04-24 14:27:25 -07:00
Minh Nguyễn
1dc2cbc280 Test inset MGLMapView
Verify that the ornaments hug the `MGLMapView` when it’s smaller than the view controller’s root view.
2015-04-24 13:30:50 -07:00
Konstantin Käfer
0d5568f724 merge build targets so we only have one build file per platform
previously, we used multiple different projects for various targets (app, test, render) that overwrote each other, so it was impossible to have one project to build them all, one project to compile them, one project to run them all and in the darkness bind them
2015-04-24 11:50:50 +02:00
Justin R. Miller
b528d7cc03 fixes #830, #880: bring back iOS functional tests 2015-04-23 17:54:08 -07:00
John Firebaugh
55118e5bd7 Revert "build on trusty"
This reverts commit decc493ec8.

Conflicts:
	.mason
2015-04-22 14:07:05 -07:00
John Firebaugh
75af3db17d Use a promise rather than async dance 2015-04-20 17:01:27 -07:00
Konstantin Käfer
decc493ec8 build on trusty 2015-04-20 13:26:02 +02:00
Konstantin Käfer
71d127220b rename Mode::Static => Mode::Still 2015-04-17 17:55:24 +02:00
Konstantin Käfer
5d769f9b62 explicitly call .discard() to resize the view on static renders
- this is only a stopgap; we need to properly pass state between threads
- doesn't fix changing the pixel ratio
2015-04-17 13:40:42 +02:00
Konstantin Käfer
9af3f07e5b don't hide unchecked messages 2015-04-17 13:40:42 +02:00
Konstantin Käfer
1c920c4332 don't throw an exception in the map thread for bad styles 2015-04-17 13:40:42 +02:00
Konstantin Käfer
46bf226910 align static render mode and still image render mode
- static rendering now also runs in a separate thread; you have to start it with map.start(Map::Mode::Static) and join the thread with map.stop() before destructing the Map object
- map.renderStill() takes a callback with will be invoked on the *map* thread, so you'll have to figure out your own method of dispatching back to the main thread.
2015-04-17 13:40:42 +02:00
John Firebaugh
ac25d32a09 Convert storage tests to RunLoop 2015-04-15 20:38:26 -07:00
Konstantin Käfer
452d12e6e6 make implementation files private headers 2015-04-13 18:28:18 +02:00
Konstantin Käfer
16849a341b hide Thread<> and separate the Implementation object 2015-04-13 17:57:45 +02:00
Konstantin Käfer
4c7132337f convert DefaultFileSource to use util::Thread<> 2015-04-10 22:37:27 +02:00
Konstantin Käfer
bba3d9838a add Thread<T> and RunLoop
Thread<T> is a generic thread management object that starts a thread, creates an object T in that thread and calls its .start() function. When the Thread<T> object is destructed (which must happen in the thread that created it), it'll call the object's .stop() function, and wait for thread termination. The .stop() function must somehow get the thread to terminate. Note that object T's constructor/destructor/start()/stop() must be protected/private, and Thread<T> must be declared as a friend class. All public functions may be called from any thread and are exposed through operator->().

RunLoop encapsulates a libuv runloop and has a facility of dispatching function objects to the thread. It can be used either as a worker thread class by itself, or it can be derived from. This commit converts SQLiteCache to derive from RunLoop and removes the custom code used previously for managing the cache thread.
2015-04-10 15:36:32 +02:00
John Firebaugh
691756d7dd Move ClipID to clip_id.hpp/cpp 2015-04-09 10:58:11 -07:00
Konstantin Käfer
59bd300b43 use sqlite itself to lock the database file rather than those unportable bsd locks 2015-04-08 16:24:10 +02:00
Konstantin Käfer
4b66c490b4 guard against invalid database files 2015-04-08 14:55:47 +02:00
Konstantin Käfer
7d58a41de5 make sqlite storage more resilient to sporadic errors
- catch SQLite exceptions and report them
- failed statements are ignored, we're really just caching here, so if it fails we're handling it gracefully elsewhere
- handle cases where the database file goes away after we opened it
- handle cases where the schema wasn't created after the database file was opened successfully
- add tests
2015-04-07 18:04:23 +02: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
9331acf8e6 Add typedefs for std::chrono::steady_clock types 2015-04-02 12:28:12 +02:00
Konstantin Käfer
220ebf61dd replace iterator variable types with auto 2015-04-01 16:42:42 +02:00
Justin R. Miller
78085458f5 add style URL tests 2015-03-31 13:54:51 -07:00
Konstantin Käfer
382358402a update sprite scaling test case 2015-03-26 10:56:42 +01:00
Ansis Brammanis
14e8b4bb09 support wrapped bilinear scaling
to get rid of seams in repeating patterns.

https://github.com/mapbox/mapbox-gl-styles/issues/50#issuecomment-86159351
2015-03-26 10:45:23 +01:00
Konstantin Käfer
48c55af5c1 fix sprites for pixel ratios that are not 1 and 2
- OpenGL ES 2 doesn't allow NPOT textures with wrap-around
- The Sprite object reported the map's pixelRatio, even though it loaded @2x assets
- Copying icons from the sprite into the atlas now uses bilinear scaling to scale up to the actual size
2015-03-17 12:30:40 +01:00
John Firebaugh
0c985c024b Revert "Move atlas ownership to Style"
This reverts commit bffee07154.
2015-03-13 13:05:32 -07:00
John Firebaugh
bffee07154 Move atlas ownership to Style
This follows gl-js and just makes sense -- whenever the style changes
the atlases should be blown away.

Refs #957
2015-03-13 10:55:47 -07:00
Konstantin Käfer
5e40f72b7c scripts for running linux tests with docker 2015-03-13 12:06:11 +01: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
Thiago Marcos P. Santos
79f3149d9d Update the FixtureLog
Now the FixtureLog is an Log::Observer instead of a backend. The
observer can sniff and filter log messages, that can be used
for fail a test if it emits a warning for example.
2015-03-12 13:28:41 +02:00
John Firebaugh
a5998dc59b Fix conditional in normalizeSourceURL
The existing conditional would always be false, since it
was comparing a url that begins with "mapbox://". In fact
no conditional is necessary; the secure TileJSON resource
should always be requested.
2015-03-06 18:16:58 -08:00
Minh Nguyễn
cd83c48ed3 Insert {ratio} before extension, not inside access token
Fixes #959.
2015-03-06 15:33:14 -08:00
Minh Nguyễn
8804c47d27 Only add {ratio} to raster tile URLs
Thanks to @mb12 for the suggestion.
2015-03-06 13:51:20 -08:00
Minh Nguyễn
a3d76dad10 Ported util::mapbox tests from mapbox-gl-js
Left out several tests that were redundant because mapbox.cpp only looks at the passed in access token.
2015-03-06 13:51:19 -08: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
fb44fc81bd make Map::resize() private
they can only be called by View::resize
2015-03-06 13:52:25 +01:00
Konstantin Käfer
18263436e9 add missing test fixture file 2015-02-17 11:42:55 -08:00
Konstantin Käfer
b29bce0936 add ca bundle loading back to CURL 2015-02-17 11:42:47 -08:00
Konstantin Käfer
fe0baffe0d update uv_zip and add tests 2015-02-16 18:30:19 -08:00
Justin R. Miller
6e41664cb0 fixes #476 & #853: pixel/meter/latlng conversion routines in core & iOS 2015-02-16 09:52:36 -08:00
Leith Bade
b693d01bc8 Merge pull request #884 from mapbox/move-buckets
Move to mapbox bucket
2015-02-14 23:27:10 -08:00
Leith Bade
68e5d0dc48 Move to mapbox bucket 2015-02-13 23:07:45 -08:00
Konstantin Käfer
aecef6da1a make sure that the async handle always gets closed 2015-02-13 13:28:40 -08:00
Ansis Brammanis
919ac60983 update test suite 2015-02-11 16:27:13 -08:00
John Firebaugh
ad481f6f12 Merge pull request #821 from mapbox/pattern-functions
functions for everything
2015-02-10 14:41:44 -08:00
Justin R. Miller
d4d4cd4415 move iOS code from gl-cocoa to this project 2015-02-09 18:01:40 -08:00
John Firebaugh
8f4a245c40 Update test suite and style submodules to latest v7 2015-02-06 14:53:48 -08:00