Commit Graph

2256 Commits

Author SHA1 Message Date
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
Konstantin Käfer
6feb89cbbc [core] fix various errors reported by clang-tidy 2015-12-03 15:38:36 +01:00
Konstantin Käfer
dc620f48de [core] Fix std::move() misuse that disables copy elision 2015-12-03 15:38:36 +01:00
John Firebaugh
e5181e2668 [core] Use optional where SpriteAtlas return values might not exist
Fixes #3162
2015-12-01 18:05:54 -08:00
John Firebaugh
8afa14fa78 [core] Map::setSprite ⇢ Map::addAnnotationIcon
Fixes #3084
2015-12-01 15:10:28 -08:00
John Firebaugh
8a66b7047f [core] Remove mutex from Style
There's no cross-thread sharing to be protected here.
2015-12-01 11:16:57 -08:00
John Firebaugh
b7674040ab [core] Privatize layers and sources 2015-12-01 11:16:57 -08:00
John Firebaugh
bafbf6c04b [core] Don't share util::ptr<StyleLayer> across threads 2015-12-01 11:16:57 -08:00
John Firebaugh
96f5ae7cb8 [core] Don't share Style& across threads 2015-12-01 11:16:57 -08:00
Adam Hunter
e1091db45e [core] Use a separate atlas and store for annotation sprites
Fixes #1488
2015-12-01 09:15:05 -08:00
John Firebaugh
58886842bc [core] Move MapData storage to MapContext
This allows MapData members to hold GL resources which must be released
on the MapContext thread -- necessary for the following commit.
2015-12-01 09:15:05 -08:00
John Firebaugh
40ebf5d0d0 [core] Introduce StyleUpdateParameters 2015-12-01 09:07:03 -08:00
John Firebaugh
f27c28b6c4 Partially revert "[core] Source should receive a ref to MapData just once"
This partially reverts commit d55aa7929c.
2015-12-01 09:07:03 -08:00
Thiago Marcos P. Santos
ed29223e5a [core] Remove mbgl/util/uv.hpp
Now only a few things depend on libuv and they can use it directly.
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
a1f714bd37 [core] Do not use uv::rwlock on Style
It was being used as a normal mutex anyway.
2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
62990f0a21 [core] Port uv::tls to pthreads 2015-12-01 11:49:02 +02:00
John Firebaugh
c5a4377714 [core] Privatize internal headers 2015-12-01 11:49:02 +02:00
John Firebaugh
1c63f98f6d [core] Expose fewer RunLoop implementation details in header 2015-12-01 11:49:02 +02:00
John Firebaugh
f2553fff89 [core] Merge uv_detail.hpp into uv.hpp 2015-12-01 11:49:02 +02:00
Thiago Marcos P. Santos
d515f84caf [core] Remove unused libuv includes 2015-12-01 11:49:01 +02:00
Thiago Marcos P. Santos
9b36c19aeb [core] Introduce Timer abstraction 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
0d8ea6c0a2 [core] Removed dependency on uv_loop from the file source 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
d422c8cac4 [core] Abstract main loop inside RunLoop class 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
1d62332204 [core] Use AsyncTask on the MapContext 2015-12-01 00:00:09 +02:00
Thiago Marcos P. Santos
123c5df922 [core] Introduce the AsyncTask 2015-12-01 00:00:09 +02:00
Bruno de Oliveira Abinader
92856f394c [core] Collision debug is now MapDebugOptions::Collision 2015-11-27 17:47:02 +02:00
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
1f0820c8e8 [core] Added MapDebugOptions
Map debug options are now cycled up to all debug options enabled, then
back to none.
2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
044e92f5e8 [core] Display modify, expires debug information 2015-11-27 17:47:02 +02:00
Bruno de Oliveira Abinader
591e0dde2f [core] Added modified, expires information to TileData 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
f3d6f68106 [core] Always manually premultiply libpng output
It appears to be the only way to get the results we want in all cases.
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
2de0a351a0 [core] [iOS] Completion handlers for animated methods
Added transition frame and finish functions to CameraOptions. Added Objective-C equivalents to the three main entry points to easeTo() in MGLMapView.

Fixes #1581.
2015-11-25 15:20:25 -08:00
Thomas Voß
3f786c7171 Fix GCC5 complaining about -Wunused-variable. 2015-11-25 14:23:13 +01: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
John Firebaugh
afa04de152 [core] Followup fix to #3037
The previous fix resulted in annotations sometimes never being added.
This would happen if, during the execution of MapContext::update where
Update::Annotations was set, the style itself was loaded but some of
its subresources (sprite or sources) were not.

#3082 is a follow up issue to make MapContext::update less error-prone.
2015-11-19 18:01:42 -08:00
John Firebaugh
db1c4f2cc2 [core] Avoid calling AnnotationManager::updateStyle until the style is loaded
Fixes #3037
2015-11-18 16:05:13 -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
Bruno de Oliveira Abinader
711d41f91b [core] Avoid extra copy of TransformState in Painter::render
In MapContext thread, TransformState gets updated from main thread to
MapContext and Painter can safely reference MapContext's TransformState
instead of copying it upon each Painter::render call.
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
2eb0203bf4 [core] Cancelled flag needs to be atomic; it is read from multiple threads 2015-11-16 12:25:46 -08:00
John Firebaugh
6f881977eb [core] Fix a subtle and currently unexposed bug in RunLoop::invokeWithCallback
The doubly nested lambda that's responsible for executing the callback
needs to check the cancellation flag on *both* threads. See comment for
details.
2015-11-16 12:25:46 -08:00
Thiago Marcos P. Santos
d9f10fbfa7 [core] Use std::mutex on RunLoop
Only the WorkTask mutex needs to be recusive because
the WorkQueue will run a WorkTask that will pop
itself from the WorkQueue causing it to get cancelled.
2015-11-16 22:16:08 +02:00
John Firebaugh
f9ebe54a63 [core] Merge Sprite into SpriteStore 2015-11-12 13:03:14 -08:00