Skip to content

ENH: Introduce OverlayManager for Phase 1 fallback rendering#32002

Open
Vikash-Kumar-23 wants to merge 4 commits into
matplotlib:mainfrom
Vikash-Kumar-23:overlay-manager
Open

ENH: Introduce OverlayManager for Phase 1 fallback rendering#32002
Vikash-Kumar-23 wants to merge 4 commits into
matplotlib:mainfrom
Vikash-Kumar-23:overlay-manager

Conversation

@Vikash-Kumar-23

Copy link
Copy Markdown
Contributor

PR summary

This PR introduces the foundational OverlayManager to backend_bases.py, setting up the architecture required for high-frequency interactive overlays (like cursors and crosshairs) without triggering expensive background redraws.

Key Changes:

  • Added OverlayManager to manage registered overlay artists using weak references.
  • Attached OverlayManager to FigureCanvasBase initialization.
  • Implemented Phase 1 (Fallback Mode): Standard canvases automatically fall back to setting animated=False on artists and routing redraws to draw_idle().
  • Added unit tests in test_backend_bases.py to verify the fallback behavior, registration logic, and a future-looking test (currently marked XFAIL) for native compositing in Phase 2.

Addresses #30515 .

AI Disclosure

AI tools were used to assist in drafting text and suggesting validation scenarios.
All code changes, final implementation decisions, and verification were done manually.

PR checklist

  • "closes #0000" is in the body of the PR description
  • new and changed code is tested
  • Plotting related features are demonstrated in an example
  • New Features and API Changes are noted with a directive
  • Documentation complies with guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant