Commit Graph

440 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
a2a6e22bdd [glfw] Workaround for OS X (#4666) 2016-04-15 12:18:16 -07:00
John Firebaugh
6e78eabfff [core] Clean up ThreadContext vestiges 2016-04-15 09:56:18 -07:00
John Firebaugh
3af3e72bb3 [all] Replace HTTPContextBase/HTTPRequestBase with FileSource 2016-04-14 14:18:19 -07:00
John Firebaugh
6d88a23a60 [core] Remove internal threading from OnlineFileRequest
There's no need to do the work that OnlineFileRequest does on a separate thread from the DefaultFileSource thread, and having AsyncTasks proxy to other tasks across a thread boundary adds needless complexity.
2016-04-14 14:18:19 -07:00
John Firebaugh
204c7fee03 [core] Render from the main thread
Do not create a thread for the MapContext anymore.
2016-04-14 13:44:08 -07:00
John Firebaugh
18d8e80f52 [core] Demote "Unable to make space for entry" message from Warning to Debug (#4708) 2016-04-14 13:43:24 -07:00
John Firebaugh
db9fb97ea8 [test] Fix use of uninitialized dimensions value (#4697)
Instead of calling resize, which would compare against the uninitialized dimensions values, initialize dimensions and needsResize directly.
2016-04-13 18:00:46 -07:00
John Firebaugh
c3bed1dab8 [core] Fix race condition that could lead to a UNIQUE constraint failure (#4677) 2016-04-11 19:46:45 -07:00
Konstantin Käfer
65acf35dcf [core] fix various compilation issues 2016-04-04 16:20:04 -07:00
John Firebaugh
08c9406ed4 [node] Run rendering tests on Bitrise OS X 2016-04-01 09:26:10 -07:00
Bruno de Oliveira Abinader
01a0f5464d [glfw] Fix random point generation 2016-04-01 10:21:59 +03:00
John Firebaugh
77b0723476 [ios, osx, linux] Remove unused "applicationRoot" function 2016-03-31 17:08:00 -07:00
John Firebaugh
5eda74a514 Merge branch 'release-ios-3.2.0-android-4.0.0' 2016-03-30 17:43:37 -07:00
John Firebaugh
13882a31e4 [core] Set schema version to 3 after upgrading
The migration was upgrading the schema, but not the schema version. As a result, the (expensive) migration was running every time an OfflineDatabase was constructed with a v2 database.

Fixes #4501
2016-03-28 17:28:44 -07:00
John Firebaugh
169755e89a [core] Unify FileRequest and WorkRequest 2016-03-24 10:54:32 -07:00
Konstantin Käfer
61920071cd [core] split headless_view.cpp into implementation-specific files
also adds a EAGL implementation for iOS
2016-03-22 11:56:01 -07:00
Thiago Marcos P. Santos
baf30cd1f7 [glfw] Main loop integration
This new code can be used for rendering on the Main thread
while it will also work for rendering on the Map thread
before we make the switch. Needed by #2909.
2016-03-21 23:58:48 -03:00
John Firebaugh
967b6c7248 [core] Stop any OfflineDownload before deleting a region
No progress events should be processed after deleting a region.
2016-03-21 12:41:17 -07:00
John Firebaugh
90d271709f [core] Add additional logging for exceptions during database connection / creation
Refs #4382
2016-03-18 17:09:43 -07:00
Thiago Marcos P. Santos
115a5d10f9 [core] Fix regression of prior expiration time not being respected 2016-03-18 00:10:50 -03:00
Thiago Marcos P. Santos
0c3247bf3c [core] Fix regression of prior expiration time not being respected 2016-03-17 23:57:28 -03:00
Bruno de Oliveira Abinader
4909169996 [core] Added user-defined transition properties when modifying classes 2016-03-18 01:26:22 +02:00
Jesse Bounds
bcb3bb0931 [core] Stop download when tile limit is reached
The tile limit guard (when used) stops a download from continuing
when the tile limit is reached. This wraps the guard in a method
and employs it in both places currently necessary to ensure the
guard has a chance to function. Tests have been updated to
ensure the fix works for a less trivial tile limit scenario.
2016-03-17 15:52:18 -07:00
John Firebaugh
5130ca8843 [core] Implement a vacuum strategy for the offline database
Enable `PRAGMA auto_vacuum = INCREMENTAL`, and perform a `PRAGMA incremental_vacuum` when deleting an offline region.
2016-03-17 14:17:59 -07:00
Bruno de Oliveira Abinader
7a509b0369 [linux] Added world tour to GLFW test app 2016-03-14 11:51:37 +02:00
Bruno de Oliveira Abinader
8e30a4a080 [core] Harden Transform anchor & padding usage
Use optional values for anchor & padding in Map and Transform functions
instead of NaNs. Added unit tests to stress some edge cases.
2016-03-13 21:38:20 +02:00
Minh Nguyễn
4748973c04 [core] Deactivate offline region upon completion 2016-03-11 11:43:32 -08:00
John Firebaugh
7cceca4b45 [core] Deactivate OfflineDownload when the tile count limit is hit
This is a better behavior than sending hundreds or thousands of tileCountLimitExceeded notifications.
2016-03-09 13:40:00 -08:00
John Firebaugh
e49c1e3da3 [core] Fix offline status reporting regressions
The core of the change is ensuring that ensureResource doesn't release Zalgo: it should be consistently async, rather than async in the case that the resource doesn't exist in the database, but sync if it does.

This ensures that status is reported in a more consistent sequence, regardless of the database state.
2016-03-08 10:28:33 -08:00
John Firebaugh
8fee0f33c0 [core] Fix RunLoop::run() behavior when called a second time 2016-03-08 10:28:01 -08:00
Thiago Marcos P. Santos
672727f773 [core] Make OnlineFileSource respect the NetworkStatus
The user can now force the Offline mode and set it back
to Online, triggering the requests waiting for network connection.
2016-03-08 10:31:01 -03:00
Thiago Marcos P. Santos
b8b283588f [core] Remove goOffline() from DefaultFileSource
Use the newly added NetworkStatus::Set().
2016-03-08 10:31:01 -03:00
John Firebaugh
a3791b2325 [core] Ensure OfflineRegionStatus::downloadState is accurately reported 2016-03-07 19:08:03 -08:00
John Firebaugh
eb9b463841 [core] Fix offline status reporting with pre-existing tiles (#4147) 2016-03-04 15:15:09 -08:00
Bruno de Oliveira Abinader
4994b3dc57 [core] PrecisionPoint is now ScreenCoordinate 2016-03-01 20:58:54 +00:00
Thiago Marcos P. Santos
f683b10e10 [core] Build fix
Fix no viable conversion on OSX.
2016-02-26 04:21:28 +02:00
Thiago Marcos P. Santos
59a45b8400 [core] Add timeout for clock skew
If the server keeps sending replies considered from the client in the
past (there is no way to tell if the server or client clock is wrong),
the client will try to interpolate a valid expiration time based
on the delta of the expiration intervals sent by the server.

If the intervals are always the same, exponential backoff kicks in
until we get a different expiration time from what we already have.
2016-02-26 03:52:02 +02:00
Thiago Marcos P. Santos
843cad04fb [core] Add retry delay on expired tiles
When we receive an expired tile, we don't immediately retry
because in case the server keeps serving an expired tile, that
would cause an infinite retry cycle.

Now we add an exponential delay, similarly to what we do for
connection errors.
2016-02-26 03:20:51 +02:00
John Firebaugh
065cda83fa [core] Limit total number of offline Mapbox tiles 2016-02-24 13:38:14 -08:00
John Firebaugh
5cefaeb857 [core] Enforce foreign key constraints in the offline database 2016-02-24 13:38:14 -08:00
John Firebaugh
1bdeddab2c [core] Fix subtle bug in OfflineDatabase with updated resources
SQLite REPLACE is *not* UPSERT. If a conflict occurs, it first deletes the existing row, then inserts a new row. This means that AUTOINCREMENT primary keys change. This will break foreign keys to that value, which we use.

Instead we must try an UPDATE, and fall back to an INSERT if the UPDATE changes zero rows.
2016-02-24 13:38:14 -08:00
John Firebaugh
65c06e6270 [core] status.requiredResourceCountIsIndeterminate ⇢ status.requiredResourceCountIsPrecise
Change the name and reverse the sense. Naming things in the positive is better than naming them in the negative.
2016-02-24 13:38:14 -08:00
Thiago Marcos P. Santos
931ac77af4 Revert "[core] libuv unref() not really needed"
This reverts commit 8a53c1a881.
2016-02-24 14:31:11 +02:00
Thiago Marcos P. Santos
8a53c1a881 [core] libuv unref() not really needed
The run loop will be kept alive because it has an `AsyncTask`. We
also can simple stop the loop with `uv_stop()`.

The `RunLoop` is still gonna be the last object to be destroyed
because it is the first object to be created in the thread, so
by design it won't outlive `Timer`s and `AsyncTask`s.

This patch won't change the current behavior, will just make
the code simpler.
2016-02-20 13:33:13 +02:00
Bruno de Oliveira Abinader
dcbdfde932 [core] Use RVO in PremultipliedImage::decodeJPEG 2016-02-18 13:27:35 +02:00
Thiago Marcos P. Santos
1efc299e66 [core] Faster access with unordered_set
The ordering won't be affected because requests are made
as they arrive and later stored on the map just for
keeping state.
2016-02-16 23:06:04 +02:00
Thiago Marcos P. Santos
f5b521ffb5 [core] Remove requests from the pending queue on cancel
If we don't do this, we can activate a request twice.

The issue here is that we use memory address as the 'key'. So if
we destroy a request, another request might take the same memory
address, or the same 'key'.

The entry at 'pendingRequests' survives the 'cancel()' and is
ultimatelly removed at 'activatePendingRequest()'. This is fine
unless a request is created using the same 'key' before we call
'activatePendingRequest()'.

The check if the request was canceled at 'activatePendingRequest()'
will be no longer valid, activating the request. At the same time
the request will be activated again by the task scheduled at the
constructor of the 'OnlineFileRequestImpl' class.
2016-02-16 23:06:04 +02:00
John Firebaugh
d66d145c6e [core] Remove RunLoop::{ref,unref} 2016-02-16 12:48:50 -08:00
John Firebaugh
c2ab5b34a7 [tests] Fix build 2016-02-11 18:01:53 -08:00
Young Hahn
43c44eccdc Allow using tileSize: 512 as a switch to trade retina support for 512px raster tiles 2016-02-11 11:28:35 -08:00