Commit Graph

2731 Commits

Author SHA1 Message Date
Konstantin Käfer
1777b8757a [core] don't iterate over references to uint32_t 2016-09-28 19:03:03 +02:00
Konstantin Käfer
068732fc9e [core] don't iterate too much over program objects scheduled for deletion 2016-09-28 19:03:03 +02:00
Thiago Marcos P. Santos
4ef66f36d4 [core] Use geojson as a header only library 2016-09-28 16:35:50 +02:00
Konstantin Käfer
a8b007daa0 [core] remove unused GL_TRACK functions 2016-09-28 16:34:07 +02:00
John Firebaugh
aa0fc68fea [core] Mark tracked state as dirty when the tracked object is destroyed 2016-09-28 10:54:48 +02:00
Konstantin Käfer
44c7e9d05e [core] merge gl::ObjectStore into gl::Context 2016-09-27 11:03:29 -07:00
Konstantin Käfer
ce42d22984 [core] rename gl::Config to gl::Context 2016-09-27 11:03:29 -07: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
c88ce2d51e [core] add ability to render to offscreen textures 2016-09-27 10:42:10 +02:00
Konstantin Käfer
68ec9d3fd5 [core] Make sure textures have a scaling filter set after upload 2016-09-27 10:42:10 +02:00
Konstantin Käfer
63e53de157 [core] standardize on uint16_t for texture sizes 2016-09-27 10:42:10 +02:00
Konstantin Käfer
512037cfdc [core] Allow retrieving texture ID and size 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
0f5b194617 [core, qt] Generalized source change notification
This same notification can in the future be used for other changes to a source.
2016-09-26 15:43:01 -07: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
John Firebaugh
a9842dbd6b [core] Extract some GlyphRange-related constants 2016-09-26 14:55:49 -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
Thiago Marcos P. Santos
78af55f30a [core] Fix initialization race on util::mapbox::isMapboxURL (#6455)
This function can be called from different threads and was depending
on a global `std::string protocol` which can do heap allocations.

The first thread to use it would initialized it which is not exactly
safe, so this patch moves it to a `char *` that is just a pointer to
the data segment, so no races.

Valgrind detected it on #6431.

```
==9874== Conditional jump or move depends on uninitialised value(s)
==9874==    at 0x4C307C2: __memcmp_sse4_1 (in /home/travis/build/mapbox/mapbox-gl-native/mason_packages/linux-x86_64/valgrind/latest/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9874==    by 0x79896E: mbgl::util::mapbox::isMapboxURL(std::string const&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)
==9874==    by 0x6DC756: mbgl::style::TileSourceImpl::parseTileJSON(std::string const&, std::string const&, mbgl::SourceType, unsigned short) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)
==9874==    by 0x6DDA6A: std::_Function_handler<void (mbgl::Response), mbgl::style::TileSourceImpl::loadDescription(mbgl::FileSource&)::{lambda(mbgl::Response)#1}>::_M_invoke(std::_Any_data const&, mbgl::Response&&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)
==9874==    by 0x50BE80: std::_Function_handler<void (), mbgl::StubFileSource::StubFileSource()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)
==9874==    by 0x70972A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==9874==    by 0x70A3621: QTimer::timerEvent(QTimerEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==9874==    by 0x7098053: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==9874==    by 0x60CCC8B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
==9874==    by 0x60D1E55: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
==9874==    by 0x706FC2C: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==9874==    by 0x70BC1AC: QTimerInfoList::activateTimers() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==9874==
```
2016-09-26 20:43:06 +03:00
Bruno de Oliveira Abinader
2ed81bbaae [core] Trigger Update::RecalculateStyle when toggling layer visibility 2016-09-26 11:47:34 +02:00
Bruno de Oliveira Abinader
ae3a02babe [core] Reuse Map::update() 2016-09-26 11:47:34 +02: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
Ivo van Dongen
c4420d081c [core] ensure network::Reachable is called only once 2016-09-23 10:47:55 +02:00
Young Hahn
08c08f6705 [core] Don't use depth test unless text is pitch-aligned to map (#6404)
* [core, ios, android] Use `auto` value for properties with calculated defaults

* Fix render tests

* [core] Don't use depth test unless text is pitch-aligned to map.

* Bump mapbox-gl-test-suite

* TransformState pitch is already in radians

* Reduce setDepthSublayer calls

* Bump test suite
2016-09-22 19:51:41 -04: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
Mike Morris
658354ced1 [core] add GL_CONTEXT_LOST case to checkError
and reorder according to hex value
https://www.opengl.org/wiki/OpenGL_Error#Testing_for_errors
2016-09-21 10:33:40 -04:00
Tobrun
7df9a21f41 [core] - mutable geojson sources. make tiles protected for geojson_source_impl (#6347) 2016-09-20 20:50:27 +02:00
John Firebaugh
cfd070c4e0 [core] Fix ThreadPool race condition (#6388) 2016-09-20 07:48:49 -07:00
John Firebaugh
c3a583cdd5 [core] Allow queryRenderedFeatures prior to symbol placement (#6376) 2016-09-20 07:47:42 -07:00
Konstantin Käfer
1e8f9c75ca [core] do not render layers that are outside their zoom range
So far, we didn't properly disable layers that are outside the zoom range. This means that we rendered layers that should not have been rendered, albeit we didn't make any attempt to load tiles for those layers. However, when zooming in/out, existing tiles might already have been loaded in the source which continued to be rendered. In most cases they weren't actually visible because either the matrices weren't updated, or the clip IDs weren't set so that they would be "rendered" off-screen and clipped completely. In any case, we did way too much work.
2016-09-20 14:10:38 +02:00
Ivo van Dongen
8b0694bc16 [core] MapChangeDidFinishLoadingStyle - Ensure style is loaded (#6392) 2016-09-20 12:37:34 +02:00
Ivo van Dongen
f3b38df91d [core] add MapChangeDidFinishLoadingStyle signal (#6371) 2016-09-20 09:55:53 +02:00
Tobrun
72e3d6906d [android] - do not update marker while creating (#6314)
* [android] - do not update marker while creating, add activity to prevent regression

* [core] - add asserts to incorrect usage of update and remove annotations api

* [android] - fix marker tests
2016-09-19 18:03:49 -07: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
dc1861f6d5 [core] Merge GlyphStore and GlyphAtlas 2016-09-19 09:40:43 -07:00
John Firebaugh
940124ff71 [core] Merge SpriteStore and SpriteAtlas 2016-09-19 09:40:43 -07:00
Jake Pruitt
d169ea55c1 Keep query strings in source URLs (#6182)
Carries over any query strings from mapbox://-prefixed styles urls,
source urls and tile urls to the api.mapbox.com requests.
2016-09-16 14:11:16 -07:00
John Firebaugh
d2246b22e0 [core] Document the ActorRef<O> argument passed to O's constructor 2016-09-16 12:01:06 -07:00
John Firebaugh
41bbd4e4f7 [core] Use an actor model for tile worker concurrency 2016-09-16 12:01:06 -07:00
clydebarrow
767aedc676 [core] Correct evaluation of interval functions 2016-09-16 10:58:42 -07:00
John Firebaugh
ad35cccdbc [core] Use consistent terms: "text" and "icon" 2016-09-16 09:00:55 -07:00
John Firebaugh
32fac7cbe4 [core] Use optional to represent possible absence, not empty strings 2016-09-16 09:00:55 -07:00
John Firebaugh
a8dd1bbbb8 [core] Move SymbolInstance and SymbolFeature into their own files 2016-09-16 09:00:54 -07:00
John Firebaugh
1f375581c3 [core] Move {clip,merge}_lines to layout directory 2016-09-16 09:00:54 -07:00
Tobrun
9ef65440b6 [core] [android] - public api configurable base endpoint (#6309)
add runloop to test
2016-09-15 22:01:09 -07:00
Konstantin Käfer
d1d523686c [core] upgrade RapidJSON to 1.1.0 2016-09-15 14:05:23 +02:00
Konstantin Käfer
ca8f32a914 [core] add explicit std::hash<mbgl::style::ClassID> implementation to appease GCC 2016-09-15 13:41:59 +02:00
Brad Leege
e49c96f05c [core] #3980 - Putting friend class SymbolLayout back 2016-09-14 16:57:54 -07:00