Commit Graph

1466 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
74a1d3c164 [android] Introduce RunLoop based on Looper
Also implement a Timer and AsyncTask based on Android's Looper.
2016-04-06 04:52:51 -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
7b5a1ca167 [core] Localize and simplify state for MapChangeDidFinishLoadingMap event
Only Map needs to track this state, and it can simply be set when beginning to load a style and reset when finished.
2016-03-30 13:53:31 -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
Konstantin Käfer
1dd81d9776 [test] remove crc64 and compare images
boost's crc64 breaks on 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
Bruno de Oliveira Abinader
c6ba05bbc3 [core] Default fade duration is now a constant 2016-03-18 01:27:47 +02:00
Bruno de Oliveira Abinader
8f96dea822 [core] Remove default transition duration 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
f736e46ca4 [core] s/Update::Zoom/Update/RecalculateStyle/ 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
4909169996 [core] Added user-defined transition properties when modifying classes 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
94de5d7f4a [core] Remove MapData::defaultTransitionDelay 2016-03-18 01:26:22 +02:00
Bruno de Oliveira Abinader
ac70ada2d3 [core] Check for NaNs in mbgl::util::{min,max,clamp} 2016-03-18 00:53:14 +02:00
John Firebaugh
46830f1ea5 [core] Assert and guard against null std::exception_ptr in toString
We don't expect toString to be called with a null std::exception_ptr. But if it is, we'd prefer not to terminate the process in release builds.
2016-03-16 11:04:08 -07:00
Konstantin Käfer
ee651d7832 [core] use constexpr constants 2016-03-16 14:46:59 +01:00
Bruno de Oliveira Abinader
b5bb48edaa [core] Simplify LatLng::unwrapForShortestPath usage
Simplify LatLng::{wrap,unwrapForShortestPath} code, avoiding duplicated
code between Transform::{latLngToScreenCoordinate,easeTo,flyTo}.

Added unit tests for camera usage in Transform to detect cases like e.g.
crossing the antimeridian as a shortest path between two coordinates.

Transform::flyTo precision loss to be handled in #4298.
2016-03-14 11:45:31 +02:00
Bruno de Oliveira Abinader
fe7e208b42 [core] Implement LatLng::null() 2016-03-13 21:38:20 +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
Bruno de Oliveira Abinader
3879bc6a4e [core] Make vec{2,3,4} operator bool explicit 2016-03-11 02:24:09 +02:00
Bruno de Oliveira Abinader
b33b2f1515 [core] Check for NaNs in EdgeInsets 2016-03-10 03:36:46 +02:00
Bruno de Oliveira Abinader
d300f341bc [core] Remove _validPoint from Transform code
vec2<T>::operator bool() checks for NaNs already.
2016-03-10 03:36:46 +02:00
Bruno de Oliveira Abinader
026b6d4c01 [core] Coordinate wrapping fixes
- Make returning LatLngs unwrapped by default.
- PointAnnotation and ShapeAnnotation are always wrapped so they can be
  selected via intersection from the visible tile boundaries.
- Fixes LatLng::wrap() calculation.
- Fixes LatLng::unwrapForShortestPath() calculation.

The new unwrapForShortestPath algorithm unwraps the start coordinate
either forwards or backwards depending on the end coordinate value, so
we can always cross the antimeridian when needed and still obtain a
wrapped end coordinate in the end.

Fixes #4214.
2016-03-10 03:36:45 +02: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
Thiago Marcos P. Santos
fa7c40c37f [core] Add client defined network status
This API will let the client force a network status. If set
to Offline, we won't make network requests.

When set make to Online, it will trigger the pending requests
and try to fetch tiles from the network.
2016-03-08 10:31:01 -03:00
Konstantin Käfer
8112ac3371 [core] explicitly initialize a few fields to null 2016-03-04 16:01:41 -08:00
Bruno de Oliveira Abinader
fd123de8ad [core] Regression fix in LatLng::unwrapForShortestPath
When porting this from Transform::unwrapLatLng, I forgot to check for
the second alternative.

