Commit Graph

194 Commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
d0be2ed2a6 [build] Update GLFW to 2017-07-13-67c9155 2017-07-13 14:59:06 +03:00
Konstantin Käfer
a5cdbb084e [all] make default_styles header-only 2017-07-13 00:22:54 -04:00
John Firebaugh
49726cdc75 [core] Remove segment.cpp 2017-07-12 14:48:22 -07:00
John Firebaugh
c61041b44c [core] Rework attribute binding (again)
These changes are necessary for programs whose set of active attributes is not fixed at compile time by a template parameter pack, but rather varies based on the generated shader text at runtime. In such cases, the attribute location of a given named attribute may vary between instances of the same Program.

Previously, attribute bindings were implicitly associated with a location based on template parameter order, and -1 was used to indicate an inactive attribute. This left us unable to disable the appropriate attribute when it went from active to inactive. Now, the state tracker for bindings explicitly associates locations and state, and an empty optional is used to indicate an inactive attribute.

In addition, a gl::VertexArray class is now exposed, allowing more flexibility in the relationship between Programs, Segments, and attribute bindings. In this commit, that relationship does not change, but the subsequent commit adjusts it to match gl-js, reduce rebinds, and work around buggy VAO implementations.

VertexArray uses a pimpl idiom in order to support implementations that lack the VAO extension. In that case, all VertexArrays share global binding state, reflecting the platform reality in the absence of VAOs, while still providing a uniform API.
2017-07-12 14:48:22 -07:00
Thiago Marcos P. Santos
32bef80eec [test] Add utest to assert our dtoa implementation precision 2017-07-12 15:13:33 +03:00
Thiago Marcos P. Santos
06719ae42f [benchmark] Add a benchmark for our dtoa implementation
Make sure it is faster than std::to_value(). And it is, by ~30% for
the normal use case, and much faster when close to the double limits.

util::dtoa also offers a much better precision.
2017-07-12 15:13:33 +03:00
Ansis Brammanis
e514138b69 [core] improve legibility of labels that follow lines
port https://github.com/mapbox/mapbox-gl-js/pull/4781

