Repository navigation
fix(google-maps): wait for shared context in interleaved mode - #10792
Conversation
Co-authored-by: Codex <noreply@openai.com>
|
Bind the positioning callback to the mode already selected for the WebGL callback. A setProps change before onAdd must not skip standalone Deck creation or create an interleaved Deck without Google's context. Add regression coverage for both mutations before callbacks run. Co-authored-by: Codex <noreply@openai.com>
Keep onDraw on the mode selected for the context lifecycle callbacks. Updating interleaved while those callbacks are pending or after Deck initializes must not draw through the other context path. Cover both callback orders and prop-change timings with creation and drawing assertions. Co-authored-by: Codex <noreply@openai.com>
chrisgervang
left a comment
There was a problem hiding this comment.
Thanks, I was able to reproduce this issue in the basemap-browser example and confirmed this PR fixed it.
|
Please fix CI and then we can merge |
|
This also fixes #10059 and #10056. Could you add From Claude #10056's screenshots show the same thing on 9.2.10, where layers are drawn into a default 300×150 own canvas. |
Standalone Decks in the new tests each created a WebGL context that was never released, so Chromium evicted the shared test device and later suites failed to link shaders.
Closes #10704
Closes #10059
Closes #10056
Background
Positioning
onAddcreates Deck without Google'sgl;_onContextRestoredreuses it, so interleaved layers never draw. Prop changes can also make drawing use a different mode from context creation.Change List
Verified
corepack yarn lintandcorepack yarn test-headless --reporter=verbose test/modules/google-maps(21 passed). Eight drawing regressions fail before the draw-mode correction; the positioning-first regression fails on master. Twelve additional real-WebGL probes pass.Please backport to
9.3-releaseand9.4-release; we pin9.3.11.Note
Medium Risk
Touches vector-map WebGL lifecycle and render path (shared vs standalone context); behavior change is targeted but affects default interleaved rendering on Google Maps.
Overview
Fixes interleaved vector Google Maps overlays where Deck could be created on the positioning overlay before Google’s shared WebGL context arrived, so layers never rendered into the map’s GL context. Interleaved mode now skips
createDeckInstancein_onAddVectorOverlayand only builds Deck in_onContextRestoredwith the suppliedgl.Creation-time
interleavedis bound into_onAddVectorOverlayand_onDrawVectorwhen vector overlays are set up, so draw behavior (shared-context_drawLayersvs standaloneredrawand canvas sizing) stays aligned with how Deck was created even ifinterleavedprops change later.Adds Vitest coverage for positioning vs context callback order, interleaved/non-interleaved GL ownership, vector draw paths, and a
finalizeOverlayhelper that tears down standalone Deck WebGL devices so headless tests don’t evict the shared device.Reviewed by Cursor Bugbot for commit 69571f2. Bugbot is set up for automated code reviews on this repo. Configure here.