Commit Graph

138 Commits

Author SHA1 Message Date
Mikhail Pozdnyakov
ef3d04dee5 [core] Export symbol placement update status from MapObserver 2019-08-23 10:56:05 +03:00
Aleksandar Stojiljkovic
2c5528e691 Fix layers rendering after fill-extrusion
This fixes following issues:
* Fix some false passing combinations/fill-extrusion-translucent--XXXX tests
* Fix and enable other, failing but ignored, combinations/fill-extrusion-translucent--XXXX tests
* Fix rendering of layers that are on top of fill-extrusion layers

state.getProjMatrix(nearClippedProjMatrix, 100) caused that tests with size 64x64 were not
rendering fill extrusions: far plane calculated as 96.9 and near plane set to 100 was the cause.
near plane is changed from hardcoded 100 to depend on state.getCameraToCenterDistance() - producing
similar value but one that follows max zoom.

This caused that e.g. combinations/fill-extrusion-translucent--fill-opaque was falsely passing as
only fill-opaque layer got rendered.

combinations/fill-extrusion-translucent--XXXX tests expose regression https://github.com/mapbox/mapbox-gl-native/issues/14844#issuecomment-503600034 in #14844, #14779.

Fix (opaquePassCutoff, is3D) is ported from https://github.com/mapbox/mapbox-gl-js/pull/7821

Fixes: #14844, #14779, #15039
2019-07-09 15:13:38 +02:00
Mikhail Pozdnyakov
658d68e38c [core] Introduce RenderOrchestrator 2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
4283c9bb34 [core] Introduce RenderTree
Split orchestration from rendering in the `Renderer::Impl` implementation.
2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
c09cbaf6e0 [core] PaintParameters do not need UpdateParameters 2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
cfe11f563d [core] Remove RenderPass::Upload 2019-06-25 12:53:52 +03:00
Mikhail Pozdnyakov
23d8ae5e73 [core] Simplify RenderLayer::upload()
Now `RenderLayer::upload()` accepts only `uploadPass`, similar to other uploadable objects.

Few simplifications were made in the `LineLayer` prepare stage.
2019-06-25 12:53:52 +03:00
Konstantin Käfer
ce91218b42 [core] don't call glFlush on every frame 2019-06-12 18:08:18 +02:00
Mikhail Pozdnyakov
a9abc43510 [core] Introduce PatternAtlas 2019-06-04 15:28:00 +03:00
Mikhail Pozdnyakov
c0e5632001 [core] Remove ImageManager from upload parameters 2019-06-04 15:28:00 +03:00
Mikhail Pozdnyakov
b242883587 [core] Use fresh transform state for bucket vertices update in placement
The transform state cached in placement might get stale and cannot be used for bucket vertices updates.
2019-06-03 17:03:57 +03:00
Konstantin Käfer
81667ae4e9 [core] end the RenderPass/CommandEncoder before sending events 2019-05-28 16:11:05 +02:00
Mikhail Pozdnyakov
a03f7b166b [core] RenderTile does not expose Tile
RenderTile and Tile will be split when ochestration movces to a separate thread.

This PR improves encapsulation of Tiles management: now performed within TilePyramid.
2019-05-28 16:16:42 +03:00
Mikhail Pozdnyakov
aa3a7cf02f [core] SymbolBucket updates complete at placement stage
`RenderSymbolLayer` does not have to update dynamic vertices of its buckets, this logic is moved to placement (which is already updates opacity vertices).

* fixes clustering of labels when text variable placement enabled - as assignes `usesVariablePlacement` per bucket
* simplifies the code in `RenderSymbolLayer` (the `RenderSymbolLayer::upload()`	is now omitted).
* symbol buckets are not modified after orchestration finishes
2019-05-24 10:54:06 +03:00
Mikhail Pozdnyakov
e79080771b [core] RenderLayer::render(PaintParameters, RenderSource*) -> render(PaintParameters) 2019-05-22 16:41:10 +03:00
Mikhail Pozdnyakov
25093370e2 [core] RenderLayer::setRenderTiles(RenderTiles) -> prepare(LayerPrepareParameters)
RenderLayer::prepare() is responsible for the complete initialization of a render
layer, so that it can render.
2019-05-22 16:41:10 +03:00
Mikhail Pozdnyakov
84d3b5f899 [core] Prepare render sources before render layers are initialized 2019-05-22 16:41:10 +03:00
Alexander Shalamov
100eb61fa4 [core] Forward ImageManagerObserver::onRemoveUnusedStyleImages to MapObserver interface 2019-05-21 06:49:17 -07:00
Alexander Shalamov
d24524440c [core] Add onRemoveUnusedStyleImages observer API 2019-05-21 06:49:17 -07:00
Mikhail Pozdnyakov
f2ad89c463 [core] Remove RenderLayerSymbolInterface 2019-05-19 18:15:33 +03:00
Mikhail Pozdnyakov
44fd6dcf7c [core] Placement accepts RenderLayer instances 2019-05-19 18:15:33 +03:00
Mikhail Pozdnyakov
febe696d4b [core] Avoid unneeded proj matrix calculations in renderer 2019-05-19 18:15:33 +03:00
Mikhail Pozdnyakov
0e45138547 [core] RenderLayerSymbolInterface is not used in CrossTileSymbolIndex 2019-05-19 18:15:33 +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
179c5fe83b [core] add gfx::CommandEncoder::present() 2019-05-15 11:57:43 -07:00
Mikhail Pozdnyakov
953ee5e81b [core] Create glyph manager at renderer construction time
Avoid unnecessary glyph manager presence check in `Renderer::Impl::()`.
2019-05-14 11:29:24 +03:00
Thiago Marcos P. Santos
06f1dc48a2 [core] Make the BackgroundScheduler a singleton
- Do not carry it over everywhere as parameter, it is a shared
  instance anyway and the lifecycle is pretty much the app lifecycle
  from the moment we instantiate a map.
