Commit Graph

1425 Commits

Author SHA1 Message Date
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
John Firebaugh
c3c4c7b9a6 [core] Interface and implementation for offline 2016-02-10 15:40:20 -08:00
John Firebaugh
e9302c797f [all] Don't interpret 404s on non-tile resources as "no content" 2016-02-10 15:40:20 -08:00
John Firebaugh
7eb1a91c4e [all] Do not set Response data for 404s
For AssetFileSource and the node FileSource this was already the case; this makes the other implementations consistent.
2016-02-10 15:40:20 -08:00
John Firebaugh
cdedb66387 [core] Reimplement existing caching within an offline-capable database schema 2016-02-10 15:40:20 -08:00
John Firebaugh
dbb8e58aea [core] Moving caching logic to DefaultFileSource
This results in OnlineFileSource containing precisely the logic we want for reuse by OfflineFileSource, and no more.
2016-02-10 15:40:20 -08:00
Konstantin Käfer
33b63f0ef6 [glfw] add "C" button to show stencil clip masks 2016-02-10 11:35:17 +01:00
Konstantin Käfer
e74987b07f [core] move GL value objects from gl_config.hpp to gl_values.hpp
Also removes duplicate code from gl_helper.hpp by reusing the GL values that we already have anyway.
2016-02-08 12:50:00 +01:00
Konstantin Käfer
5c3b01ffcf [core] move util/gl_helper.hpp to gl/gl_helper.hpp 2016-02-08 12:50:00 +01:00
Konstantin Käfer
2f06ca74e2 [core] move platform/gl.hpp to gl/gl.hpp 2016-02-08 12:50:00 +01:00
John Firebaugh
4d29c7d5ce [core] Remove Response::Error::Reason::Canceled
There is no such thing as a cancelled response, only cancelled requests. A request that is cancelled does not have its callback called with a Response.
2016-02-04 13:18:14 -08:00
John Firebaugh
bc1f4b1fc0 [core] Comparison operators for LatLngBounds 2016-02-03 18:09:06 -08:00
Brad Leege
87bac32a33 [core] #509 - Creating and using MIN_ZOOM and MAX_ZOOM constants 2016-02-03 18:57:22 -06:00
John Firebaugh
235210c648 [core] Make bool conversions explicit
Implicit bool conversions are bad; they'll be used e.g. for a == b and a != b if those operators are not defined. This was happening at 032c8fba3c/src/mbgl/map/transform.cpp (L132-L132), for example.
2016-02-03 10:02:25 -08:00
John Firebaugh
37c27f3a8f [core] Improve LatLngBounds API
* Use "named constructors": empty, world, hull
* Make the two-argument constructor lenient (i.e., it is a hull operation)
* Add various accessors
* Enforce a single empty representation
2016-02-02 23:04:18 -08:00
John Firebaugh
032c8fba3c [core] Remove unused 2016-02-02 20:20:47 -08:00
John Firebaugh
b78bc7c555 [core] Remove superflous inlines 2016-02-02 18:53:37 -08:00
John Firebaugh
7c00432528 [core] Remove unused 2016-02-02 18:53:37 -08:00
John Firebaugh
82d67d6912 [core] Remove unused 2016-02-02 18:53:37 -08:00
Ansis Brammanis
4e0d1070f6 [core] support tiles with non-4096 extents
Convert all geometries to the maximum extent supported by our buffers
and then use that constant extent everywhere else.
2016-02-02 14:49:03 -08:00
Minh Nguyễn
7694eebe88 [ios] Renamed -showAnnotations:withEdgeInsets:animated:
Renamed -showAnnotations:withEdgeInsets:animated: to -showAnnotations:edgePadding:animated: for consistency with other methods. Reworded documentation comments to avoid hard-coding too many specifics that are prone to getting outdated.
2016-02-01 20:55:55 -08:00
Jordan Moncharmont
909832624e Custom edgeInsets for fitting in showAnnotations
Keeps sensible defaults already in place, but allows callers to override.
2016-02-01 20:55:55 -08:00
John Firebaugh
8aa3359ff0 [core] Don't use struct
It makes forward declarations inconsistent and liable to change, for no real gain.
2016-02-01 16:32:59 -08:00
John Firebaugh
2920020fb8 [core] Change TileData pixelRatio to an integer 2016-01-29 17:16:06 -08:00
John Firebaugh
b41a73e1c1 [core] Rationalize Resource initialization 2016-01-29 14:50:15 -08:00
John Firebaugh
849e8b32b4 [core] Ensure that FileSource has access to tile URL, pixelRatio, x, y, z 2016-01-29 14:50:15 -08:00
Minh Nguyễn
6995452541 [ios] Restored toggleDebug
Restored (but deprecated) a method removed in #3100 to avoid a major version bump.
2016-01-28 22:36:58 -08:00
Minh Nguyễn
6b3b3f3ff6 [ios] Debug mask
Ported MGLMapDebugMaskOptions from the OS X SDK. Deprecated debugActive and -cycleDebugOptions.
2016-01-28 22:23:07 -08:00
Ansis Brammanis
b738087080 [osx] setMaximumZoomLevel, setMinimumZoomLevel
adds:
setMaximumZoomLevel
setMinimumZoomLevel

