Skip to content

fix: prevent duplicate concurrent fetches and white images in RasterizingLayer - #3357

Merged
pauldendulk merged 1 commit into
mainfrom
fix_bug_in_rasterizing_layer
May 19, 2026
Merged

pauldendulk merged 1 commit into
mainfrom
fix_bug_in_rasterizing_layer

Conversation

@pauldendulk

Copy link
Copy Markdown
Member

What changed

Several issues were found while investigating failures in the rendering regression tests.

RasterizingLayer (main fix)

  • Prevent duplicate concurrent fetches: GetFetchJobs now returns an empty array when activeFetchCount > 0, matching the same guard already present in Layer.GetFetchJobs. Without this, DataFetcher.ViewportChangedAsync could start a second rasterize task while the first was still loading data, causing the layer to render a white image.
  • Use the correct FetchJob ID: FetchJob was constructed with _sourceLayer.Id instead of the rasterizing layer's own Id. This made the activeFetchCount guard ineffective because job tracking is keyed by layer ID.

TwoStepSymbolStyleRenderer / TwoStepVectorStyleRenderer (experimental renderer)

  • Both now implement ISkiaStyleRenderer as a fallback for cache misses. A ThemeStyle creates a new style instance on every GetStyle() call, producing a new GenerationId each time — so the drawable cache always misses, and features were silently not rendered. The fallback delegates directly to the underlying SymbolStyleRenderer / VectorStyleRenderer and fixes this case (e.g. SelectionStyleSample).

VisibleFeatureIterator

  • layerStyles is now materialised to a list before iteration (minor cleanup, no behavioral change).

CustomPointStyleShaderSample

  • The custom renderer was only registered on Mapsui.Rendering.Skia.MapRenderer. Added the matching registration on Mapsui.Experimental.Rendering.Skia.MapRenderer, consistent with CustomPointStyleBasicSample and CustomPointStyleAdvancedSample.

Regression test config

  • Removed the test-project-level config.json / config.local.json lookup. TestConfiguration now reads only from the repository root, so there is a single authoritative config location.

Skill / documentation

  • Updated regression-tests skill to clarify that the copy-images script is for intentional rendering changes only, and that the experimental renderer must produce pixel-identical output to the standard renderer for all non-ExperimentalOnlySamples samples.

@pauldendulk pauldendulk added the PR type: 🐛 Fix A bug fix or patch for existing functionality. label May 18, 2026
@pauldendulk
pauldendulk merged commit b45347b into main May 19, 2026
6 of 8 checks passed
@pauldendulk
pauldendulk deleted the fix_bug_in_rasterizing_layer branch May 19, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR type: 🐛 Fix A bug fix or patch for existing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant