Commit Graph

129 Commits

Author SHA1 Message Date
Thiago Marcos P. Santos
c7bbd5bbef [core] Fix performance-move-const-arg 2019-09-25 18:59:07 +03:00
Thiago Marcos P. Santos
3c23f6f9f7 [core] Fix bugprone-use-after-move
Luckily this is an enum and was being copied.
2019-09-25 18:59:07 +03:00
Aleksandar Stojiljkovic
4ba1270dcc [core] DEMData: do decode on GPU (port mapbox/mapbox-gl-js#8694)
This is first part of work on porting mapbox/mapbox-gl-js#8694 - in follow up patch(es) it is required to remove CPU side copy using 2d canvas support on all supported platforms, similar to approach taken in gl.js  https://github.com/mapbox/mapbox-gl-js/pull/8694/files#diff-34dbe5f7de34dc4b9a8745dcde9bdc37R48

Decoding on CPU removed.
Padding is still done in DEMData() but, instead od doing it wwhile decoding, it is using memcpy to pad original values.

Rebase to latest mapbox-gl-js master and re-generate shaders.

Partly fixes: #15503
2019-08-30 11:18:55 +03:00
Ander Conselvan de Oliveira
21632a66f8 [core] Remove programCacheDir parameter from ProgramParameters
Binary shader support has been removed in commit c2f974f2a5 ([core]
Remove binary shader support). This left-over parameter is not used
anywhere anymore.
2019-08-27 16:23:48 +03:00
Alexander Shalamov
9ba700fd47 [core] Fix combination of icon-text-fit with text-variable-anchors and text-writing-mode 2019-08-20 12:31:02 +03:00
Vladimir Agafonkin
6262b83cc6 [core] Switch back to a more compact line attributes layout (#14851)
* [core] switch back to a more compact line attributes layout

* update mapbox-gl-js to point to master
2019-06-10 22:26:16 +03:00
Aleksandar Stojiljkovic
62f6338d5b [core] Fix: fill-extrusion-vertical-gradient was ignored. #14784
fill-extrusion-vertical-gradient "property-type": "data-constant" and it shouldn't be computed through property binders.

Fixes: #14784
2019-05-31 18:40:27 +03:00
Konstantin Käfer
7f9274035b [core] refactor program object creation 2019-05-28 16:11:05 +02:00
Aleksandar Stojiljkovic
9809c9f8f5 [core] Offset viewport center when edge insets are specified
The change is implemented in TransformState::getProjMatrix, the rest of the code is making sure that existing API contracts stay and there are tests verifyingrendering and render query processing only items within screen and given tolerance around screen edges.

MapView: don't bake edge insets into relalculated camera center. Keep edge insets as property of camera in TransformState (similar to pitch, zoom, bearing) independent from specified camera center. Interpolate edge insets in animation.

iOS Demo app: "Turn On/Off Content Insets" pitch the camera and navigate to convenient location in Denver, where streets are parallel to cardinal directions, to illustrate viewport center offset when edge insets are set.

Tests:
ViewFrustumCulling: although Annotations are deprecated, queryRenderedFeatures related tests in Annotations would need to get ported and decided to add the edge insets related query tests next to them. Verify frustum culling (render+queryRenderedFeatures) With different camera and edge insets setups. TODO: port Annotations tests.

Transform.Padding: Verify that coordinates take proper place on screen after applying edge insets.

LocalGlyphRasterizer: verify text rendering when applying padding.

Related to #11882: both use projection matrix elements [8] and [9].

Alternative approach to this was to increase and offset map origin so that the screen would be a sub-rectangle in larger map viewport. This approach has a drawback of unecessary processing the items that are outside screen area.

Fixes #12107, #12728, navigation-sdks/issues/120
2019-05-28 14:38:01 +03:00
Konstantin Käfer
3a6ff7710f [core] add gfx::UploadPass, split startRender into prepare and upload 2019-05-15 11:57:43 -07:00
Konstantin Käfer
03e434e901 [core] use float for storing opacity attribute 2019-05-15 11:57:43 -07:00
Konstantin Käfer
da5bd4d6e3 [core] use unique IDs for DrawScopes 2019-05-15 11:57:43 -07:00
Konstantin Käfer
a53c88159f [core] upgrade mapbox-gl-js pin to the most recent version 2019-05-08 14:10:11 +02:00
Konstantin Käfer
20a807fdf3 [core] render extrusions directly in the main framebuffer 2019-05-08 12:25:22 +02:00
Alexander Shalamov
113e96e03c [core] Sort cross-tile symbol segments using symbol-sort-key 2019-04-17 15:04:08 +03:00
Alexander Shalamov
073e102b9b [core] Add optional sortKey to segment 2019-04-17 15:04:08 +03:00
Konstantin Käfer
d7aaf83421 [core] introduce gfx::RenderPass 2019-04-05 11:49:17 +02:00
Mikhail Pozdnyakov
ebe6f7dea3 [core] Remove RenderLinePaintProperties
This patch removes the `RenderLinePaintProperties` by
making `LineFloorWidth` part of the `style::LinePaintProperties`.

It normalizes paint properties evaluation for the line layer.
2019-04-02 17:56:16 +03:00
Mikhail Pozdnyakov
2292623bc6 [core] Introduce variable text placement for point labels - Placement part 2019-03-29 16:18:41 +02:00
Alexander Shalamov
cb64dbe0d6 [core] Introduce variable text placement for point labels - Render part 2019-03-29 16:18:41 +02:00
Konstantin Käfer
1e30fdac36 [core] move ProgramMap to within the gl::Program object 2019-03-20 15:40:47 +01:00
Konstantin Käfer
53ab65d811 [core] use constexpr string concatenation for uniform/attribute names 2019-03-20 15:40:47 +01:00
Konstantin Käfer
0ad2375e10 [core] remove a_/u_ prefix from attribute/uniform types 2019-03-20 15:40:47 +01:00
Konstantin Käfer
52cf9a1af3 [core] remove gl/context.hpp from more files, cast where necessary 2019-03-20 15:40:47 +01:00
Konstantin Käfer
c8cfdb1ced Merge pull request #14126 from mapbox/gfx-refactor-4
Graphics refactor #4
2019-03-15 20:31:12 +01:00
Konstantin Käfer
e27f330629 [core] add texture bindings to draw call instead of Context member fn 2019-03-12 11:03:54 +01:00
Konstantin Käfer
cb64c380fb [core] add texture bindings to draw call invocations 2019-03-12 11:03:54 +01:00
Konstantin Käfer
54847ea986 [core] add place for specifying textures/samplers separately from uniforms 2019-03-12 11:03:54 +01:00
Konstantin Käfer
9b5bbfcbdd [core] use abstract Context interface where possible 2019-03-12 11:03:54 +01:00
Mikhail Pozdnyakov
06a8ecdb17 Update mapbox-gl-js submodule to v0.53.0 2019-03-06 18:00:19 +02:00
Konstantin Käfer
3a57aa65d7 [core] move VertexBuffer<> to gfx namespace 2019-03-06 16:12:51 +01:00
Konstantin Käfer
4737a45383 [core] move IndexBuffer to gfx namespace 2019-03-06 16:12:51 +01:00
Konstantin Käfer
f13c2b86e4 [core] unify *Buffer/Vector naming 2019-03-06 16:12:51 +01:00
Konstantin Käfer
2f646af255 [core] make vertex descriptors constexpr 2019-03-06 16:12:51 +01:00
Konstantin Käfer
d5816b6db2 [core] remove unused template parameter from gl::IndexBuffer 2019-03-06 16:12:51 +01:00
Bruno de Oliveira Abinader
ba7427b4ac [core] Transform{State}: s/angle/bearing/ 2019-03-04 14:45:32 +02:00
Konstantin Käfer
67a9dc35bf [core] move CullFaceMode to gfx namespace 2019-03-01 09:33:37 +01:00
Konstantin Käfer
4372ce2b90 [core] move StencilMode to gfx namespace 2019-03-01 09:33:37 +01:00
Konstantin Käfer
4982933a78 [core] move DepthMode to gfx namespace 2019-03-01 09:33:37 +01:00
Konstantin Käfer
da6e1390c6 [core] move ColorMode to gfx namespace 2019-03-01 09:33:37 +01:00
Konstantin Käfer
fd37d90650 [core] move draw mode and primitives to gfx namespace 2019-03-01 09:33:37 +01:00
Konstantin Käfer
95deab32ce [core] extract attribute structs and gl::Vertex to separate namespace 2019-03-01 09:33:37 +01:00
Konstantin Käfer
3f1d754369 [core] rename gl::AttributeType to gl::Attribute to free up the name 2019-03-01 09:33:37 +01:00
Konstantin Käfer
cd06b550dd [core] disallow subtyping of gl::Attributes<> and use type aliases instead 2019-03-01 09:33:37 +01:00
Konstantin Käfer
55c7b86053 [core] extract uniform type lists from gl namespace 2019-03-01 09:33:37 +01:00
Mikhail Pozdnyakov
d37918c169 [core] Split layer type specific code in mbgl::Programs
Progams code for a certain layer type is encapsulted within
a dedicated `<layer type>Programs` class, inherited from
the generic base `LayerTypePrograms` class.

`mbgl::Programs::get<layer type>Programs()` lazily initializes the
layer type-specific programs code using pointer to the base class,
which allows LTO to remove this code from binaries (if the corresponding
`get<layer type>Programs()` method can never be invoked).
2019-01-11 16:43:52 +02:00
Konstantin Käfer
9afe75aa76 [core] address nits 2018-10-23 12:23:40 +02:00
Konstantin Käfer
c87c25cc84 [core] don't use <sstream> and <iomanip> for string construction 2018-10-23 12:23:40 +02:00
Bruno de Oliveira Abinader
05a7b78aa8 [core] Add face culling mode parameter to Program::draw
Add a parameter to Program::draw to control whether face culling should
be enabled. This will be used in a follow up commit to enable face
culling for fill extrusion layers.
2018-09-13 08:42:36 +03:00
Molly Lloyd
4a5dc37245 [core] Implement CrossFadedDataDrivenProperty to add support for feature expressions in *-pattern properties 2018-08-31 13:08:47 -07:00