Commit Graph

1633 Commits

Author SHA1 Message Date
Minh Nguyễn
850b70ff91 [core, ios, macos] Added layers and sources properties to MGLStyle
Added new layers and sources properties to MGLStyle that contain all the style’s layers and sources, respectively. These properties are KVC-compliant with all the mutable to-many methods. Layers are ordered from topmost to bottommost, for consistency with Cocoa APIs where front/first means top and back/last means bottom.

Also added storage for mbgl::style::Source in MGLSource proper for wrapping AnnotationSource. Until the style finishes loading, its name property is set to nil.

Fixes #6003.
2016-11-28 15:45:37 -08:00
Jesse Bounds
96a7a4402e [core] Return source and layer ownership (#7014)
When a source or layer is removed transfer ownership back to the
caller so it can (optionally) take it. Preserve the behavior that 
removing a CustomLayer triggers deinitialization.  Deinitialize all 
custom layers when a style is destroyed in case those layers are not 
explicitly removed.
2016-11-13 19:56:29 -08:00
Bruno de Oliveira Abinader
5dcf7ca18e [linux] Added OSMesa headless backend 2016-11-13 16:10:36 -08:00
Konstantin Käfer
a4d259c33f [core] move gl::Context to Backend and refactor View 2016-10-25 13:52:36 -07:00
Konstantin Käfer
5cc390d694 [core] separate Backend from View for headless rendering 2016-10-25 13:52:36 -07:00
Mike Morris
7bbd49c72c [core] extract weak_ptr mailbox->receive into Mailbox::maybeReceive 2016-10-20 14:39:11 -04:00
Mike Morris
817c26111a [core] [node] pass thread pool impl to Map constructor
Updates mbgl::Map constructor usage everywhere

Adds NodeThreadPool implementation using AsyncQueue to call
Nan::AsyncQueueWorker from main thread
2016-10-20 14:37:36 -04:00
Ivo van Dongen
ab85fdb452 [glfw] add map change callback methods to glfw_view 2016-10-20 17:02:40 +03:00
Bruno de Oliveira Abinader
ef62b78fce [core] TileCoordinate::fromLatLng no longer depens on TransformState 2016-10-19 08:11:41 +03:00
Bruno de Oliveira Abinader
2188d68b6c [core] Move TransformState::{un,}project() to Projection 2016-10-19 08:11:41 +03:00
Bruno de Oliveira Abinader
f01a829dc9 [core] Move TransformState::worldSize() to Projection 2016-10-19 08:11:41 +03:00
John Firebaugh
e4310aa874 [core] Improve attribute binding API 2016-10-05 10:52:19 -07:00
John Firebaugh
73334ac8fa [core] Move shader and uniform to gl directory 2016-10-05 10:52:19 -07:00
John Firebaugh
7a3bef091e [core] Refactor Buffer 2016-10-05 10:52:19 -07:00
Ivo van Dongen
1bf12e20a6 [core] LocalFileSource implementation and tests 2016-09-30 14:57:26 +02:00
Konstantin Käfer
2ec2860ce5 [core] move OpenGL extension loading to their own headers 2016-09-29 13:19:27 -07:00
Konstantin Käfer
cc78b74098 [core] remove dependence on gl.h types 2016-09-29 10:17:47 -07:00
Konstantin Käfer
15aece8a30 [core] introduces types for GL objects 2016-09-29 10:17:47 -07:00
Konstantin Käfer
a8b007daa0 [core] remove unused GL_TRACK functions 2016-09-28 16:34:07 +02:00
Konstantin Käfer
21386b3146 [core] move GL value accessors to gl::value namespace 2016-09-27 11:03:29 -07:00
Konstantin Käfer
63e53de157 [core] standardize on uint16_t for texture sizes 2016-09-27 10:42:10 +02:00
Konstantin Käfer
ffa8a7668b [core] store viewport and FBO binding 2016-09-27 10:42:10 +02:00
Minh Nguyễn
7ff036cd01 [core] Removed map attribution API
Since client code can readily access the individual sources, Map doesn’t need to expose a dedicated API for iterating over them.
2016-09-26 15:42:57 -07:00
Minh Nguyễn
f307652548 [core] Source-driven attribution
Implemented observer callbacks so the style knows when the source’s attribution changes and the map knows when the style’s attribution changes. Also implemented a getter for a tile source’s attribution.

Fixes #2723.
2016-09-26 11:37:06 -07:00
Konstantin Käfer
afb93d4d3a [core] track VAOs and Buffers 2016-09-26 11:14:40 +02:00
Konstantin Käfer
adcb449ff3 [core] make GL value defaults constexpr 2016-09-26 11:14:40 +02:00
Thiago Marcos P. Santos
486bdddb23 [core] Add interface to add sprites to the style
Unlike annotations, they will go away when we change the style.
2016-09-22 17:43:28 +03:00
Young Hahn
6a2ce352d1 Better handling for undefined icon|text-rotation-alignment (#6253)
* [core, ios, android] Use `auto` value for properties with calculated defaults

* Fix render tests
2016-09-21 16:07:33 -07:00
Mike Morris
6fe621bbef [core] check GL errors in loop
As recommended in https://www.opengl.org/wiki/GLAPI/glGetError

char* -> std::string
2016-09-21 10:33:40 -04:00
Molly Lloyd
598f7c6ad5 [core] allow offline region metadata to be updated (#6338) 2016-09-20 17:43:00 +02:00
Lucas Wojciechowski
37cb2bd756 [core] Convert uses of std::set to std::unordered_set (#6325)
* src/mbgl/annotation/annotation_manager.hpp

* src/mbgl/algorithm/update_renderables.hpp

* src/mbgl/geometry/glyph_atlas.hpp

* src/mbgl/renderer/painter.cpp and src/mbgl/renderer/render_item.hpp

* src/mbgl/renderer/symbol_bucket.hpp and src/mbgl/text/glyph_store.hpp

* src/mbgl/sprite/sprite_atlas.hpp

* include/mbgl/storage/network_status.hpp

* src/mbgl/text/collision_tile.cpp

* src/mbgl/style/update_batch.hpp

* platform/default/mbgl/storage/offline_download.hpp

* Add GlyphRangeSet typedef

* Fix whitespace & unused imports
2016-09-19 17:26:25 -07:00
John Firebaugh
41bbd4e4f7 [core] Use an actor model for tile worker concurrency 2016-09-16 12:01:06 -07:00
Tobrun
9ef65440b6 [core] [android] - public api configurable base endpoint (#6309)
add runloop to test
2016-09-15 22:01:09 -07:00
Ivo van Dongen
290bd07a92 [core] OnlineFileSource - rate limit 2016-09-13 14:21:37 +02:00
Bruno de Oliveira Abinader
beb67fb7b2 [core] Separate transition options accessors from class API
Now the style class transition options have its own getter/setter, which
persists for each style until a new style is set.
2016-09-13 12:38:59 +03:00
John Firebaugh
29f4204d1c [core] Don't use std::move on forwarding references 2016-09-08 16:36:47 -07:00
John Firebaugh
030234c7a6 [core] Rework invokeWithCallback so that the callback is last 2016-09-08 16:36:47 -07:00
John Firebaugh
e4995e8d3a [core] Extract WorkTaskImpl from run_loop.hpp 2016-09-08 16:36:47 -07:00
John Firebaugh
8e2170c885 [core] Batch source updates 2016-09-06 14:29:22 -07:00
John Firebaugh
b4864ca9d5 [core] Trigger Source::Impl::reload when a filter or layout property is modified 2016-09-06 14:29:22 -07:00
John Firebaugh
fe2a26225f [core, ios, android, qt] Observe style layer mutations rather than requiring SDKs to use Map::update
This paves the way for updates to filter and layout properties to trigger a source reload, without each SDK having to participate in the implementation.
2016-09-06 14:29:22 -07:00
John Firebaugh
3a48c60813 [core] Add missing classed paint property getter 2016-09-06 12:52:14 -07:00
Dane Springmeyer
be08c79b6f update filter doc usage example (#6202) 2016-08-31 15:33:43 -07:00
John Firebaugh
d2abb1b6d5 [core] Change GeoJSONSource::getURL() to return an optional<std::string>
GeoJSON sources may have inline GeoJSON rather than a URL; returning an optional type ensures that consumers handle this case.
2016-08-26 10:30:55 -07:00
Thiago Marcos P. Santos
1d7a5b0fe0 [tests] Add unit test for style loading failures 2016-08-24 20:02:39 +03:00
John Firebaugh
63cce78cf1 [core] Add static getters for property default values (#6124) 2016-08-23 12:49:47 -07:00
John Firebaugh
86cccc4d24 [core] Don't allow style mutations to be overwritten by revalidation
* Once we get a fresh style, stop revalidating.
* If the style is mutated, stop revalidating and preserve the existing mutations.
2016-08-23 09:55:32 -07:00
Ivo van Dongen
df3b44531e [core] #6071 - extract GeoJSONOptions conversion from GeoJSONSource conversion
* [core] geojson_options - retain original error message

* [core] tests - initial style conversion stub methods

* [core] geojsonoptions conversion - initial unit tests

* [core] tests - fix forward reference issue

* [core] geojsonoptions conversion - unit tests

* [core] geojsonoptions conversion - renamed Holder to Value
2016-08-23 14:57:55 +02:00
Konstantin Käfer
e6bcbdd5d3 [core] set correct depth values for CustomLayer so compositing works 2016-08-22 18:32:12 +02:00
Thiago Marcos P. Santos
547af7475e [Qt] Implement a Qt headless renderer
Using legacy QGLWidget because we support Qt4.
2016-08-22 16:52:02 +03:00