Commit Graph

2235 Commits

Author SHA1 Message Date
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
15bc11ab23 [core] cancel TileID::overscaling() 2016-03-08 13:34:17 +01:00
Konstantin Käfer
8112ac3371 [core] explicitly initialize a few fields to null 2016-03-04 16:01:41 -08:00
Henry Dooley
cf4dddd1b9 Fixes an issue where rendering without Vertex Array Objects would cause a massive slowdown in the driver on Nvidia hardware. Unconfirmed if the issue is present on other GPUs. 2016-03-04 10:23:09 -08:00
Bruno de Oliveira Abinader
7ced8e97ba [core] Reset pitch in Map::resetPosition 2016-03-03 17:02:15 +02:00
Bruno de Oliveira Abinader
bb434aa9e4 [core] Use TransformState::worldSize() whenever possible 2016-03-03 17:02:15 +02:00
Bruno de Oliveira Abinader
27b798da91 [core] Simplify TransformState::moveLatLng 2016-03-03 17:02:15 +02:00
Bruno de Oliveira Abinader
8944e2c588 [core] Replaced raw values with util::tileSize 2016-03-03 17:02:15 +02:00
Bruno de Oliveira Abinader
877adedb0f [core] Fix style cascade loop when transitioning 2016-03-03 15:47:03 +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
fde0ab98ee [core] Moved TileCoordinate to tile cover scope 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
6e6d91478e [core] Cleared TileCoordinate from Painter 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
b325df880b [core] Simplify Screen to Geometry coordinate conversion 2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
9771b0e569 [core] Use GeometryTileFeature::defaultExtent by default
GeoJSONTile and AnnotationTile don't need to reimplement getExtent() if
they use the same default value. This also helps point and shape
annotations to avoid using raw values.
2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
fcaafcc428 [core] Replace std::array<double, N> usage in SourceInfo 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
1ce99d2d7b [core] Explicit instantiate vec{2,3,4}<double> 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
Bruno de Oliveira Abinader
9955087767 [core] Fix potential precision data loss 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
Konstantin Käfer
f9fd748547 [core] abort searching children when lower bound has different w
When looking for child tiles that cover a parent tile, we're computing the lower bound of the child tile in the set of tiles. Three things can happen:
- all remaining tiles are sorted before the child tile we're looking for. in that case, there can not be a child tile.
- the lower bound is the child tile; in this case, we want to continue checking the other children of the parent tile.
- the lower bound isn't the child tile we're looking for, but there are still tiles sorted after the tile we were looking for. these could be four children of the child tile we're looking for, so we're recursively descending.

what the current algorithm didn't take into account so far is that tiles with a higher w number (i.e. tiles that are outside the "main" tile pyramid of 0/0/0) were always sorted *after* the current w number. this meant that we thought there were still remaining children to be checked, so continued our recursive descent until eventually the number overflowed and we aborted our search. unfortunately, on Android this recursive descent and accompanying overflow caused a crash.

this patch fixes this by making sure that before we're continuing to descent, we're sure that the w numbers match: all tiles with a different (= higher) w number essentially mean the same as "all remaining tiles are sorted before the child tile we're looking for" for the purpose of finding covering children
2016-02-25 15:24:45 +01:00
John Firebaugh
96cd22efa0 [core] Set initial offline tile count limit to 768 2016-02-24 13:38:14 -08:00
John Firebaugh
065cda83fa [core] Limit total number of offline Mapbox tiles 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
Konstantin Käfer
9557cd8d93 [core] use a store enum instead of RTTI
RTTI is pretty slow, in particular in iOS devices
2016-02-24 15:58:56 +01:00
Konstantin Käfer
f4bf961622 [core] fix uninitialized member variable 2016-02-24 15:57:54 +01:00
John Firebaugh
9c26f06318 [core] Thread GLObjectStore through to Holder objects
This eliminates the reliance on ThreadContext to provide GLObjectStore, and statically enforces that GL cleanup functions happen only when GLObjectStore::performCleanup is called.

With the elimination of the Map thread, this becomes important because there may be multiple GLObjectStore's per-thread, and Map will need to ensure that the correct context is active when calling GLObjectStore::performCleanup.
2016-02-18 15:15:24 -08:00
John Firebaugh
7b39ce9521 [core] Remove ThreadContext::getFileSource; instead thread FileSource through 2016-02-18 15:15:24 -08:00
Bruno de Oliveira Abinader
3762dcfb82 [gl] Refactor texture pool cleanup
Texture pool now allocates a block of 64 textures per time. Each block
contains a TextureObject which handles GL object lifetime. Blocks can be
added or removed according to the following rules:

1. If pool is empty, created a new block upon first call (lazy load);
2. Iterate blocks to find an available texture ID:
- If found, remove that from the list of available IDs for that block
  and return its ID.
- Othewise, allocate a new block and grab an available ID from that.
3. When releasing a texture ID, check if the associated block is free.
If no IDs are currently in use, then abandon its TextureObject and
remove the block from the pool.
2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
93cfca4d4e [gl] Added mbgl::gl::VAOHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
124173080f [gl] Added mbgl::gl::Texture{,Pool}Holder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
3397398c1f [gl] Added mbgl::gl::BufferHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
a503233d1c [gl] Added mbgl::gl::ShaderHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
69fa8fe3c0 [gl] Added mbgl::gl::ProgramHolder 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
bfafc360a7 [gl] Moved TexturePool to gl namespace 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
1336e3e30f [gl] Moved GLObjectStore to gl namespace 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
47d6099242 [gl] Use Buffer::getID() whenever possible 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
0386dc7a4e [gl] Use Shader::getID() whenever possible 2016-02-18 13:27:35 +02:00
Bruno de Oliveira Abinader
ee72e93f94 [gl] Moved VAO helpers to common header 2016-02-18 13:27:35 +02: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
Ansis Brammanis
cdab06306f [core] round points created by clipLines instead of truncating them 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
c2ab5b34a7 [tests] Fix build 2016-02-11 18:01:53 -08:00
John Firebaugh
62bbf2627a [core] Organize files that were in map folder better
Fixes #996
2016-02-11 17:30:35 -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