Commit Graph

16 Commits

Author SHA1 Message Date
Molly Lloyd
4a5dc37245 [core] Implement CrossFadedDataDrivenProperty to add support for feature expressions in *-pattern properties 2018-08-31 13:08:47 -07:00
Mikhail Pozdnyakov
fb5afd34b9 [core] Add line-gradient property
Porting of https://github.com/mapbox/mapbox-gl-js/pull/6303
See the link above for the description of the feature and
its limitations).

Based on patch from @lbud (Lauren Budorick).
2018-08-23 19:01:40 +03:00
John Firebaugh
aa4dff1095 [core] Align line vertex to 4-byte boundary
10 byte vertices are heavily penalized by common GL implementations.
2017-09-08 09:35:47 -07:00
John Firebaugh
822df3dd51 [core] Use separate attribute component for line normals
Broadcom GPUs don't cope well with using the least significant bit for this.
2017-08-08 18:06:44 -07:00
Lauren Budorick
87a70c4793 [core] Enable property functions for line-width (#9250) 2017-06-19 14:27:43 -07:00
John Firebaugh
0b68731207 [core] Per-bucket icon atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
1759603e12 [core] Simplify and fix sprite atlas coordinate calculations
* Always return image metrics exclusive of padding
* Work with integer coordinates whenever possible
* Eliminate redundant SpriteAtlasElement members
* Fix asymmetric re-padding in getIconQuad when pixelRatio != 1
* Add explanatory comments
2017-05-23 12:59:27 -07:00
John Firebaugh
71c8f6aa10 [core] Move pattern coordinate division by texture size into shader
This makes pattern usage more like icons, and will be necessary for data-driven *-pattern properties.
2017-05-23 12:59:27 -07:00
John Firebaugh
da4d735e2c [core] Unify {Paint,Layout,Light}Properties 2017-05-15 09:45:55 -07:00
John Firebaugh
d819ece74c [core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImage 2017-02-14 16:28:12 -06:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
Ansis Brammanis
29099399a9 [core] clearer pitched line antialiasing
ported from -js: ef5582dd3bc5c15a3112e875ed66494dab8e9d0b

Project the extrusion and compare it's projected pixel length with the
actual pixel length and adjust antialiasing accordingly.

The previous approach calculated the adjustment much more indirectly and
had no intuitive explanation.
2016-12-21 15:46:36 -08:00
Ansis Brammanis
38b5cb0c77 [core, ios] replace altitude with fov
ported from -js: eb6c6596c6a7a61363d30356674e0002153b1d19

`altitude` was a terribly-named variable that was used to indirectly
control the fov. This should eliminate some confusion.

`altitude` was equivalent to `cameraToCenterDistance / height`
2016-12-21 15:46:36 -08:00
John Firebaugh
38fcbe21d4 [core] Convert style properties to a tuple-based approach
This converts the style property classes (CirclePaintProperties and so on) to the same tuple-based approach as gl::Attribute and gl::Uniform. The approach is outlined in https://github.com/mapbox/cpp/blob/master/C%2B%2B%20Structural%20Metaprogramming.md.

The main advantage of this approach is it allows writing algorithms that work on sets of style properties, without resorting to code generation or manually repetitive code. This lets us iterate on approaches to data-driven properties more easily.

Another advantage is that the cascading, unevaluated, and evaluated states of a set of properties exist as independent structures, instead of individual properties holding their own state. This is a more functional approach that makes data flow clearer and reduces state.
2016-11-17 15:13:38 -08:00
Molly Lloyd
3380f0803a [core] update native for line property function shaders changes (#6658)
* [core] update shaders for line property functions

update deps, define device pixel ratio for all shaders

[core] create ShaderParameter struct to store pixel ratio and overdraw param

repair rebase errs

update shaders to include pixel ratio

make sure collision_box never overdraws

update test suite, move shaders to Painter::render so the correct pixel ratio is applied

move shader compiling back to the Painter constructor

rebase from shader --> program refactor

re-factor parameters for collisionBox and debug programs

remove unused vars from line-program, move blur math to shader

update core files

remove unecessary files

update shaders PR, remove comments

bump test suite sha

fix formatting, incorporate feedback

refactor program.hpp

* [core] remove line transformations that were moved to the shaders, bump shader sha

* [core] shorten ProgramParameter instantiation

* [core] bump shader+test suite shas
2016-11-16 17:34:33 -08:00
John Firebaugh
66bdbc3b96 [core] Introduce gl::Program template 2016-11-08 08:09:29 -08:00