Skip to content

fix(core): restore drawing buffer sync for attached GL contexts on resize#10281

Open
chrisgervang wants to merge 4 commits into
masterfrom
cg/fix-resize-regression-93
Open

fix(core): restore drawing buffer sync for attached GL contexts on resize#10281
chrisgervang wants to merge 4 commits into
masterfrom
cg/fix-resize-regression-93

Conversation

@chrisgervang
Copy link
Copy Markdown
Collaborator

@chrisgervang chrisgervang commented May 8, 2026

Summary

Fixes a resize regression in interleaved mode (MapboxOverlay / MapLibre) introduced by the CanvasContext adoption PR.

  • Restores the setDrawingBufferSize call in the attached-GL onResize callback

Root cause

webgl2Adapter.attach() sets autoResize: false on the canvas context (luma webgl-adapter.ts:73). This means luma's _updateDrawingBufferSize() skips updating the drawing buffer when the ResizeObserver fires — it only updates cssWidth/cssHeight.

The parent PR removed the manual setDrawingBufferSize call assuming luma would handle it, but luma explicitly does not for autoResize: false contexts. 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
  • Manual: basemap-browser example, MapLibre interleaved mode, resize window — deck overlay stays aligned with basemap

🤖 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 the webgl2Adapter.attach() onResize handler before Deck updates viewport state and forwards to any user onResize callback.

This prevents resize events from updating only CSS/viewport dimensions while continuing to render into an old-sized framebuffer when autoResize is 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.

ibgreen and others added 4 commits April 16, 2026 06:22
…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>
Base automatically changed from ib/canvas-context-93 to master May 26, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants