Commit Graph

518 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
d55aa7929c [core] Source should receive a ref to MapData just once 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
31fd2822f5 [core] Replace time_t with std::chrono::seconds
Added aliases for std::chrono typedefs (eg. 'Seconds' for
std::chrono::seconds). These aliases are used together with templated
helper functions to replace time_t with std::chrono::seconds for most
cases, in particular for 'modified' and 'expires' values in Response.
2015-11-27 17:47:02 +02:00
John Firebaugh
1d33790dc0 [core] Fix image type of Map::renderStill
It's a premultiplied image. This implies that we were misusing encodePNG
in most cases, as we were passing premultiplied pixels which were then
interpreted as unmultiplied. I changed encodePNG to accept premultipled
pixels, and unpremultiply in the implementations.
2015-11-25 15:57:37 -08:00
John Firebaugh
ed5eb9edc1 [test] Add pixelmatch; use in annotation tests 2015-11-25 15:57:37 -08:00
John Firebaugh
54eff4b4c1 [core] Add image tests 2015-11-25 15:57:36 -08:00
John Firebaugh
0c1e378bc9 [core] Rewrite image handling
* Consolidate Image and StillImage
* Typecheck unassociated vs premultiplied images
* Rewrite default platform image decoding implementation
2015-11-25 15:57:36 -08:00
Minh Nguyễn
e3992c41c3 [iOS] Wait for didChange notifications instead of timer 2015-11-25 14:39:32 -08:00
John Firebaugh
36081f6486 [core] For binary image data use uint8_t, not char 2015-11-23 17:28:44 -08:00
Konstantin Käfer
b5f7cafab4 [core] more robust max-age parsing 2015-11-20 14:39:44 +01:00
John Firebaugh
d08861daf4 [core] Force style-sourced annotations to be visible 2015-11-19 19:50:29 -08:00
Minh Nguyễn
dc5a55c670 Fixed Linux builds; code style 2015-11-19 12:35:28 -08:00
Minh Nguyễn
a983dc8259 Ported replaceTokens() tests from GL JS 2015-11-18 19:06:33 -08:00
John Firebaugh
f2772309fe Rewrite CustomSpriteImages test
Previous test was invalid; Map::setSprite is only for annotations.
2015-11-18 16:29:18 -08:00
Bruno de Oliveira Abinader
adfac6f061 [core] Added ConstrainMode::{HeightOnly,WidthAndHeight}
ConstrainMode gives flexibility to our engine to choose between
constraining both vertically and horizontally, or just vertically
(default behavior).

Constrain in both axis means we can no longer pan the map beyond the map
boundaries. This fixes an issue where e.g. annotations disappear upon
crossing the map boundaries.
2015-11-18 09:37:27 +02:00
Bruno de Oliveira Abinader
cb9b397985 [core] Fix LatLngBounds default coordinates
LatLngBounds southwest and northeast coordinate points were inverted, so
they could be extended via LatLngBounds::extend(). However, this looks
confusing and error-prone.

A static LatLngBounds::getExtendable() is added to address cases when we
want to extend LatLngBounds.
2015-11-18 09:37:27 +02:00
John Firebaugh
7137239cbd [core] Use std::unique_ptr for FileSource request 2015-11-16 12:25:47 -08:00
John Firebaugh
1caf89c32b [core] Pass a value to response callback, not a reference 2015-11-16 12:25:47 -08:00
Thiago Marcos P. Santos
36581f3d30 [core] Do not pass uv_loop_t around
This should be abstracted by util::RunLoop
2015-11-16 12:25:47 -08:00
John Firebaugh
f9ebe54a63 [core] Merge Sprite into SpriteStore 2015-11-12 13:03:14 -08:00
John Firebaugh
1e350b7ea4 [core] Reorganize sprite related files 2015-11-12 13:03:14 -08:00
John Firebaugh
54e08b1f83 [core] Eliminate use of ClassProperties for paint 2015-11-10 11:33:17 -08:00
John Firebaugh
a562567589 [core] Eliminate use of ClassProperties for layout 2015-11-10 11:33:17 -08:00
John Firebaugh
b81243daa9 [core] Merge PiecewiseConstantFunction into Function 2015-11-06 10:38:48 -08:00
John Firebaugh
7de4ce5bcb [core] Simplify Function 2015-11-06 10:38:47 -08:00
Minh Nguyễn
4956c05042 [iOS] Wait for style loading, then rotation, then compass fading
Fixes #2920.
2015-11-04 13:02:32 -08:00
Mike Morris
dfb36d6231 [core] move mbgl.gyp to gyp directory
So npm won't clobber binding.gyp, refs
https://github.com/npm/npm/issues/10243
2015-11-04 11:34:35 -05:00
Mike Morris
79a5a96037 [core] mason geojsonvt-2.1.6.3
- [osx] set -fvisibility-inlines-hidden in gyp/common.gypi to silence
  mismatched visibility linker warnings
- [linux] set cxx_host in GYP_FLAGS to set -fabi-version=0 on gcc builds
  to use clang-built mason binaries
- [ios] update symbol visibility for iOS tests
- [ios] link libgeojsonvt.a in iOS tests xcodeproj
  - add libgeojsonvt.a to General -> Linked Frameworks and Libraries
  - add mason_packages (recursive) to Build Settings -> Library Search Path
- [ios] add libuv and geojsonvt first in iOS libtool smush to ensure symbols
  are found by later compilation units where they are undefined
2015-11-02 18:41:34 -05:00
Konstantin Käfer
04273fbb1c [core] Make DefaultFileSource react to all NetworkStatus changes 2015-11-02 17:25:08 +01:00
Konstantin Käfer
4d5c6333be [core] move retry logic to DefaultFileSource 2015-11-02 17:24:40 +01:00
John Firebaugh
a7219a77aa [core] Don't crash when removing a shape annotation whose layer was never created 2015-10-30 14:36:07 -07:00
John Firebaugh
7821dccae5 [core] Polymorphic layout and paint parsing 2015-10-29 16:46:49 -07:00
John Firebaugh
b39501ba59 [core] Fudge numbers to get a timing-based test to pass more often
Fixes #2872
2015-10-29 16:45:53 -07:00
Konstantin Käfer
b9452bcbba [core] refactor test server startup 2015-10-28 16:51:13 +01:00
Tom MacWright
c80c823da2 [core] Ensure URL normalization is safe. Fixes #2695 2015-10-28 10:44:33 -04:00
John Firebaugh
4ef2bcc01a Don't create libuv objects on the stack 2015-10-27 17:49:10 -07:00
Justin R. Miller
1421755434 remove metrics tests 2015-10-27 10:45:10 -07:00
Justin R. Miller
48d6d039ed remove heading tests as unreliable 2015-10-27 10:43:20 -07:00
Justin R. Miller
1c57039365 adjust enabled tests 2015-10-27 10:40:52 -07:00
Justin R. Miller
56ede35c0f test in Debug 2015-10-27 10:36:31 -07:00
Justin R. Miller
7d8655baf3 tighten up non-location tests 2015-10-27 10:36:31 -07:00
Konstantin Käfer
32c0fb468f [http] don't retry when there's already a request in progress 2015-10-27 12:11:16 +01:00
Konstantin Käfer
c0c554e36f [core] reparse tiles when new data arrives
We're now reparsing tiles when they expire. We're also swapping out buckets atomically to avoid flickering data; i.e. we're displaying the old data as long as we don't have a new parsed bucket for that layer yet. The parsed buckets now live in the *TileData objects rather than in the TileWorker; only partially parsed == pending buckets will remain in the TileWorker. Once they're parsed, they're moved to the *TileData object.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
5173bf1bb8 [core] Make response data shared to avoid excessive copying 2015-10-26 15:54:27 +01:00
Konstantin Käfer
9bbd9aba3a [core] set a timer and auto-refresh requests when they expire
When we get a request with an explicit expiration time, we're now starting a timer, and will trigger a refresh once the data expires. This gives requesters a chance to update their data.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
6a7334b882 [core] add support for stale responses
We're now returning stale responses from cache. Those responses will have the `stale` flag set to true. Currently, all requesters in the core code discard stale responses, and cancel the request immediately after they got a non-stale response.
2015-10-26 15:54:27 +01:00
Konstantin Käfer
94a5ac857f [core] all requests have to be canceled explicitly now
By not automatically destroying Request objects after the result has been delivered, we are making sure that we can potentially fire the callback multiple times without adverse effects. This means that you have to hold on to the result of fs->request(), can explicitly cancel it if you don't want to be notified of data changes anymore. Not doing so will monitor the request indefinitely and will prevent the app from exiting.
2015-10-26 15:54:27 +01:00
John Firebaugh
8d79c25765 [core] Remove MapData dependency from StyleParser
MapData was needed for two things: getting the default transition and
fade durations, and detecting still rendering vs. continuous.

The first is avoided by making transition durations optional, and
supplying the default fallback value at evaluation time. The second did
not fix the still rendering issue, and will be followed up with a
different approach in a later commit.
2015-10-23 13:56:55 -07:00
Bruno de Oliveira Abinader
5fa144647d [core] Added GLContextMode to MapData
Adding new mbgl::GLContextMode enum to mbgl::Map ctor, which gets stored
in MapData. In shared GL context environments, we cannot assume that the
GL state that has been left since the last draw is the same, so we reset
the GL configurations to their default values.
2015-10-22 16:02:39 -07:00
John Firebaugh
c46a8254c4 [core] Style-sourced shape annotation properties
This introduces the possibility to source the type and style properties
of a shape annotation from a designated layer in the style.
2015-10-22 15:27:53 -07:00
John Firebaugh
3afc8b4a29 [core] Introduce StyleLayer subclasses 2015-10-22 09:34:40 -07:00