Commit Graph

3121 Commits

Author SHA1 Message Date
John Firebaugh
34453eb4e2 [core] Fix iterator invalidation in erase_if
vector::erase invalidates iterators. It's not safe for erase_if to cache the end iterator nor increment, then erase.
2017-06-28 17:56:51 -07:00
John Firebaugh
f6bfa078af [core] Trigger repaint on source changes 2017-06-19 16:58:47 -07:00
John Firebaugh
1de8aeed31 [core] Fix composite function approximation for non-integer stops 2017-06-19 09:15:08 -07:00
John Firebaugh
d27740650b [core] Don't upload the FrameHistory texture in frames where it's not changing 2017-06-14 11:13:43 -07:00
John Firebaugh
d618d4a274 [core] Dynamic program compilation for data-driven properties 2017-06-14 11:13:43 -07:00
John Firebaugh
212ae5273d [core] cleanup ProgramParameters 2017-06-14 11:13:43 -07:00
Konstantin Käfer
a64828218a [core] add constant DDS values as uniforms 2017-06-14 11:13:43 -07:00
Konstantin Käfer
cf85873f36 [core] add uniforms to DataDrivenPaintPropertys 2017-06-14 11:13:43 -07:00
Konstantin Käfer
b141707b8d [core] add shader defines for enabling/disabling attributes/uniforms for DDS 2017-06-14 11:13:43 -07:00
Konstantin Käfer
eaa8f23672 [core] only bind uniforms that exist in the program 2017-06-14 11:13:43 -07:00
Konstantin Käfer
951f599706 [core] store vertex attribute binding to prevent duplicate binds
We have an "oldBinding" value that we use for checking whether the vertex attribute was already
bound to the current VAO, but we never set the state. Additionally, we're also checking whether
the previous state was already any binding (optional is set), and don't re-enable the vertex
attribute array. Additionally, we now only disable the vertex attribute array when the previous
state was in fact an array attribute. We still don't deduplicate constant glVertexAttrib* calls,
but that's a little trickier.
2017-06-14 11:13:43 -07:00
John Firebaugh
441b80d574 [core] Reduce number of varyings to 8 or less
For #pragmas, don't generate varyings for attributes that aren't used by the fragment shader. Pack other varyings more tightly.
2017-06-14 11:13:43 -07:00
Tobrun
6ec5e4f8cd Cherry picks to release branch (#9230)
* [ios][macos] test remove source in use

* [android] test remove source in use

* [core] check source usage before remove

* [core] ensure layer::accept works with non-void return values on gcc

* [android] - remove upgrade runtime exceptions (#9191)
2017-06-09 12:05:54 +02:00
Ansis Brammanis
facc3d54a0 fix #8300 flyTo for close points
The isClose threshold is switched from 0.000001 pixels to 1 pixel.
As a backup, it checks whether r0 and r1 are finite. It might be
possible to have just the threshold check or just the finiteness check,
but I don't see the harm in having both.

std::abs(w0 - w1) < 0.000001 is removed because it doesn't look like
it's needed. All calculations should run fine even if w0 === w1.

Finally, the point interpolation is tweaked so that at the end of the
flying (when k === 1) it ends up at the exact end point. I didn't see
any bugs related to this, but it seems like a good thing to have
explicitly.
2017-06-06 14:13:31 -07:00
Bruno de Oliveira Abinader
0d171dbe0e [core] Make TransformState LatLngBounds optional 2017-06-01 13:46:53 -04:00
Fabian Guerra Soto
fe17f7e8db Cherry-pick arabic text to release branch v3.6.0 (#9071)
* [core] Throttle tiles to redo symbol placement at most once every 300ms.
Fixes issue #8435 and prepares for pitch-scaling changes in issue #8967.

* [core] Disable letter-spacing for Arabic labels (issue #9057)
2017-05-23 12:02:09 -04:00
Konstantin Käfer
b52e171b67 [core] add error for non-virtual destructor deletes + add virtual dtors 2017-05-19 12:12:47 +02:00
Konstantin Käfer
f0b0167640 [core] Make destructor virtual to avoid object splicing during destruction 2017-05-19 12:12:47 +02:00
John Firebaugh
db370a02b1 [core] When a layer is added, reload its source's tiles 2017-05-11 11:21:31 -07: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
6fd40867d6 [core] delegate light changes to render light 2017-05-08 19:39:55 +03: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
Lauren Budorick
1c9af3226f [core] Reuse fill-extrusion textures between frames (#8896) 2017-05-08 09:06:07 -07:00
John Firebaugh
dd353a60d1 [core] Reset observers of removed Sources and Layers
This ensures that the observer is not an invalid reference if the removed Source/Layer is retained, but the Style is deallocated.
2017-05-05 09:23:01 -07:00
John Firebaugh
7ca8fd07e0 [core] Remove unused declaration 2017-05-05 08:57:30 -07:00
John Firebaugh
66da759426 [core] Reduce use of RecalculateStyle
* Don't use it to track zoom changes. Instead, Style::update can use the zoom history to check for a change in zoom from the previous frame.
* Don't use it to track active property transitions. Style already knows which layers/light have an active transition, and can re-evaluate only those that do.

This leaves layer property changes as the only use of RecalculateStyle.
2017-05-05 08:56:36 -07:00
Konstantin Käfer
fd104dd3c2 [core] Throw exceptions by value 2017-05-05 14:42:47 +02: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
John Firebaugh
89f1ffc6d2 [core] UpdateParameters ⇢ TileParameters 2017-05-04 07:29:08 -07:00
John Firebaugh
3790caafa3 [core] Factor timePoint initialization 2017-05-03 11:20:01 -07:00
John Firebaugh
88093bd708 [core] Calculate hasPendingTransitions functionally rather than statefully 2017-05-03 10:41:04 -07:00
John Firebaugh
d5f4d0f05f [core] Move render-related sources out of style directory/namespace
Moves the following to the renderer directory and out of the style namespace:

* CascadeParameters
* PropertyEvaluationParameters
* UpdateParameters
* PropertyEvaluator
* DataDrivenPropertyEvaluator
* CrossFadedPropertyEvaluator
* PaintPropertyBinder
* PaintProperyStatistics
* PossiblyEvaluatedPropertyValue
* TransitioningLight
* EvaluatedLight
2017-05-03 08:30:17 -07:00
John Firebaugh
6c7730ee7c [core] No need to Update::Classes after removing a layer 2017-05-03 08:30:02 -07:00
John Firebaugh
b8b9978b69 [core] No need to manually set Update::Classes flag after annotation update
Since the advent of the runtime styling APIs, the APIs used by AnnotationManager::updateStyle will automatically set this flag as needed.
2017-05-03 08:30:02 -07:00
John Firebaugh
1e26d99e1e [core] Remove forced style cascade
This should happen automatically during rendering. After removing, I can no longer replicate the original issue (#1889).
2017-05-03 08:29:46 -07:00
John Firebaugh
e9872b4ed0 Revert "[node] Temporary: exit(0) on exception in Painter::render"
This reverts commit f0d4411871.
2017-05-02 16:13:21 -07:00
Asheem Mamoowala
5c52401d55 [core] Make Map.addImage tests pass (#8843)
Fix Node tests suite implementation to parse pixelRatio from style json
Premultiply images in the node binding before sending to mbgl core
2017-05-02 09:54:06 -07:00
John Firebaugh
3f0c89d633 [core] Refactor Source::*Impls into RenderSources and TilePyramid 2017-05-02 08:45:09 -07:00
John Firebaugh
197751bace [core] Load source TileJSON immediately
This reverses #3095. Rationale:

* We're now exposing source attributes as a public API. Making those attributes unavailable at certain times complicates that API.
* We're preparing to split RenderSource out of Source. Removing this removes a point of coupling between the two.
2017-05-02 08:45:09 -07:00
John Firebaugh
c2b00378b7 [all] Push querySourceFeatures back out to Map
Once Source and RendererSource are split, Source will no longer have access to tiles.
2017-05-02 08:45:09 -07:00
Thiago Marcos P. Santos
bc868b8433 [core] Suppress "stencil mask overflow" warning
When it starts, we get a log warning for every frame, which is
expensive. Now we get only one warning.
2017-05-02 12:25:38 +03:00
Lauren Budorick
f6e79d7073 [core] Render fill-extrusion layers (#8431) 2017-04-27 15:56:55 -07:00
John Firebaugh
1c42daa152 [core] Tweak handling of annotation special case SpriteAtlas
* Simplify SymbolLayout; it never needs to care about more than one SpriteAtlas.
* Move the reference from SymbolLayer::Impl to SymbolBucket. This is a prerequisite for making layer Impls immutable.
2017-04-26 16:29:44 -07:00
Ivo van Dongen
3c175adf30 [core] split off render layers 2017-04-25 17:23:54 -07:00
John Firebaugh
5dd98df50b [all] Rationalize style::Image
A style has a collection of images, just as it has collections of sources and layers.

* Name things appropriately
* Use std::unique_ptr
2017-04-24 15:52:28 -07:00
Vladimir Agafonkin
0079d6173b [core] fix an issue with lines that have duplicate points (#8808)
An equivalent of https://github.com/mapbox/mapbox-gl-js/pull/4634.
2017-04-24 18:53:20 +03:00
Konstantin Käfer
59055cf403 [core] Move Sprite parsing to thread pool 2017-04-24 10:42:47 +02:00
John Firebaugh
3c23faf65a [core] More complete fix for composite function interpolation edge case
b5b4549 / #8613 handled the edge case for layout properties, but not paint properties. Move the check for a degenerate range to interpolationFactor in order to handle both correctly.
2017-04-20 16:11:57 -07:00
Konstantin Käfer
97f2a44859 [core] remove unused leftover files 2017-04-20 20:04:33 +02:00