and makes `maximumZoomLevel` and `minimumZoomLevel` not readonly
2016-01-28 15:10:26 -08:00
Ansis Brammanis
371a210be8 [ios] getters, setters for minZoom, maxZoom
adds:
minimumZoomLevel
setMinimumZoomLevel
maximumZoomLevel
setMaximumZoomLevel
2016-01-28 15:10:26 -08:00
Ansis Brammanis
1644234179 [core] add setMaxZoom, setMinZoom
also change the default maxZoom to 20 to match -js.
2016-01-28 15:10:01 -08:00
Konstantin Käfer
e2a3c02d1a [core] destruct WorkTask data before calling the callback 2016-01-28 10:52:33 +01:00
Minh Nguyễn
8a23bdcd01 [core, ios, osx] Tilt around visual center point
The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
2016-01-26 18:49:01 -08:00
Minh Nguyễn
7057a1bb4a [ios] Bifocal viewport in course tracking mode
When a targetCoordinate is specified in course tracking mode, the map automatically resizes the viewport to show both the user puck and the target, one at the top and the other at the bottom. The user puck now rotates its arrow in the course direction, no longer assuming that the viewport is facing the same way as the course.
2016-01-26 17:19:22 -08:00
Minh Nguyễn
87f0174967 [ios] Various user tracking mode fixes
Setting the user tracking mode without animation now works. Previously, it kept the user dot from ever updating.

Just as a zoom gesture no longer kicks the user out of user tracking mode, programmatically zooming shouldn’t either.

Setting a camera with an invalid center coordinate no longer attempts to change the center coordinate but still changes any other valid properties.

Made animation to new user dot vertical alignment optional.
2016-01-26 17:17:25 -08:00
Bruno de Oliveira Abinader
2f86467586 Cleanup std::chrono usage
Use mbgl::Duration and mbgl::{,Milli}Seconds whenever possible.
2016-01-25 15:11:18 +02:00
John Firebaugh
a877b9b192 [core] Include prior values of caching headers in Resource
This allows the FileSource interface itself to support revalidation. We could (and probably should) now rewrite HTTPContextBase implementations as FileSource implementations.
2016-01-22 18:42:53 -08:00
John Firebaugh
bf48467b8c [core] Remove unused parts of chrono.hpp 2016-01-22 18:41:54 -08:00
John Firebaugh
fa894d7cbc [core] Polyfill std::chrono::abs 2016-01-22 18:41:54 -08:00
John Firebaugh
cef5c331fe [core] Merge rfc1123, iso8601, and parse_date into chrono.hpp and fix their API 2016-01-22 18:41:54 -08:00
John Firebaugh
1c21d0fd4c [core] Use better types for modified / expires / etag 2016-01-21 11:22:11 -08:00