This improves legibility of labels that follow lines in pitched views.
The previous approach used the limited information in the shader to
calculate put the glyph in approximatelyright place. The new approach
does this more accurately by doing it on the cpu where we have access to
the entire line geometry.
2017-07-11 09:10:24 -07:00
Ivo van Dongen
ba32831260 [benchmark] add render benchmarks 2017-07-07 18:16:20 +03:00
Thiago Marcos P. Santos
69c8f602de [tests] Add unit test for tile prefetching 2017-07-07 14:28:52 +03:00
Ivo van Dongen
9ba3dc9249 [build] add node-benchmark target and xcode scheme 2017-07-06 21:27:40 +03:00
Konstantin Käfer
fc48ca1801 [build] use CMake to generate Xcode schemes 2017-07-06 11:45:09 +02:00
Thiago Marcos P. Santos
6beccef517 [core] Introduce the ResourceTransform
Wrapper for transforming URLs on the OnlineFileSource.
2017-06-26 16:32:21 +03:00
Thiago Marcos P. Santos
54c3ccc37d [core] Make the mbgl/actor headers public
They will be needed by the DefaultFileSource, something that we
also export as public.
2017-06-26 16:32:21 +03:00
John Firebaugh
1520a56813 [all] Promote Style to public API 2017-06-22 08:04:39 -07:00
Konstantin Käfer
2cc330463d [core] switch to vector-tile library for decoding Mapbox vector tiles 2017-06-21 17:18:08 -07:00
Konstantin Käfer
4bfc559223 [core] add benchmark for vector tile parsing 2017-06-21 17:18:08 -07:00
Thiago Marcos P. Santos
7e8bdadb91 [core] Rename ThreadedObject to Thread
Now that the old Thread class is gone, we can give ThreadedObject
a better name.
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
1427628c56 [core] Remove util::Thread
Fixes #6425
2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
c34d1cfaa7 [tests] Added tests for ThreadedObject 2017-06-21 14:30:09 +03:00
Thiago Marcos P. Santos
0de17ea5f4 [core] Added the ThreadedObject
Actor model version of util::Thread.
2017-06-21 14:30:09 +03:00
Bruno de Oliveira Abinader
12279b5dcc [glfw] Added extrusions (E) and route (R) shortcuts 2017-06-14 16:39:07 +03:00
Konstantin Käfer
18b50f51b4 [core] cleanup ProgramParameters 2017-06-13 12:21:50 -07:00
John Firebaugh
244819f2da [core] Remove unused binpack.hppp 2017-06-13 10:18:43 -07:00
John Firebaugh
0b68731207 [core] Per-bucket icon atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
92252849c1 [core] Per-bucket glyph atlases 2017-06-13 10:18:43 -07:00
Anand Thakker
f59eb822e1 Fix undefined memory access in getCoveringRanges() (#9227)
* Add simple unit tests for SymbolSizeBinder

* Fix bug in symbol size uniform value calculation

For camera functions we were setting the zoom levels in "covering ranges" to
`[(zoom stop <= tile zoom), (zoom stop >= 1 + tile zoom)]`, but then evaluating
the function at `[tile_zoom, tile_zoom + 1]`.

* Check for it != end() before accessing it->first
2017-06-09 06:28:14 -04:00
John Firebaugh
9dfc2d924d [core] Collection-level immutability
Introduce a second level of immutability, over each of the collections held by a style: sources, images, and layers. Tracking immutability at this level allows us to short-circuit significant portions of the RenderStyle update logic via a simple equality check, greatly improving performance.
2017-06-05 19:38:08 -07:00
John Firebaugh
74af076d40 [core] Split RenderStyle from Style 2017-06-05 19:38:08 -07:00
John Firebaugh
591af0021b [core] Refactor RenderSource updates
* Eliminate updateBatch in favor of diffing layers and detecting changes to properties upon which layout depends.
* Replace RenderSource::{update,remove,invalidate,reload}Tiles with a single update method
* Replace TilePyramid::{update,remove,invalidate,reload}Tiles with a single update method
* Remove Style& dependency TODO from GeometryTile and TileParameters
2017-06-05 19:38:08 -07:00
Asheem Mamoowala
1b86bf16b2 [core] Render Image Source 2017-06-01 15:38:01 -07:00
Asheem Mamoowala
7a010df956 [core] Add ImageSource support to style parsers 2017-06-01 15:38:01 -07:00
John Firebaugh
aa216d0025 [core] Don't use a separate SpriteAtlas for annotation images
Instead, just add them to the Style as needed. Includes changes from #8905 and takes care to avoid regressing #3817.
2017-05-26 11:21:56 -07:00
John Firebaugh
d766af44c8 [core] Auto-growable SpriteAtlas using shelf-pack 2017-05-26 11:21:56 -07:00
John Firebaugh
1f921299b0 [core] Make ExponentialStops behavior consistent; add tests 2017-05-19 11:48:45 -07:00
Asheem Mamoowala
8c75001443 [core][ios] Use explicit submodule update for ios target (#8973)
Closes #8750
2017-05-18 13:48:26 -07:00
Chris Loer
77b24bc0d3 [core] Throttle tiles to redo symbol placement at most once every 300ms.
Fixes issue #8435 and prepares for pitch-scaling changes in issue #8967.
2017-05-17 16:25:06 -07:00
John Firebaugh
4c26759b69 [core] Remove WorkQueue
No longer used as of 5cdf838a38.
2017-05-17 09:28:26 -07:00
John Firebaugh
9eba2a66d1 [core, node, darwin, qt] Remove support for paint classes 2017-05-15 09:45:55 -07:00
John Firebaugh
e473f2dcce [core] cascade ⇢ transition / cascading ⇢ transitionable 2017-05-15 09:45:55 -07:00
John Firebaugh
da4d735e2c [core] Unify {Paint,Layout,Light}Properties 2017-05-15 09:45:55 -07:00
Asheem Mamoowala
84e39611a0 [core] Move renderer/* files into sub-folders (#8983)
Move renderer/* files into sub-folders
2017-05-12 17:07:48 -07:00
Ivo van Dongen
cc9f040a2d [core] Split style image collection from SpriteAtlas 2017-05-12 13:19:00 -07:00
John Firebaugh
c80f3e9d29 [linux] loop-uv depends on mbgl-core for linking 2017-05-12 11:26:27 -07:00
John Firebaugh
c2a5894f2d [core] Immutable Impls 2017-05-12 11:26:27 -07:00
John Firebaugh
c130d470a1 [core] Remove StyleSourcedAnnotation support
The functionality this provided has been subsumed by the runtime styling API.
2017-05-10 14:22:01 -07:00
Bruno de Oliveira Abinader
c69fae99a5 [build] Suppress GLFW redefining GLAPIENTRY error 2017-05-09 14:35:34 +03:00
John Firebaugh
baaae99a03 [core, android] Factor JSON string conversions
This adds a `convertJSON` template, to be used like:

   Error error
   optional<Foo> foo = convertJSON<Foo>(string, error);

Internally, it parses the string with RapidJSON and then calls `convert<Foo>(parsed, error)`.

While here, rationalize GeoJSON converters and fix error handling for Tileset conversion in OfflineDownload.
2017-05-08 13:48:57 -07:00
Ivo van Dongen
feae5e22ee [core] generated accessor methods on light 2017-05-08 19:39:55 +03:00
Ivo van Dongen
20810f988a [core] render light 2017-05-08 19:39:55 +03:00
John Firebaugh
e7d2796762 [core] Omnibus Style::update method
Combine Style::cascade, recalculate, relayout, and updateTiles into a single method. This allows multiple loops over sources and layers to be consolidated and prepares for additional Style-Map decoupling: rather than tracking pending updates via a set of Update flags held by the Map and passed to the Style, the Style can use its own data to determine what to update.
2017-05-04 09:59:56 -07:00