fix(core): restore drawing buffer sync for attached GL contexts on resize#10281
Open
chrisgervang wants to merge 4 commits into
Open
fix(core): restore drawing buffer sync for attached GL contexts on resize#10281chrisgervang wants to merge 4 commits into
chrisgervang wants to merge 4 commits into
Conversation
…size luma's webgl2Adapter.attach() sets autoResize: false, so the drawing buffer dimensions are never updated automatically when the canvas resizes. Without the explicit setDrawingBufferSize call, interleaved mode (MapboxOverlay/MapLibre) renders into a stale-sized framebuffer after window resize. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a resize regression in interleaved mode (MapboxOverlay / MapLibre) introduced by the CanvasContext adoption PR.
setDrawingBufferSizecall in the attached-GLonResizecallbackRoot cause
webgl2Adapter.attach()setsautoResize: falseon the canvas context (luma webgl-adapter.ts:73). This means luma's_updateDrawingBufferSize()skips updating the drawing buffer when the ResizeObserver fires — it only updatescssWidth/cssHeight.The parent PR removed the manual
setDrawingBufferSizecall assuming luma would handle it, but luma explicitly does not forautoResize: falsecontexts. The result: viewport dimensions updated correctly on resize, but rendering continued into the old-sized framebuffer.Test plan
yarn vitest run test/modules/core/lib/deck.spec.ts— 20/20 pass🤖 Generated with Claude Code
Note
Medium Risk
Touches core resize handling for attached WebGL contexts; small change but it affects rendering correctness in interleaved/overlay integrations and could have platform-specific side effects.
Overview
Restores manual drawing-buffer resizing for attached WebGL contexts by calling
canvasContext.setDrawingBufferSize()inside thewebgl2Adapter.attach()onResizehandler before Deck updates viewport state and forwards to any useronResizecallback.This prevents resize events from updating only CSS/viewport dimensions while continuing to render into an old-sized framebuffer when
autoResizeis disabled for attached contexts (e.g., Mapbox/MapLibre interleaved overlays).Reviewed by Cursor Bugbot for commit df0dd76. Bugbot is set up for automated code reviews on this repo. Configure here.