Fixes #4174.
2016-03-03 00:38:21 +02:00
Bruno de Oliveira Abinader
9346a6d038 [core] Avoid precompute overscaling for TileID
Plus type change for zoom and removed redundant inlines.
2016-03-01 21:39:36 +00:00
Bruno de Oliveira Abinader
c6757b9a9b [core] Added DEGREES_MAX as constant value 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
abe3f9ce7a [core] Moved wrapping to LatLng scope
Fixes a precision loss when converting unwrapped LatLngs.
2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
4994b3dc57 [core] PrecisionPoint is now ScreenCoordinate 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
1d984d2bb2 [core] Get rid of mbgl/util/vec4 - use vec4 from vec.hpp instead 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
f3fc87261c [core] Coordinate is now GeometryCoordinate
Also introduced GeometryCoordinates (vector of GeometryCoordinate
items), to better cope with GeometryCollection.
2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
411a562061 [core] Enforce constants usage
Use 'LATITUDE_MAX', 'LONGITUDE_MAX', 'DEG2RAD' and 'RAD2DEG' whenever
possible.
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
John Firebaugh
065cda83fa [core] Limit total number of offline Mapbox tiles 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
John Firebaugh
5a6cee0dd0 [core] Add a descriptive comment about maximumCacheSize 2016-02-24 13:38:14 -08:00
Minh Nguyễn
17f44d7bd9 Merge branch 'release-ios-v3.1.0' 2016-02-24 09:06:43 -08:00
Bruno de Oliveira Abinader
ee72e93f94 [gl] Moved VAO helpers to common header 2016-02-18 13:27:35 +02:00
John Firebaugh
d66d145c6e [core] Remove RunLoop::{ref,unref} 2016-02-16 12:48:50 -08:00
Ansis Brammanis
47dc38bf4a [core] less slanted dashed lines near sharp corners
port https://github.com/mapbox/mapbox-gl-js/pull/2043 from -js
2016-02-15 12:55:41 -08:00
Gabriel Miklós
d742c2d3eb [core] Add support for updating point annotations 2016-02-12 16:47:24 -08:00
John Firebaugh
13e2acbc75 [ios, osx] Consolidate remaining files in platform/{ios,osx} 2016-02-12 14:53:52 -08:00
Konstantin Käfer
5726d2b357 [core] use std::move() to prevent copies 2016-02-11 12:17:33 +01:00
John Firebaugh
a9e0c1b99a [core] Eliminate maximumCacheEntrySize
Instead, the eviction policy accounts for the actual size needed for an incoming put.
2016-02-10 15:40:20 -08:00
John Firebaugh
db3620c58f [core] Implement an eviction policy for OfflineDatabase
When inserting an cached resource, or removing a region, remove least-recently used resources and tiles, not used by offline regions, until the used database size, as calculated by multiplying the number of in-use pages by the page size, is less than the maximum cache size minus 5 times the page size.

In addition, OfflineDatabase may be configured to ignore cache puts of individual resources larger than a certain size.

This policy is similar but not identical to the former SQLiteCache policy:

* It accounts for offline, by exempting resources required by offline regions from eviction.
* It must delete from two tables (resources and tiles), rather than one. Currently the strategy is naive: evict 50 rows at a time from each table.
* It makes maximumCacheSize and maximumCacheEntrySize completely independent. The SQLiteCache implementation evicted when `usedSize > maximumCacheSize - 2 * maximumCacheEntrySize`. This evicts when `usedSize > maximumCacheSize - 5 * pageSize`.
* It uses a non-unlimited default value for maximumCacheSize: 50 MB. We should have always had a limit in place; "a cache without an eviction policy is a resource leak".
2016-02-10 15:40:20 -08:00
John Firebaugh
5d42321b73 [core] Make {Default,Online}FileSource::Impl more similar 2016-02-10 15:40:20 -08:00
John Firebaugh
c91b44b02f Add binary for smoke-testing offline downloads 2016-02-10 15:40:20 -08:00