- Rename to BackgroundScheduler because it is a Scheduler that will
  do tasks in the background, we don't make assumptions if it is a
  thread pool or a single thread.
- Most importantly, remove the dependency from `core` on `platform`.
2019-05-10 14:20:38 +03:00
Mikhail Pozdnyakov
4c8295e672 [core] Less strict rules for adding render layers to sources 2019-04-29 17:03:23 +03:00
Konstantin Käfer
08163713e2 [core] change approach to stencil clipping to (almost) match JS 2019-04-29 11:37:39 +02:00
Mikhail Pozdnyakov
3832a081cb [core] RendererImpl::dumDebugLogs() -> dumpDebugLogs() 2019-04-25 17:44:00 +03:00
Mikhail Pozdnyakov
f392053df6 [core] Create ImageManager at renderer construction 2019-04-25 17:44:00 +03:00
Alexander Shalamov
9a70e755dc [core] Track missing style images that were provided by client
- Track images provided by client thruough onStyleImageMissing API
- Handle reduceMemoryUsage in ImageManager, via Renderer API
- Release client provided images when no tiles are using them
2019-04-25 10:00:23 +03:00
Mikhail Pozdnyakov
b96d824b2d [core] Simplify RenderLayer interface. 2019-04-17 17:21:41 +03:00
Mikhail Pozdnyakov
7a7192516f [core] Introduce LayerRenderData. Source::update() accepts layer properties. 2019-04-17 17:21:41 +03:00
Mikhail Pozdnyakov
4bc79cf4ff Use emplace_hint for inserting render items 2019-04-12 16:17:57 +03:00
Mikhail Pozdnyakov
feaff9260e [core] Order render items properly across several sources 2019-04-12 16:17:57 +03:00
Mikhail Pozdnyakov
8faf47ab5e [core] Pass only visible render layers to source in renderer
This simplifies the code and make it slightly more performant.

Also, this change enables initialization the `RenderTile.used`
field from inside the source (currently done in render layers).
2019-04-09 13:04:21 +03:00
Konstantin Käfer
3ceabcd3ec [core] clang-tidy fixes 2019-04-05 11:49:17 +02:00
Konstantin Käfer
d7aaf83421 [core] introduce gfx::RenderPass 2019-04-05 11:49:17 +02:00
Konstantin Käfer
7081d5e154 [core] move depth/stencil buffer debug viz to gfx::Context 2019-04-05 11:49:17 +02:00
Konstantin Käfer
1d58850d0c [core] remove Renderer::flush 2019-04-05 11:49:17 +02:00
Konstantin Käfer
5cc3d7a733 [core] move GLContextMode to RendererBackend 2019-04-05 11:49:17 +02:00
Konstantin Käfer
4f735db9d8 [core] move RenderParameters creation to a later stage 2019-04-05 11:49:17 +02:00
Konstantin Käfer
66c020034e [core] refactor RendererBackend 2019-04-05 11:49:17 +02:00
Konstantin Käfer
a782a6d15b [core] move BackendScope to gfx namespace 2019-04-05 11:49:17 +02:00
Konstantin Käfer
c02010ab6c [core] move debug groups to gfx::CommandEncoder 2019-04-05 11:49:17 +02:00
Konstantin Käfer
543b678982 [core] introduce CommandEncoder object 2019-04-05 11:49:17 +02:00
Konstantin Käfer
394e2aa717 [core] prefer static_cast for casts to derived classes 2019-04-05 11:49:17 +02:00
Konstantin Käfer
be3b5917c1 [core] add generic base class for renderbuffers 2019-04-05 11:49:17 +02:00
Konstantin Käfer
839f4687aa [core] gl::RenderbufferType -> gfx::RenderbufferPixelType 2019-04-05 11:49:17 +02:00